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

有帮助吗?

解决方案

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.

其他提示

Try this:

setCheckState(0,Qt::Checked);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top