3
0
Fork 0
forked from suyu/suyu

Merge pull request #5330 from german77/regexerror

Fix IP validator error
This commit is contained in:
LC 2021-01-13 22:08:42 -05:00 committed by GitHub
commit 5e35c69f35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,8 +185,9 @@ void ConfigureMotionTouch::ConnectEvents() {
} }
void ConfigureMotionTouch::OnUDPAddServer() { void ConfigureMotionTouch::OnUDPAddServer() {
QRegExp re(tr(R"re(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4]" // Validator for IP address
"[0-9]|[01]?[0-9][0-9]?)$)re")); // a valid ip address QRegExp re(QStringLiteral(
R"re(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$)re"));
bool ok; bool ok;
QString port_text = ui->udp_port->text(); QString port_text = ui->udp_port->text();
QString server_text = ui->udp_server->text(); QString server_text = ui->udp_server->text();