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>
This commit is contained in:
Samuel Gaist 2017-01-21 01:14:34 +01:00
parent 992bffdba5
commit bb42a6741f

View File

@ -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:"));