-
Notifications
You must be signed in to change notification settings - Fork 0
/
launchwindow.cpp
47 lines (40 loc) · 922 Bytes
/
launchwindow.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
#include "launchwindow.h"
#include "ui_launchwindow.h"
#include <QTimer>
#include "mediator.h"
launchWindow::launchWindow(QWidget *parent) :
QFrame(parent),
ui(new Ui::launchWindow),
m_pLoop(nullptr)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(Qt::FramelessWindowHint | windowFlags());
}
launchWindow::~launchWindow()
{
delete ui;
}
int launchWindow::exec()
{
setAttribute(Qt::WA_ShowModal,true);
show();
QEventLoop loop;
m_pLoop = &loop;
return loop.exec();
}
void launchWindow::startLaunchTimer()
{
QTimer::singleShot(3000,[=]{
//mediator->checkServosStatus();
m_pLoop->exit();
this->close();
});
}
int launchWindow::launchTip(QWidget *pParent)
{
launchWindow * pWindow = new launchWindow(pParent);
pWindow->setFixedSize(450,120);
pWindow->startLaunchTimer();
return pWindow->exec();
}