Created
February 8, 2020 04:44
-
-
Save pablo384/b824aa9262a596516edf0173e870694d to your computer and use it in GitHub Desktop.
Wait for some signal c++ QT source:https://stackoverflow.com/questions/41121932/what-is-the-simplest-way-to-make-your-program-wait-for-a-signal-in-qt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QEventLoop loop; | |
connect(this, &SomeObject::someSignal, &loop, &QEventLoop::quit); | |
// here you can send your own message to signal the start of wait, | |
// start a thread, for example. | |
loop.exec(); //exec will delay execution until the signal has arrived | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment