-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChooseUrlDialog.cpp
More file actions
44 lines (37 loc) · 997 Bytes
/
Copy pathChooseUrlDialog.cpp
File metadata and controls
44 lines (37 loc) · 997 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
41
42
43
44
#include "ChooseUrlDialog.h"
#include <QMessageBox>
#include <QRegularExpression>
#include "ui_chooseurl.h"
ChooseUrlDialog::ChooseUrlDialog(QWidget *parent)
: QDialog(parent),
ui(new Ui::ChooseUrlUi)
{
ui->setupUi(this);
ui->lineEdit->setText("rtmp://192.168.109.128:1935/live/test");
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
connect(ui->okButton, &QPushButton::clicked, this, &ChooseUrlDialog::onOkButtonClicked);
}
void ChooseUrlDialog::onOkButtonClicked() {
QString text = ui->lineEdit->text();
if (text.isEmpty())
{
QMessageBox::warning(this, "Invalid Input", "Please enter a valid url address.");
reject();
}
else
{
url = text.toStdString();
accept();
}
//QRegularExpression re("^rtmp://.*$");
//if (!re.match(text).hasMatch()) {
// QMessageBox::warning(this, "Invalid Input", "Please enter a valid RTMP address.");
// reject();
//}
//else {
// url = text.toStdString();
// accept();
//}
}
ChooseUrlDialog::~ChooseUrlDialog()
{}