summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2017-01-21 01:14:34 +0100
committerSamuel Gaist <samuel.gaist@edeltech.ch>2017-01-24 20:28:37 +0000
commitbb42a6741f7af19c8c8a1fa67c827b06000ec28c (patch)
tree286edfba7602882ee6004b94684dfc71f92577bb
parent992bffdba587a1885e844570a0d04b15cda9fa3f (diff)
Example: migrate licensewizard example to use QRegularExpression
Update the licensewizard example to use the new QRegularExpression class in place of the deprecated QRegExp. Change-Id: Ib6e0ee9ec802e83540b1c37846b99378395fe0ec Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.cpp b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
index e145a18e2c..6dbb894ad8 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.cpp
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
@@ -54,6 +54,8 @@
#include "licensewizard.h"
+QString emailRegExp = QStringLiteral(".+@.+");
+
//! [0] //! [1] //! [2]
LicenseWizard::LicenseWizard(QWidget *parent)
: QWizard(parent)
@@ -189,7 +191,7 @@ EvaluatePage::EvaluatePage(QWidget *parent)
emailLabel = new QLabel(tr("&Email address:"));
emailLineEdit = new QLineEdit;
- emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
+ emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
emailLabel->setBuddy(emailLineEdit);
//! [21]
@@ -264,7 +266,7 @@ DetailsPage::DetailsPage(QWidget *parent)
emailLabel = new QLabel(tr("&Email address:"));
emailLineEdit = new QLineEdit;
- emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
+ emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
emailLabel->setBuddy(emailLineEdit);
postalLabel = new QLabel(tr("&Postal address:"));