Awesome , this was exactly what i wanted![]()
The sibling thingie makes things much easier but its good to know how to sort it out the way i was trying so i know my mistake
Thank you
Awesome , this was exactly what i wanted![]()
The sibling thingie makes things much easier but its good to know how to sort it out the way i was trying so i know my mistake
Thank you
Is there any way to set some of the colums of my model to not be editable ?
Also my second column contains double variables. When you click to it you get a QDoubleSpinBox but it only allows 2 decimals ! How can i change that to lets say 5 ?
Yes, reimplement QAbstractItemModel::flags() for your model and make sure ItemIsEditable is not returned for indexes from those columns.
Reimplement either QAbstractItemDelegate::createEditor() or QAbstractItemDelegate::setEditorData().Also my second column contains double variables. When you click to it you get a QDoubleSpinBox but it only allows 2 decimals ! How can i change that to lets say 5 ?
Hi Wysota,
Sorry to bug you, but I've been trying to use a QtreeView with checkboxes enclosed for each item with not much progress. I followed some thread in the forum and reimplement the flags method in my model class to include ItemIsUserCheckable. Now I can see the checkboxes appear next to each item in the tree. However, I cannot check or uncheck the checkboxes at all. I see some people advice that I should implement the setData() method in my model class but I have no clue on how to do that. Could you shed some light here?
Thanks a lot
Sincerely,
Wieland J.
Bookmarks