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 19:53.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 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, 20:11
  2. QMovie::moveToThread() and its QTimer
    By tiftof in forum Qt Programming
    Replies: 3
    Last Post: 24th February 2011, 11:53
  3. Replies: 2
    Last Post: 11th February 2011, 20:48
  4. QTimer don't start
    By Qn00b in forum Qt Programming
    Replies: 13
    Last Post: 8th February 2011, 00:02
  5. Replies: 8
    Last Post: 10th December 2009, 11: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.