17 #include <boost/lexical_cast.hpp>
23 bool waitForQueuedSignal(QObject*
object,
const char* signal,
int maxWaitMilliSeconds,
bool silentAtArrive)
27 bool signalArrived = !listener.
timedOut();
28 std::string feedback = signalArrived ?
" arrived." :
" did NOT arrive. Timed out. ";
30 std::cout <<
"[QueuedSignalListener] " << signal << feedback << std::endl;
37 createTimer(maxWaitMilliSeconds);
38 createEventLoop(
object, signal);
50 int retval = mLoop->exec();
59 void QueuedSignalListener::quit()
61 mTimedOut = (this->sender() == mTimer);
66 void QueuedSignalListener::createTimer(
int maxWaitMilliSeconds)
69 mTimer->setInterval(maxWaitMilliSeconds);
70 QObject::connect(mTimer, SIGNAL(timeout()),
this, SLOT(quit()));
73 void QueuedSignalListener::createEventLoop(QObject*
object,
const char* signal)
75 mLoop =
new QEventLoop;
76 QObject::connect(
object, signal,
this, SLOT(quit()));