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>
This commit is contained in:
parent
bb42a6741f
commit
0a96d8fb38
@ -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\"");
|
||||
|
Loading…
Reference in New Issue
Block a user