View Full Version : enabling a QTreeWidgetItem as false

3rd March 2006, 08:21

I have created QTreeWidgetItem. Now i want to set the items in the tree as false initially and on passing of some info they will be set to true.
false means they will not respond to any click event.
true means they will respond to the click event.

I tried using the setEnabled function but it seems that there is not setEnabled function for QTreeWidgetItem.

Please tell me how to set the tree item as false so that am able to initialize them as false and then later as true.

Thanking you,


3rd March 2006, 08:29

The default value for flags is Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled. If the item was constructed with a parent, flags will in addition contain Qt::ItemIsDropEnabled.

Remove default flag Qt::ItemIsEnabled by using:
QTreeWidgetItem::setFlags() (http://doc.trolltech.com/4.1/qtreewidgetitem.html#setFlags)

3rd March 2006, 08:32
Thanks a lot.

Its resolved