Unsolved Blocking a signal
-
Hi all,
Is there any way to block a signal from emitting?
For example, i have a signal defined in my program, which i am emitting in a function likemy class:: func xyz(){
emit abcsignal();
}
I am emitting signal based on few conditions, for some reason in one condition i don't want it to emit,
any way to prevent abcsignal from emitting ?Thank you
-
Hi
Just use a normal if ?my class:: func xyz(){
if ( condition )
emit abcsignal();
else
qDebug() << "signal not emitted";
} -
Also you can use function
blockSignals(true)
to prevent signal from emiting.More information - http://doc.qt.io/qt-4.8/qobject.html#blockSignals
-
@mrjj thank you for the reply... ya i have used if condition.