forked from AlexiaChen/RtspMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuredlg.cpp
56 lines (45 loc) · 1000 Bytes
/
configuredlg.cpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "configuredlg.h"
#include "ui_configuredlg.h"
#include <QMessageBox>
ConfigureDlg::ConfigureDlg(QWidget *parent)
: QDialog(parent)
{
ui = new Ui::ConfigureDlg();
ui->setupUi(this);
connect(ui->ok, SIGNAL(clicked()), this, SLOT(ok()));
}
ConfigureDlg::~ConfigureDlg()
{
delete ui;
}
void ConfigureDlg::ok()
{
if (!ui->row->text().isEmpty() && !ui->column->text().isEmpty())
{
bool r_ok ,c_ok;
int row = ui->row->text().toInt(&r_ok);
int column = ui->column->text().toInt(&c_ok);
if (!r_ok || !c_ok)
{
QMessageBox::warning(this, "Invalid Input", " \
<p>Row And Column must be numerical value.</p> \
");
return;
}
if (row > 3 || column > 3)
{
QMessageBox::warning(this, "Invalid Input", " \
<p>Max Row X Column is 3 X 3.</p> \
");
return;
}
emit configComplete(row, column);
this->close();
}
else
{
QMessageBox::warning(this, "Invalid Input", " \
<p>Row And Column cannot be empty.</p> \
");
}
}