Results 1 to 4 of 4

Thread: priority of QThread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default priority of QThread

    Can we set priority of one of Qt Threads

    nitin

  2. #2
    Join Date
    May 2006
    Location
    Australia
    Posts
    53
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: priority of QThread

    You can in 4.1....what are you using

    from the docs
    void QThread::setPriority ( Priority priority )
    This function sets the priority for a running thread. If the thread is not running, this function does nothing and returns immediately. Use start() to start a thread with a specific priority.
    The priority argument can be any value in the QThread::Priority enum except for InheritPriorty.
    This function was introduced in Qt 4.1.

  3. The following user says thank you to georgie for this useful post:

    quickNitin (13th May 2006)

  4. #3
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: priority of QThread

    i am currently using qt3.3.4

  5. #4
    Join Date
    May 2006
    Location
    Australia
    Posts
    53
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: priority of QThread

    I had a look, and you can do it in 3.3 as well...you just gotta give the priority when you call start instead, e.g. this.start(QThread::TimeCriticalPriority)....the default is to inherit the same priority as the parent thread....

    i think all this means is that you can't change it once you've set it....could be a little prohibitive, depending upon exactly what you want to do with it....
    Last edited by georgie; 13th May 2006 at 14:04.

Similar Threads

  1. Qt thread priority
    By SailinShoes in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2010, 02:39
  2. QThread and QTcpSocket
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 12th May 2008, 14:06
  3. Spawn a QThread in another QThread
    By david.corinex in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2007, 13:54
  4. QThread exec proplem to stop...
    By patrik08 in forum Qt Programming
    Replies: 29
    Last Post: 21st May 2007, 08:51
  5. Is it possible to create a QThread without inheriting ?
    By probine in forum Qt Programming
    Replies: 6
    Last Post: 23rd March 2006, 23:51

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.