PDA

View Full Version : When itemChanged is emitted, can the change type be detected?



johnny_sparx
5th April 2006, 22:59
QTreeWidget::itemChanged(QTreeWidgetItem*,int) signals when an item has changed. Is there a way to detect what has changed?

For example, if I edit an item (let's say it is text) - the signal is emitted. Based on the text value, the color of this item is changed. In a validation scheme, this would be like an item turning red because the value was not acceptable.

In the above case, the signal is emitted for the color and text change. I only want my block of code to be executed once so how can this be done? I am assuming that this can be done by detecting the type of change that occured... Is this reasonable?

J.

Chicken Blood Machine
6th April 2006, 00:00
Block signals when changing the color of the text.

johnny_sparx
7th April 2006, 17:28
You can do that???
How can one block a signal?

Once a connect has been established, I assumed that the mechanism could not be broken....

Chicken Blood Machine
7th April 2006, 17:29
Look at QObject::blockSignals(bool)