yesnopopupdlg.cpp
869 Bytes
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 "yesnopopupdlg.h"
#include "ui_yesnopopupdlg.h"
#include "soundplayer.h"
YesNoPopupDlg::YesNoPopupDlg(QWidget *parent, QString strDesc) :
QDialog(parent),
ui(new Ui::YesNoPopupDlg)
{
ui->setupUi(this);
this->setAttribute( Qt::WA_DeleteOnClose);
setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_TranslucentBackground);
//setAttribute(Qt::WA_PaintOnScreen);
ui->ctrLbDesc->setText(strDesc);
//this->setAttribute( Qt::WA_DeleteOnClose);
foreach (QPushButton *button, findChildren<QPushButton *>())
connect(button, &QPushButton::pressed, SoundPlayer::playClick);
}
YesNoPopupDlg::~YesNoPopupDlg()
{
delete ui;
}
void YesNoPopupDlg::on_ctrBtnYes_clicked()
{
this->accept();
}
void YesNoPopupDlg::on_ctrBtnNo_clicked()
{
this->reject();
}