Results 1 to 3 of 3

Thread: Make QTimer start and then go through its delay.?

  1. #1
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Make QTimer start and then go through its delay.?

    I have a timer. When I call
    timer->start(N)
    I want first the timer's slot to be launched and then to wait N milliseconds for re-launching its slot. How can I do this?
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Make QTimer start and then go through its delay.?

    If I understood you correctly, you simply don't want to wait the first N msec before timer timeouts() ? What about launching the slot yourself ?
    Qt Code:
    1. QTimer *timer = new QTimer(this);
    2. connect(timer, SIGNAL(timeout()), this, SLOT(update()));
    3. this->update();
    4. timer->start(N);
    To copy to clipboard, switch view to plain text mode 
    Correct me if I misunderstood something.
    Last edited by stampede; 11th February 2011 at 20:10. Reason: typo

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

    hakermania (11th February 2011)

  4. #3
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Make QTimer start and then go through its delay.?

    What a silly question
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

Similar Threads

  1. QTimer in QThread doesn't start or timeout
    By Boron in forum Qt Programming
    Replies: 9
    Last Post: 21st October 2011, 14:51
  2. QTimer don't start
    By Qn00b in forum Qt Programming
    Replies: 13
    Last Post: 8th February 2011, 00:02
  3. Replies: 8
    Last Post: 10th December 2009, 11:06
  4. QTimer delay
    By dima in forum Qt Programming
    Replies: 3
    Last Post: 2nd October 2009, 14:31
  5. QTimer ->start(0) + OpenGL + resize/move window => crash
    By anthibug in forum Qt Programming
    Replies: 5
    Last Post: 8th July 2008, 12:01

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.