Disabled checkbox for QTreeWidget
-
21-02-2021 - |
Frage
Does anyone know how to make an uneditable checkbox ina QTreeWidgetItem but keep the QTreeWidgetItem selectable?
Lösung
Don't set the flag Qt.ItemIsUserCheckable
of the item, but set the checkState
to Qt.Checked
or Qt.Unchecked
.
The presence of a checkbox and the user checkability are independent.
Andere Tipps
Try this:
setCheckState(0,Qt::Checked);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow