isSignalConnected correct usage
-
to check if a signal is connected I use this code:
if (!this->isSignalConnected(QMetaMethod::fromSignal(&QtVariantPropertyManager::propertyChanged))) { connect( sdkItemPropManager, SIGNAL( propertyChanged( QtProperty * ) ), this, SLOT( onUpdatePropertyValues() ) ); connect( sdkEmuManager, SIGNAL( propertyChanged( QtProperty * ) ), this, SLOT( onUpdatePropertyValues() ) ); }But I always got an Assert:
ASSERT failure in QObject::isSignalConnected: "the parameter must be a signal member of the object", file \Users\qt\work\qt\qtbase\src\corelib\kernel\qobject.cpp, line 2539Is there an explanation that you can understand?
-
Why not simply use Qt::UniqueConnection?
According to the documentation: "signal must be a signal member of this object, otherwise the behaviour is undefined."
-
@Christian-Ehrlicher said in isSignalConnected correct usage:
Qt::UniqueConnection
ok, this is really a good and helpfull tip. Thank you. But also Iam interrested why the initial code do not work.
-
@Christian-Ehrlicher said in isSignalConnected correct usage:
Qt::UniqueConnection
ok, this is really a good and helpfull tip. Thank you. But also Iam interrested why the initial code do not work.