I would like to make a nested list of QCheckBoxes sort of like a cross between a QtreeWidgetItem and a QCheckBox. From what I have found googling, I can set a flag in a QTreeWidgetItem to make it checkable. So I have this code:
QTreeWidgetItem *treeWidgetItem = new QTreeWidgetItem(parent);
treeWidgetItem->setFlags(Qt::ItemIsUserCheckable);
However, when the item is displayed in my QTreeWidget, there is no checkbox. The row appears greyed out. How would I make the QTreeWIdgetItem checkable?
You need to call setCheckState on your QTreeWidgetItem to ensure that the checkbox appears. This is from the Qt documentation.
Even if you want the checkbox to be off you still have to do this.