DerClass::DerClass(QObject * parent)
: QObject(parent)
, mTimer(new QTimer(this)
{
connect(mTimer, SIGNAL(timeout()), this, SLOT(update()));
mTimer->start(1000);
mSecondsToEnd = 60;
}
DerClass::update()
{
--mSecondsToEnd;
if ( mSecondsToEnd > 0)
{
QStiring time = QString::number(mSecondsToEnd);
ui->backTimerTextLabel->setText("Осталось " + time + " секунд" );
}
else
{
mTimer->stop();
doWork();
}
}