Hi everyone
I need to connect a QPushButton with QTimeEdit , for create a chronometer, I'm lost in the doc...
Thank you![]()
Hi everyone
I need to connect a QPushButton with QTimeEdit , for create a chronometer, I'm lost in the doc...
Thank you![]()
Last edited by scorpiondezer; 1st July 2008 at 18:20.
What do you want QTimeEdit to do when the button is clicked?
J-P Nurmi
The time run like a chrono
See documentation of QTimer. Here's an example:
Qt Code:
timer->setInterval(1000); connect(timer, SIGNAL(timeout()), this, SLOT(updateTime())); connect(button, SIGNAL(clicked()), timer, SLOT(start())); void MyWindow::updateTime() { }To copy to clipboard, switch view to plain text mode
J-P Nurmi
Thank you your code is perfect, but you use a current time, can I begin by the initialize time in QTimeEdit
Thank you very much.
The problem resolved
Qt Code:
void Window::updateTime() { m_s++; if (m_s>59) { m_s=0; m_m++; } if (m_m>59) { m_m=0; m_h++; } }To copy to clipboard, switch view to plain text mode
yeees good idea, thank you very much![]()
Bookmarks