I have a Qt / C ++ application with a normal GUI stream and network stream. The network stream uses an external library, which has its own event loop based on select (), so the network stream does not use the Qt event system.
At the moment, the network stream simply emits () s signals when various events, such as a successful connection, occur. I think this works fine, as the signal / slot mechanism correctly places the signals for the GUI stream.
Now I need the network stream to call the GUI stream to ask questions. For example, a network stream may require a GUI stream to request a dialog to request a password.
Does anyone know a suitable mechanism for this?
My best idea is to wait for a network stream using QWaitCondition after allocating an object ( emit passwordRequestedEvent(passwordRequest); ). The passwordRequest object would have a handle to a specific QWaitCondition and therefore could signal it when a decision was made ..
Is this something reasonable? or is there another option?
source share