Results 1 to 15 of 15

Thread: Simple QTimer help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qtimer help

    You never stop the timer, so it keeps firing.

    You can stop the timer in HelloForm::stopi2c() or connect the stop button's cliicked signal to the timer's stop() slot.

    Cheers,
    _

  2. #2
    Join Date
    Jul 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Simple QTimer help

    @anda_skoa
    and how can i do that sir......i really have don't idea about it...
    please guide me to it.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Simple QTimer help

    You are kidding right?
    I already gave you two options and you want more?

    Cheers,
    _

  4. #4
    Join Date
    Jul 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Simple QTimer help

    sir,
    i mean to say how to write in stopi2c() to stop this if you add lines in my code i will be oblize to you..
    Qt Code:
    1. void HelloForm::stopi2c()
    2. {
    3.  
    4. ADC->setText(" ");
    5. ptimer->stop();
    6. Message->setText("Stopped");
    7. }
    To copy to clipboard, switch view to plain text mode 
    like this??
    if yes then i doesn't work

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Simple QTimer help

    Yes, like this.
    But obviously with having "timer" as a member variable of class HelloForm instead of just a local variable in the constructor.

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    gauravsharma0190 (3rd July 2015)

  7. #6
    Join Date
    Jul 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Simple QTimer help

    so how can i do that sir...please tell me so???
    where should i change..
    if you don't mind??

  8. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Simple QTimer help

    My recommendation is to have a look at some beginner's C++ tutorials first.
    Once you understand the absolut basics of C++, you won't have any difficulty making the necessary change.

    Cheers,
    _

  9. #8
    Join Date
    Jul 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Simple QTimer help

    hello sir,
    i did it...
    now i want to do it with startTimer() and killTimer()
    so how can i do it with???

  10. #9
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Simple QTimer help

    Quote Originally Posted by gauravsharma0190 View Post
    now i want to do it with startTimer() and killTimer()
    so how can i do it with???
    Why?
    Working with QTimer is way simpler.

    Cheers,
    _

Similar Threads

  1. Simple way to expand all nodes on a QTreeView?
    By cboles in forum Qt Programming
    Replies: 10
    Last Post: 12th April 2014, 16:54
  2. using QTimer in staticlib
    By jeetu_happy in forum Qt Programming
    Replies: 4
    Last Post: 22nd January 2007, 09: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
  •  
Qt is a trademark of The Qt Company.