Category : qcheckbox

I would like to filter the items in a PyQt5 QCombobox when checking certain checkboxes. Example: samplelist=["a1","a2","a3","b1","b2","b3"] is the list of items of the QCombobox comboBox and I have two checkboxes checkBoxa and checkBoxb. If checkboxa checked and checkboxb unchecked: comboBox has the items ["a1", "a2", "a3"] checkboxa unchecked and checkboxb is checked: comboBox has ..

Read more

I’m using python3 and PyQt5. The example below has three QPushButtons and a QCheckBox with setTristate to true. I can click directly on the checkbox and it will cycle through the three states just fine. THE PROBLEM: If I attempt to set the state value from the neighboring buttons, it only gives me checked or ..

Read more

As a basic example, from PySide2.QtWidgets import QApplication, QDialog, QCheckBox, QHBoxLayout import sys app = QApplication([]) window = QDialog() layout = QHBoxLayout() check = QCheckBox(‘Checkie McCheckerson’) layout.addWidget(check) layout.addStretch(1) window.setLayout(layout) window.show() sys.exit(app.exec_()) When the window is resized by the end-user, I want the checkbox’s indicator to stretch with it, either as well as or instead of ..

Read more

I’m using a QTreeView with a custom QStyledItemDelegate to display various parameter items. I want all of the items to have a check indicator, however some of the Checkboxes should be disabled (but still visible and set checked!). Here’s the Delegate code: class MyDelegate(QtWidgets.QStyledItemDelegate): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def initStyleOption(self, option, index): super().initStyleOption(option, ..

Read more