Hi all, I would like to know if it is possible to have a TreeView widget displaying check boxes only on some nodes. Up to now I tried subclassing QAbstractItemModel in this way:
Qt Code:
{ if (index.isValid()) { MyNode* node = static_cast<MyNode*>(index.internalPointer()); if (node->needsCheckbox()) return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; } return Qt::NoItemFlags; }To copy to clipboard, switch view to plain text mode
but the only result I got is that all nodes have a checkbox, and the ones that fail the node->needsCheckbox() method looks greyed out.
Do I need a custom delegate?
Thanks in advance...
Bookmarks