[Interest] How to start object in the thread?

igor.mironchik at gmail.com igor.mironchik at gmail.com
Sun Jun 8 12:42:39 CEST 2014


I’ve added Launcher that works on the main thread. His job is just emit start() signal.
My Object on the different thread connects to this start() signal.

Now Launcher emits start() signal. All is ok. But Object doesn’t receive it... Why?

From: igor.mironchik at gmail.com 
Sent: Sunday, June 08, 2014 12:10 PM
To: interest at qt-project.org 
Subject: How to start object in the thread?

Hi,

for example I have Object with slot start.

And I create that object with the next code:

QCoreApplication app( argc, argv );

Object o;
QThread t;
o.moveToThread( &t );
t.start();

QTimer::singleShot( 0, &o, SLOT( start() ) );

app.exec();

But this code doesn’t invoke slot start() after launching.

And there is my question: how to invoke SLOT start() of Object on the different thread and app start-up?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140608/5eb49c8e/attachment.html>


More information about the Interest mailing list