Disabled checkbox for QTreeWidget

3.7k Views Asked by At

Does anyone know how to make an uneditable checkbox ina QTreeWidgetItem but keep the QTreeWidgetItem selectable?

2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

Try this:

setCheckState(0,Qt::Checked);