Results 1 to 2 of 2

Thread: Is it safe to call QTimer::start() before QTimer::moveToThread()?

  1. #1
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    70
    Thanks
    23
    Thanked 15 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Is it safe to call QTimer::start() before QTimer::moveToThread()?

    Hello,
    is the following code safe?

    Qt Code:
    1. timer->start(interval);
    2. timer->moveToThread(other_thread);
    To copy to clipboard, switch view to plain text mode 

    I am afraid that calling moveToThread() after start() might be unsafe, even though it seems to work as expected (so far).

    Thanks
    Last edited by mattc; 25th October 2012 at 18:53.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is it safe to call QTimer::start() before QTimer::moveToThread()?

    It's ok, no worries.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 15
    Last Post: 4th August 2012, 19:11
  2. QMovie::moveToThread() and its QTimer
    By tiftof in forum Qt Programming
    Replies: 3
    Last Post: 24th February 2011, 10:53
  3. Replies: 2
    Last Post: 11th February 2011, 19:48
  4. QTimer don't start
    By Qn00b in forum Qt Programming
    Replies: 13
    Last Post: 7th February 2011, 23:02
  5. Replies: 8
    Last Post: 10th December 2009, 10:06

Tags for this Thread

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.