tags:

views:

188

answers:

1
+2  A: 

Do you connect anything else to m_variantManager? Disconnecting line will disconnect everything from "this", but you connect back only one slot.

Not sure if this will fix something, but you can stop signals on one object using object->blockSignals(true). This will shut the object up untill you call the function with false.

Try disconnecting only signal you connect, shutting m_variantManager instead of disconnecting, and adding qDebug() in relevant slots -- there is some rogue signal emitted when you disconnected it seems.

EDIT: Since you implement the slot yourself, you can always have a flag and check it in PropertyBrowser::valueChanged then just ignore the signal.

I wonder if m_variantManager->addProperty() (called from setSelected() doesn't immidiately set the values, or sets them but queues updates. Then your disconnecting in objectUpdated() causes those events to be discarded.

Eugene
Using `m_variantManager->blockSignals` seems to have the exact same effect as disconnect/reconnecting as I'd expect, although it does make for nicer code. **I'm** not connecting anything else to m_variantManager but perhaps you're right that something else is inadvertently... maybe I can use a SignalSpy or something to find out what it is. I'll have to try this tomorrow. Thanks. Otherwise, instead of blocking m_variantManager from sending the `valueChanged` signal, can I prevent the objects from receiving it temporarily?
Mark
"Try disconnecting only signal you connect" -- that did it. Didn't realize you could pass more args to `disconnect`, still new to Qt :) Still don't know what was causing this behaviour, but oh well...
Mark
Looks like some other signals are connected to "this" from m_variantManager, probably in constructor: new QtVariantPropertyManager(this).
Eugene