On Mon 27 Aug, 2018, 23:32 Thiago Macieira, <thiago.macie...@intel.com> wrote:
> On Monday, 27 August 2018 10:29:14 PDT Ramakanth Kesireddy wrote: > > > It's not recommended. It's required. The QCoreApplication object must > be > > > created in the same thread as the thread that created the first > QObject. > > > Usually. QCoreApplication is the first QObject anyway. > > > Inside Qt, that thread is understood as "the main thread" or "the GUI > > > thread". > > > But it need not be the same thread that main() was run on. Just make > sure > > > that > > > no other QObject was created before. > > > > GUI is run in a separate thread instead of main thread of UI app process. > > The QCoreApplication object is > > created in the same worker thread that created the first QObject. Do > you > > foresee any issues with the same? > > As I said, for Qt's purposes, the main thread and the GUI thread are the > same > thread and are the thread that created the first QObject. How that thread > was > started is irrelevant. > > > Is there any API to wait on the eventloop till it returns zero so that > > eventloop is exited normally? > > There's no need to wait, since everything is happening in the same thread. > The > event loop is started by the exec() function in QCoreApplication, QThread > or > QEventLoop. Once the event loop exits, that function returns and the next > line > in the function is executed. > > If you started that thread through some non-Qt means, just wait for the > thread > to exit. > Thanks a lot for your response. I started the thread through some non-qt means(using pthread)..Before terminating the thread, would like to ensure eventloop is exited normally. But when qApp-quit() would take time before which thread is deleted. Is there any means that thread is deleted only after qt eventloop is exited normally? > -- > Thiago Macieira - thiago.macieira (AT) intel.com > Software Architect - Intel Open Source Technology Center > > > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest