Because I can't. The QML engine is loading, creating the objects. There is 
nothing I can return to.

Its like I want to create the event loop, init, then hand the app.exec() pick 
up the events already queued in the event loop...



> Sent: Thursday, April 11, 2019 at 3:20 AM
> From: "Tony Rietwyk" <t...@rightsoft.com.au>
> To: interest@qt-project.org
> Subject: Re: [Interest] Signals, slots before the event loop starts?
>
> Hi Jason,
>
> 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@qt-project.org
> > https://lists.qt-project.org/listinfo/interest
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to