From c553de5216b7de4087aad2a4dd59d9e4a16c159e Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Tue, 16 Jan 2024 14:56:01 -0300 Subject: [PATCH] Replace QRegExpValidator by QRegularExpressionValidator And QRegExp by QRegularExpression, they were deprecated. --- src/Cloud/CloudDBChart.cpp | 9 +++++---- src/Cloud/CloudDBUserMetric.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Cloud/CloudDBChart.cpp b/src/Cloud/CloudDBChart.cpp index c5602a8c2..f07ebfcd4 100644 --- a/src/Cloud/CloudDBChart.cpp +++ b/src/Cloud/CloudDBChart.cpp @@ -42,6 +42,7 @@ #include #include #include +#include CloudDBChartClient::CloudDBChartClient() { @@ -1236,8 +1237,8 @@ CloudDBChartObjectDialog::CloudDBChartObjectDialog(ChartAPIv1 data, QString athl name->setText(nameDefault); nameOk = false; } - QRegExp name_rx("^.{5,50}$"); - QValidator *name_validator = new QRegExpValidator(name_rx, this); + QRegularExpression name_rx("^.{5,50}$"); + QValidator *name_validator = new QRegularExpressionValidator(name_rx, this); name->setValidator(name_validator); QLabel* sportLabel = new QLabel(tr("Sport")); @@ -1282,8 +1283,8 @@ CloudDBChartObjectDialog::CloudDBChartObjectDialog(ChartAPIv1 data, QString athl email->setText(appsettings->cvalue(athlete, GC_CLOUDDB_EMAIL, "").toString()); } // regexp: simple e-mail validation / also allow long domain types & subdomains - QRegExp email_rx("^.+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,10}$"); - QValidator *email_validator = new QRegExpValidator(email_rx, this); + QRegularExpression email_rx("^.+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,10}$"); + QValidator *email_validator = new QRegularExpressionValidator(email_rx, this); email->setValidator(email_validator); emailOk = !email->text().isEmpty(); // email from properties is ok when loaded diff --git a/src/Cloud/CloudDBUserMetric.cpp b/src/Cloud/CloudDBUserMetric.cpp index b58b592a5..e890483c2 100644 --- a/src/Cloud/CloudDBUserMetric.cpp +++ b/src/Cloud/CloudDBUserMetric.cpp @@ -35,6 +35,7 @@ #include #include #include +#include CloudDBUserMetricClient::CloudDBUserMetricClient() { @@ -1035,8 +1036,8 @@ CloudDBUserMetricObjectDialog::CloudDBUserMetricObjectDialog(UserMetricAPIv1 dat name->setText(data.Header.Name); nameOk = true; // no need to re-check } - QRegExp name_rx("^.{5,50}$"); - QValidator *name_validator = new QRegExpValidator(name_rx, this); + QRegularExpression name_rx("^.{5,50}$"); + QValidator *name_validator = new QRegularExpressionValidator(name_rx, this); name->setValidator(name_validator); QLabel* langLabel = new QLabel(tr("Language")); @@ -1070,8 +1071,8 @@ CloudDBUserMetricObjectDialog::CloudDBUserMetricObjectDialog(UserMetricAPIv1 dat email->setText(appsettings->cvalue(athlete, GC_CLOUDDB_EMAIL, "").toString()); } // regexp: simple e-mail validation / also allow long domain types & subdomains - QRegExp email_rx("^.+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,10}$"); - QValidator *email_validator = new QRegExpValidator(email_rx, this); + QRegularExpression email_rx("^.+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,10}$"); + QValidator *email_validator = new QRegularExpressionValidator(email_rx, this); email->setValidator(email_validator); emailOk = !email->text().isEmpty(); // email from properties is ok when loaded