PDA

View Full Version : Cancel QTreeWidgetItem item modification



ricardo
1st July 2009, 12:02
Hi friends!

I have a QTreeWidgetItem, when user cliks it (change a checkbox, for instance), it sends this signal:
itemChanged ( QTreeWidgetItem * item, int column )

My question is, how can I cancel the modification user is doing? (let's say, some file is not open)
Any idea?

Thanks.

wysota
1st July 2009, 13:21
You can reimplement setData() of the item class and don't allow the change if it should not happen. Alternatively use the model approach and return false from the model's setData() method.