Reputation: 4480
How to Set Time in QTimeEdit at Run Time in QT ?
Like I want to Show 17:30 in QtimeEdit.
Thanks.
Upvotes: 3
Views: 14597
Reputation: 87
You can apply:
bool QTime::setHMS ( int h, int m, int s, int ms = 0 )
QTime tm;
tm.setHMS(10,25,45,0);
The result will be "10:25:45"
Cheers.
Upvotes: 0
Reputation: 15175
http://doc.qt.io/qt-5/qdatetimeedit.html#time-prop What exactly did you not understand?
example:
QTime time(17, 30);
QTimeEdit te;
te.setTime(time);
Upvotes: 4
Reputation: 1119
You can use the following methods:
e.g.:
this->time_edit->setTime(QTime(10,17));
Upvotes: 2