You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, July 5th 2008, 12:42pm

QTreeWidget with checkboxes

Hello,

I have a QTreeWidget without Checkboxes. Now I want to program a QDialog which contains the same QTreeWidget, but all items shall have a checkbox.

I tried 2 ways, but none of them was successful:

1. Create a new QTreeWidget and call setModel() with the Model of the first tree and then setFlags(Qt::ItemIsUserCheckable). But no CheckBox is visible.

2. Create a new QTreeWidget and insert a QTreeWidgetItem::clone() of the top level items of the first tree.
Then also setFlags(Qt::ItemIsUserCheckable). But no CheckBox is visible.

Does anybody have an idea?

Alex