From 5af2016b7cf1f1a2de9b1d893fd25c8c24544ef3 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 15 Mar 2020 14:31:24 +0100 Subject: Remove QRegExp usage It's deprecated in Qt 6. Change-Id: I9ea27ed31a8df39670c0a50c9cb182c7f950ad96 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../fontdatabases/windows/qwindowsfontdatabase_ft.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp index b355001254..39551c2e27 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp @@ -50,8 +50,6 @@ #include #if QT_CONFIG(regularexpression) #include -#else -#include #endif #include #include @@ -127,10 +125,8 @@ static FontKeys &fontKeys() const QString trueType = QStringLiteral("(TrueType)"); #if QT_CONFIG(regularexpression) const QRegularExpression sizeListMatch(QStringLiteral("\\s(\\d+,)+\\d+")); -#else - const QRegExp sizeListMatch(QLatin1String("\\s(\\d+,)+\\d+")); -#endif Q_ASSERT(sizeListMatch.isValid()); +#endif const int size = allKeys.size(); result.reserve(result.size() + size); for (int i = 0; i < size; ++i) { @@ -139,7 +135,9 @@ static FontKeys &fontKeys() fontKey.fileName = fontRegistry.value(registryFontKey).toString(); QString realKey = registryFontKey; realKey.remove(trueType); +#if QT_CONFIG(regularexpression) realKey.remove(sizeListMatch); +#endif const auto fontNames = QStringRef(&realKey).trimmed().split(QLatin1Char('&')); fontKey.fontNames.reserve(fontNames.size()); for (const QStringRef &fontName : fontNames) -- cgit v1.2.3