Hi
I want to put the hours in qt creator.
Then prints the time in the textBrowser.
Thank
Hi
I want to put the hours in qt creator.
Then prints the time in the textBrowser.
Thank
You can link to QUniverseCoreLib, it contains a pointer to QUniverseTime. Be aware that it is abstract. You need to subclass QUniverseTime to something like QEarthTime to make it more useful.
Also note that linking to QUniverseCoreLibd (the debug version that is) might take a little bit more space (no pun intended).
Use the classes QDateTime or QTimeThen prints the time in the textBrowser.
See their documentation. You might want to use the function toString(...)
If you expected a better answer, I expected a better question.
Will it be like this clock.png
I guess you want to have something like in the screenshot?
Thank
But I using qt creator.
so, when using
i see this errorQt Code:
To copy to clipboard, switch view to plain text mode
'.toString' must have class/struct
'currentTime' identifier not found
Include QTime and QString
You are wonderful
But How to Make a digital clock
as, cll.png
secend, Can I increase the clock time ??
as,
Qt Code:
ui->textBrowser->append(QTime::currentTime().toString("hh:mm:ss") + "I want to increase a minute of time");To copy to clipboard, switch view to plain text mode
If the time is now 15:44:00
I want to aggravated 15:45:00
Last edited by NewLegend; 11th October 2010 at 13:45.
Use a QTimer (note the difference with QTime).
Set an interval (example: 1 second)
Connect a slot to the timeout() signal
in that slot, clear the contents of the textbox and set it to the current time.
What about Make a digital clock
as, cll.png
I can not use timeEdit
Because it is Input not display.
I suggest a good course in English if you want to do computer programming.
using
Qt Code:
To copy to clipboard, switch view to plain text mode
Bookmarks