Connect Signal to boolean variable
Solved
General and Desktop
-
That is my idea (mnC is an object in a paralel thread)
connect(mnC,SIGNAL(connected(bool)),this->isConnected,SLOT(append(bool) ,Qt::QueuedConnection);
Please can somebody help me to make a direct connection between the boolean "isConnected" in MainWindow and the signal "connected" in thread?
Thanks in advance
-
-
@yczo Well you can use C++11 features. Instead of creating a slot you can do:
connect(mnC, &MNCClass::connected, [=](const bool status){ isConnected = status; });
P.S: I don't know name of class which contains connected so used
MNCClass
. Change it to your actual classname.