errorpopupdlg.cpp 952 Bytes
#include "errorpopupdlg.h"
#include "ui_errorpopupdlg.h"
#include <QDebug>

#include "soundplayer.h"

ErrorPopupDlg::ErrorPopupDlg(QWidget *parent, const QString &MsgDesc, const QString &MsgTitle) :
    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);
}

ErrorPopupDlg::~ErrorPopupDlg()
{
    delete ui;
}

void ErrorPopupDlg::on_ctrlOkBtn_clicked()
{
    //emit closedPopup(m_pParent);
    qApp->setActiveWindow(m_pParent);
    this->hide();
    close();
}