c++ - How to check the state of signal in Qt? -
this question has answer here:
the following win32 code checks if event signaled or not without waiting on it.
handle = createevent(null, true, false, null); bool signaled = waitforsingleobjectex(handle, 0, true) != wait_timeout;
what equivalent in qt?
what trying accomplish:
i have 2 threads listener , sender (which sends commands). when user clicks button, operations sends series of commands need verify response first command received (and examine it) before send following command. thought synchronize them around mutex or something..the receiver signal mutex when data received , send can wait on it. looking convenient way in qt accomplish this. using qtcpserver
derived class , listen()
method listen on port.
there none, because signals stateless concept. in qt, signal function call. there's no concept of signal being "signaled". signal "being signaled" 1 method call hasn't returned yet - recall signals methods moc-generated code.
Comments
Post a Comment