Results 1 to 1 of 1

Thread: Missing messages to QTextBrowser

  1. #1
    Join Date
    Jun 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Missing messages to QTextBrowser

    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:

    Qt Code:
    1. [13:22:56] Starting ...
    2.  
    3. Host: 192.168.0.150 // OK!
    4. inputPort: 12001
    5. outpurPort: 12001
    6.  
    7. [13:23:59] Terminate
    8. [13:23:59] Starting ... // missing! <- in this plase must be log info
    9. [13:24:02] Terminate
    10. [13:24:02] Starting ... // missing! <- in this plase must be log info
    11. [13:24:03] Terminate
    12. [13:24:04] Starting ... // missing! <- in this plase must be log info
    13. [13:24:05] Terminate
    14. [13:24:05] Starting ... // missing! <- in this plase must be log info
    15. [13:24:06] Terminate
    16. [13:24:06] Starting ... // missing! <- in this plase must be log info
    17. [13:24:07] Terminate
    18. [13:24:08] Starting ... // OK!
    19.  
    20. Host: 192.168.0.150
    21. inputPort: 12001
    22. outpurPort: 12001
    To copy to clipboard, switch view to plain text mode 

    On push StartButton I create new workObject and then put it to separate thread as below:
    Qt Code:
    1. workObject ::workObject ()
    2. {
    3. // move to thread
    4. moveToThread(Core::ICore::instance()->threadManager()->getRealTimeThread());
    5. connect(this, SIGNAL(myStart()), this,SLOT(onStart()),Qt::QueuedConnection);
    6. emit myStart();
    7. }
    To copy to clipboard, switch view to plain text mode 

    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?
    Last edited by Nickolay; 28th August 2010 at 11:42.

Similar Threads

  1. Replies: 0
    Last Post: 26th August 2010, 17:35
  2. Compiler messages in Qt Creator
    By TorAn in forum Qt Tools
    Replies: 0
    Last Post: 30th June 2010, 04:42
  3. Getting messages sent by PostMessage
    By Luc4 in forum Qt Programming
    Replies: 5
    Last Post: 19th May 2010, 16:13
  4. Qt4 no debug messages
    By TheKedge in forum Newbie
    Replies: 3
    Last Post: 23rd January 2006, 17:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.