-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReadyPoster.cpp
60 lines (43 loc) · 1.09 KB
/
ReadyPoster.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "ReadyPoster.h"
#include "ui_ReadyPoster.h"
ReadyPoster::ReadyPoster(QWidget *parent) :
QDialog(parent),
ui(new Ui::ReadyPoster)
{
ui->setupUi(this);
// Убирается рамка окна
this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
ui->line1Label->hide();
ui->line2Label->hide();
count=3;
ui->countDownLabel->setText(QString::number(count));
connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateCountDown()));
runCountDown();
}
ReadyPoster::~ReadyPoster()
{
delete ui;
}
void ReadyPoster::setLine1Text(const QString iText)
{
ui->line1Label->setText(iText);
ui->line1Label->show();
}
void ReadyPoster::setLine2Text(const QString iText)
{
ui->line2Label->setText(iText);
ui->line2Label->show();
}
void ReadyPoster::runCountDown()
{
updateTimer.start(1000);
}
// Слот, срабатывающий по таймеру updateWorldTimer
void ReadyPoster::updateCountDown()
{
count--;
if(count==0)
this->close();
else
ui->countDownLabel->setText(QString::number(count));
}