Can you try this
{
Q_OBJECT
public:
, mRemainingTime(0)
{
;
}
public slots:
void pause(void)
{
mRemainingTime = remainingTime();
stop();
}
void resume(void)
{
start(mRemainingTime);
}
private:
int mRemainingTime;
};
class Timer : public QTimer
{
Q_OBJECT
public:
explicit Timer(QObject * parent)
: QTimer(parent)
, mRemainingTime(0)
{
;
}
public slots:
void pause(void)
{
mRemainingTime = remainingTime();
stop();
}
void resume(void)
{
start(mRemainingTime);
}
private:
int mRemainingTime;
};
To copy to clipboard, switch view to plain text mode
One downside is that the interval() is not consistent through out the Timer's running cycle, interval() changes when ever time is pause()ed and resume()ed.
Bookmarks