diff options
author | Samuel Gaist <samuel.gaist@edeltech.ch> | 2017-01-21 01:06:43 +0100 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@edeltech.ch> | 2017-01-24 20:28:41 +0000 |
commit | 0a96d8fb38b85134a8879404fcd05b899dbf59e5 (patch) | |
tree | ed3af7bdcae316f4541f25e4eb76b7da2a6bb877 /examples | |
parent | bb42a6741f7af19c8c8a1fa67c827b06000ec28c (diff) |
Example: migrate the classwizard example to use QRegularExpression
Update the classwizard example to use the new QRegularExpression class
in place of the deprecated QRegExp.
Change-Id: I125664549e249c4156f8c664fac7648f1c41f9d5
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/widgets/dialogs/classwizard/classwizard.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/widgets/dialogs/classwizard/classwizard.cpp b/examples/widgets/dialogs/classwizard/classwizard.cpp index d6c7c7a546..3eab2f5fb2 100644 --- a/examples/widgets/dialogs/classwizard/classwizard.cpp +++ b/examples/widgets/dialogs/classwizard/classwizard.cpp @@ -363,9 +363,10 @@ void CodeStylePage::initializePage() baseIncludeLabel->setEnabled(!baseClass.isEmpty()); baseIncludeLineEdit->setEnabled(!baseClass.isEmpty()); + QRegularExpression rx("Q[A-Z].*"); if (baseClass.isEmpty()) { baseIncludeLineEdit->clear(); - } else if (QRegExp("Q[A-Z].*").exactMatch(baseClass)) { + } else if (rx.match(baseClass).hasMatch()) { baseIncludeLineEdit->setText('<' + baseClass + '>'); } else { baseIncludeLineEdit->setText('"' + baseClass.toLower() + ".h\""); |