how to check whether the connect in QT is successful or not
-
Hi I have
situation in which I connect a signal slot and pass some pointers in SLOT
now I question is that some time pointer allocation is done later but connect in done earlier so how do in code we can that connect fro signal and slot is successful
-
@Qt-Enthusiast said in how to check whether the connect in QT is successful or not:
how do in code we can that connect fro signal and slot is successful
Use
qDebug()
which returnstrue
if connect is successful. -
Technically it's return QMetaObject::Connection which has qDebug operator that returns true or false. But that's mostly nitpicking.
I would suggest using the new Qt5 Signal/Slot syntax, it checkes connections at compile time, meaning, if the connect can't work the compiler stops and you don't have a working program.
Simple.
[edit: fixed Qt typo SGaist]