PDA

View Full Version : Missing messages to QTextBrowser



Nickolay
28th August 2010, 11:38
I have workObject moved to separate thread by moveToThread().
Then I need to log some messages from workObject to QTexBrowser in main thread,
but I saw lost of messages as in log below:



[13:22:56] Starting ...

Host: 192.168.0.150 // OK!
inputPort: 12001
outpurPort: 12001

[13:23:59] Terminate
[13:23:59] Starting ... // missing! <- in this plase must be log info
[13:24:02] Terminate
[13:24:02] Starting ... // missing! <- in this plase must be log info
[13:24:03] Terminate
[13:24:04] Starting ... // missing! <- in this plase must be log info
[13:24:05] Terminate
[13:24:05] Starting ... // missing! <- in this plase must be log info
[13:24:06] Terminate
[13:24:06] Starting ... // missing! <- in this plase must be log info
[13:24:07] Terminate
[13:24:08] Starting ... // OK!

Host: 192.168.0.150
inputPort: 12001
outpurPort: 12001

On push StartButton I create new workObject and then put it to separate thread as below:

workObject ::workObject ()
{
// move to thread
moveToThread(Core::ICore::instance()->threadManager()->getRealTimeThread());
connect(this, SIGNAL(myStart()), this,SLOT(onStart()),Qt::QueuedConnection);
emit myStart();
}

Then execute some app specific initialization in newly created thread - slot onStart(), during this I send messages to log as above.

Maybe this any nuances in signal-slot across thread mechanism?