Results 1 to 4 of 4

Thread: QTimer and QTimeLine

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    14
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTimer and QTimeLine

    Hello high_flyer,

    i have tryed what you said, but it doesn´t work, it happens the same, if i press the stop button quickly the function calls save dialog, if i cancel the save dialog, quickly, another save dialog is shown, the stopall is called several times.

    I delete QTimer and QTimeLine, in the stopall function, but as this function is called several times, it occurs an error because is trying to delete QTimer that it doesn´t exists.

    Another idea please!!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTimer and QTimeLine

    i have tryed what you said, but it doesn´t work, it happens the same, if i press the stop button quickly the function calls save dialog, if i cancel the save dialog, quickly, another save dialog is shown, the stopall is called several times.
    I think I know why - its because your stopall() is called both by the button and by the timer.
    So if you click the button, before the timer times out, the slot will be called twice.

    I delete QTimer and QTimeLine, in the stopall function, but as this function is called several times, it occurs an error because is trying to delete QTimer that it doesn´t exists.
    Right, which is why I wrote in the previous post:
    It is better to put initialization in the constructor or an init() function which is called once at start.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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
  •  
Qt is a trademark of The Qt Company.