Hello,
I want to add a time on my design which starts with formate 00:00:00 and my number should keep on increasing every seconds.
I tried to add the code
showtime()
{
QString time_text
= time.
toString("hh:mm:ss");
ui.clock->setText(time_text);
}
constructor()
{
connect(timer,SIGNAL(timeout()),this,SLOT(showtime()));
timer->start();
}
showtime()
{
QTime time =QTime::currentTime();
QString time_text = time.toString("hh:mm:ss");
ui.clock->setText(time_text);
}
constructor()
{
QTimer *timer = new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(showtime()));
timer->start();
}
To copy to clipboard, switch view to plain text mode
but I am getting my system time.
I want it should start from zero and keep on increasing every second.
Please let me know some solution.
Bookmarks