1#include "dialog.h"
2#include "ui_dialog.h"
3
4Dialog::Dialog(QWidget *parent)
5 : QDialog(parent)
6 , ui(new Ui::Dialog)
7{
8 ui->setupUi(this);
9}
10
11Dialog::~Dialog()
12{
13 delete ui;
14}
15
16int Dialog::showPrompt(const QString &prompt)
17{
18 ui->txtPrompt->setText(prompt);
19 return exec();
20}
21
22QString Dialog::getInput()
23{
24 return ui->txtInput->text();
25}
26
27
28void Dialog::on_txtInput_returnPressed()
29{
30 if (!ui->txtInput->text().isEmpty())
31 accept();
32}
33
34void Dialog::closeEvent(QCloseEvent *event)
35{
36 reject();
37}
38