Results 1 to 3 of 3

Thread: QThread::IdlePriority not working?

  1. #1
    Join Date
    Apr 2010
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default QThread::IdlePriority not working?

    Hi

    I am new to qt, I want to run a piece of code when no other gui/other activity is running. So I created a thread with QThread::IdlePriority(mentioned in the documentation). But the thread is still running when i put a while loop in my main application. I am attaching a sample project. where am I going wrong? Please suggest pointers to achieve the same.
    testthread.zip

    thanx

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QThread::IdlePriority not working?

    You are going wrong in thinking that your program will only be active when "no other gui/other activity is running".

  3. #3
    Join Date
    Apr 2011
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: QThread::IdlePriority not working?

    I think that a QThread with IdlePriority on a multi-core-cpu will executed parallel. Are thread's the right thing? Do you realy want implement all the sync-stuff?
    Or do you want google "qt onidle"?
    which-qt-class-work-like-onidle

Similar Threads

  1. Signals not working in a QThread
    By curreli in forum Qt Programming
    Replies: 1
    Last Post: 10th August 2010, 16:04
  2. Moving QObject to QThread causes signals to stop working
    By Ban-chan in forum Qt Programming
    Replies: 8
    Last Post: 13th July 2010, 21:39
  3. Working with QThread
    By Fastman in forum Qt Programming
    Replies: 1
    Last Post: 27th February 2009, 22:35
  4. QThread::terminate () is not working!!!!!
    By biswajithit in forum Qt Programming
    Replies: 1
    Last Post: 15th September 2008, 12:03
  5. Replies: 4
    Last Post: 26th June 2008, 18:41

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.