[Interest] Signals, slots before the event loop starts?
tony at rightsoft.com.au
Thu Apr 11 03:20:02 CEST 2019
Why can't your initialisation pass back a status to the main routine?
Otherwise I suggest to use a short timer, so it gets picked up early
when the main event loop starts.
Hope that helps, Tony
On 11/04/2019 8:18 am, Jason H wrote:
> I've now come across two places in my code where this is an issue (at various states of initializing)
> In a QObject who is exported to QML, and is instantiated just below the top-level Window:
> // in the object's open() method:
> if (!_serialPort.open(QIODevice::ReadWrite))
> qApp->quit(); // won't actually quit - no use if I can't use the serial port. (because another instance is using it)
> Then I have a ready() signal that is emitted when the serial device is ready, however the QML, when I hook onReady, it never gets called. I have to use a Component.onCompleted at the top level. However, there is async serial I/O happening, so there is at least one event loop?
> What can I do to make sure these things work?
> Interest mailing list
> Interest at qt-project.org
More information about the Interest