Results 1 to 2 of 2

Thread: QTimer

  1. #1
    Join Date
    Mar 2007
    Posts
    16
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy QTimer

    Hi Everyone
    i have an application , in which i want to execute a certain number of instructions and then force a 3 second delai before executing the next instruction(cause i want to show some graphic animation, objects changing color)...
    i have used a QTimer like this:

    emit color(indice_inf, indice_sup); //i want to execute this line before the timer begins
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(affiche()));
    timer->start(3000);
    echange(tab, indice_inf, indice_sup);// i want to execute this line after 3 s of delai

    but my problem is that it executes the instructions of affiche() function after a periodic delai of 3s (as i assume it should do) but it executes all the rest of the instructions of my application as well... so i want to force some kind of delai between the execution of two instructions..... can anyone help me, hope u ve understand my probleme....... tnx a lot

  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: QTimer

    You can for example move the rest of "instructions" after the timer to a slot that gets executed when the timer fires. They will be executed then.

Similar Threads

  1. QTimer problem
    By vv in forum Qt Programming
    Replies: 9
    Last Post: 3rd July 2007, 08:13
  2. Replies: 5
    Last Post: 6th March 2007, 05:34
  3. QTimer based Splash Screen
    By bpetty in forum Newbie
    Replies: 6
    Last Post: 15th December 2006, 00:51
  4. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  5. QTimer issue
    By qball2k5 in forum Qt Programming
    Replies: 1
    Last Post: 31st March 2006, 18:14

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.