Qtime



  • How can i archive live time displaying in my ui form



  • You've already found the "Digital Clock Example":http://qt-project.org/doc/qt-4.8/widgets-digitalclock.html, haven't you?



  • What is the problem? You can implement your own widget and use it on your form! It's very simple - the simplest solution will be QTime+QLabel.



  • [quote author="tucnak" date="1342512107"]What is the problem? You can implement your own widget and use it on your form! It's very simple - the simplest solution will be QTime+QLabel.[/quote]
    Just those two will result in the current time being displayed on the form, but only for a very brief moment: at construction. The question, if I understood it correctly, is how to make a clock that keeps updating itself, and thus always displays the current time.



  • [quote author="Andre" date="1342512420"]
    [quote author="tucnak" date="1342512107"]What is the problem? You can implement your own widget and use it on your form! It's very simple - the simplest solution will be QTime+QLabel.[/quote]
    Just those two will result in the current time being displayed on the form, but only for a very brief moment: at construction. The question, if I understood it correctly, is how to make a clock that keeps updating itself, and thus always displays the current time.

    [/quote]

    Why author cannot implement own widget which inherit QLabel and use QTimer there to achieve what are you talking about?



  • Sure he can. That's what the example referenced by Lukas does, isn't it? The trick is to use the [[doc:QTimer]], of course, and you did not mention that in your original post. You only talked about QTime+QLabel, and those won't cut it.



  • bq. The trick is to use the QTimer, of course, and you did not mention that in your original post. You only talked about QTime+QLabel, and those won’t cut it.

    Sorry, I forgot about it). Yes, of course - QTimer must be used in any way.



  • thank u. i got the solution



  • Kindly Edit your title and add [Solved].


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.