errorpopupdlg.cpp
1.11 KB
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
#include "errorpopupdlg.h"
#include "ui_errorpopupdlg.h"
#include <QDebug>
#include "soundplayer.h"
#include "udphandler.h"
ErrorPopupDlg::ErrorPopupDlg(QWidget *parent, const QString &MsgDesc, const QString &MsgTitle, bool sendClrCmd,int erridx) :
QDialog(parent),
ui(new Ui::ErrorPopupDlg)
{
ui->setupUi(this);
this->setAttribute( Qt::WA_TranslucentBackground);
this->setAttribute( Qt::WA_DeleteOnClose);
this->setWindowFlags(Qt::FramelessWindowHint);
//ui->centralwidget->setWindowFlags(Qt::FramelessWindowHint);
ui->ctrlWarnDescription->setText(MsgDesc);
ui->ctrlWarnTitle->setText(MsgTitle);
m_pParent = parent;
foreach (QPushButton *button, findChildren<QPushButton *>())
connect(button, &QPushButton::pressed, SoundPlayer::playClick);
m_bClrCmd = sendClrCmd;
m_nErrIdx = erridx;
}
ErrorPopupDlg::~ErrorPopupDlg()
{
delete ui;
}
void ErrorPopupDlg::on_ctrlOkBtn_clicked()
{
emit closedErrorPopup(m_nErrIdx);
qApp->setActiveWindow(m_pParent);
this->hide();
if(m_bClrCmd) UdpHandler::getInstance()->set(TG_ERROR_CLEAR,0xCECE);
close();
}