DolphinQt: Migrate QRegExp over to QRegularExpression

Qt 5.0 introduced QRegularExpression to replace QRegExp. In Qt 6.0,
QRegExp is removed entirely in favor of it.
This commit is contained in:
Lioncash
2021-01-13 04:06:05 -05:00
parent 765a1b3c09
commit 46ca371ef3
3 changed files with 16 additions and 10 deletions

View File

@ -9,7 +9,7 @@
#include <QApplication>
#include <QPushButton>
#include <QRegExp>
#include <QRegularExpression>
#include <QString>
#include <QTimer>
@ -51,8 +51,8 @@ QString GetExpressionForControl(const QString& control_name,
if (quote == Quote::On)
{
QRegExp reg(QStringLiteral("[a-zA-Z]+"));
if (!reg.exactMatch(expr))
const QRegularExpression reg(QStringLiteral("[a-zA-Z]+"));
if (!reg.match(expr).hasMatch())
expr = QStringLiteral("`%1`").arg(expr);
}