Results 1 to 4 of 4

Thread: How to set the QTIMER active only once ?

  1. #1
    Join Date
    Jan 2011
    Posts
    40
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to set the QTIMER active only once ?

    I use the QTIMER ,QTIMEEDIT,QTIME to show the time passed away.Here is the processment:When clicked the button.the QTIME timer_seconds minus one second and the QTIMEEDIT part show the time passed away.But if I clicked the button too fast.The timer_seconds would minus more than one second ,it might be minus two or three seconds which in fact that it only passed one second.The reason which i thought is I active the QTIMER function more than one times at a short time.So how to control the qtimer class to make sure the qtimer being actived at only one time.Do i need to use the QTHREAD and QMUAX some classes like that?And how?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to set the QTIMER active only once ?

    I don't get what you are doing, so could you please post a short example.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to set the QTIMER active only once ?

    As Lykurg says, it is not clear what you want.

    If you connect the timer signal to a slot every time the button is pressed then you can get multiple connections. Each connection will be called when the timer expires.

  4. #4
    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 set the QTIMER active only once ?


Similar Threads

  1. Window Active
    By bismitapadhy in forum Qt Programming
    Replies: 1
    Last Post: 10th June 2009, 11:12
  2. Active Directory and Qt
    By chak_med in forum Qt Programming
    Replies: 1
    Last Post: 6th December 2006, 19:54
  3. active child
    By evgenM in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2006, 12:16
  4. Painter not active!
    By Caius Aérobus in forum Qt Programming
    Replies: 7
    Last Post: 30th March 2006, 15:44
  5. How to determine if my app is active...
    By Ben.Hines in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2006, 16:02

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.