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:
parent
992bffdba5
commit
bb42a6741f
@ -54,6 +54,8 @@
|
|||||||
|
|
||||||
#include "licensewizard.h"
|
#include "licensewizard.h"
|
||||||
|
|
||||||
|
QString emailRegExp = QStringLiteral(".+@.+");
|
||||||
|
|
||||||
//! [0] //! [1] //! [2]
|
//! [0] //! [1] //! [2]
|
||||||
LicenseWizard::LicenseWizard(QWidget *parent)
|
LicenseWizard::LicenseWizard(QWidget *parent)
|
||||||
: QWizard(parent)
|
: QWizard(parent)
|
||||||
@ -189,7 +191,7 @@ EvaluatePage::EvaluatePage(QWidget *parent)
|
|||||||
|
|
||||||
emailLabel = new QLabel(tr("&Email address:"));
|
emailLabel = new QLabel(tr("&Email address:"));
|
||||||
emailLineEdit = new QLineEdit;
|
emailLineEdit = new QLineEdit;
|
||||||
emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
|
emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
|
||||||
emailLabel->setBuddy(emailLineEdit);
|
emailLabel->setBuddy(emailLineEdit);
|
||||||
|
|
||||||
//! [21]
|
//! [21]
|
||||||
@ -264,7 +266,7 @@ DetailsPage::DetailsPage(QWidget *parent)
|
|||||||
|
|
||||||
emailLabel = new QLabel(tr("&Email address:"));
|
emailLabel = new QLabel(tr("&Email address:"));
|
||||||
emailLineEdit = new QLineEdit;
|
emailLineEdit = new QLineEdit;
|
||||||
emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
|
emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
|
||||||
emailLabel->setBuddy(emailLineEdit);
|
emailLabel->setBuddy(emailLineEdit);
|
||||||
|
|
||||||
postalLabel = new QLabel(tr("&Postal address:"));
|
postalLabel = new QLabel(tr("&Postal address:"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user