Results 1 to 4 of 4

Thread: How to stop a timer?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2012
    Posts
    232
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Platforms
    Windows Android

    Default How to stop a timer?

    Hello!

    I created the MainWindow project and added:

    MainWindow.h
    Qt Code:
    1. private:
    2. void timerEvent( QTimerEvent *event );
    To copy to clipboard, switch view to plain text mode 

    I wrote in the constructor of the MainWindow:
    Qt Code:
    1. startTimer( 2000 );
    To copy to clipboard, switch view to plain text mode 

    I wrote:
    Qt Code:
    1. void MainWindow::timerEvent(QTimerEvent *event)
    2. {
    3. qDebug() << "timerEvent";
    4. }
    To copy to clipboard, switch view to plain text mode 

    How to stop this timer here:
    Qt Code:
    1. void MainWindow::on_startTransmissionButton_clicked()
    2. {
    3.  
    4. }
    To copy to clipboard, switch view to plain text mode 

    P.S. I cannot find timerEvent in the Qt's documentation

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to stop a timer?


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

    8Observer8 (28th August 2014)

Similar Threads

  1. Timer doesn't stop
    By smoon in forum Qt Programming
    Replies: 5
    Last Post: 11th June 2012, 16:08
  2. qt4.5, assert in timer event doesnt stop all timers
    By roybj in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2011, 12:22
  3. timer problem(timer does not work)
    By masuk in forum Newbie
    Replies: 6
    Last Post: 14th February 2011, 05:00
  4. Program freeze when timer->stop();
    By gQt in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2009, 14:05
  5. Timer delay
    By bmn in forum Qt Programming
    Replies: 11
    Last Post: 3rd June 2008, 11:54

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.