[Qt-interest] block signals only in current class
Malyushytsky, Alex
alex at wai.com
Tue Aug 11 22:18:44 CEST 2009
Signals are related to the specific instance of the class (object).
If you want specific object don't receive specific signal,
you may disconnect that object from the signal.
Syntax is similar to the way you connect it.
Then you can restore connection when you need it again.
Can be done as many time as you need it.
Hope this helps.
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Matthias Pospiech
Sent: Tuesday, August 11, 2009 1:33 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] block signals only in current class
I have a class (RotationStage) that has a variable 'velocity'. The class
is a Singleton.
This velocity can be changed in different classes and is displayed in
different dialogs.
If the velocity is changed with
RotationStage->setVelocity(velocity)
then RotationStage emits 'velocity changed', so that all dialogs can
update their velocity displays.
However, I want to avoid that the signal of RotationStage changes the
QDoubleSpinBox, that originaly
changed the velocity value. But if I would block the Signals from
RotationStage "RotationStage->blockSignals(true);",
that would stop every dialog from getting this signal which is not what
I want.
Or do this signals apply only to my class despite that RotationStage is
a Singleton?
Matthias
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
"Please consider our environment before printing this email."
More information about the Qt-interest-old
mailing list