[Qt-interest] QObject::disconnect() Return Value

Malyushytsky, Alex alex at wai.com
Thu Jul 1 04:37:15 CEST 2010


I always used logical assumptions that it returns false if currently there is NO requested connection established for any reason.
( no such slot of that specific object is connected / exist , the same as no requested signal of that specific object exist ).

This may be due to mistype of slot name and by design - for example if you want to make sure that only one connection exist and you have no idea if it was connected or not at that time , you just call disconnect, then connect if necessary.

If connection found it always will be disconnected.

Regards,
    Alex


-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Jeffery MacEachern
Sent: Wednesday, June 30, 2010 6:22 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] QObject::disconnect() Return Value

The Qt documentation states that QObject::disconnect() "Returns true
if the connection is successfully broken; otherwise returns false.".
In what type of situation would it fail to disconnect?  I don't recall
seeing the return value checked in any example code that I have read.

- Jeffery MacEachern
_______________________________________________
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