confirmpopup.cpp
612 Bytes
#include "confirmpopup.h"
#include "ui_confirmpopup.h"
#include "soundplayer.h"
ConfirmPopup::ConfirmPopup(QWidget *parent, QString text) :
QWidget(parent),
ui(new Ui::ConfirmPopup)
{
ui->setupUi(this);
ui->text->setText(text);
foreach (QPushButton *button, findChildren<QPushButton *>())
connect(button, &QPushButton::pressed, SoundPlayer::playClick);
}
ConfirmPopup::~ConfirmPopup()
{
delete ui;
}
void ConfirmPopup::on_okButton_clicked()
{
deleteLater();
emit accepted();
}
void ConfirmPopup::on_cancelButton_clicked()
{
deleteLater();
emit rejected();
}