summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-03-15 14:31:24 +0100
committerLars Knoll <lars.knoll@qt.io>2020-03-16 22:04:33 +0100
commit5af2016b7cf1f1a2de9b1d893fd25c8c24544ef3 (patch)
tree550cbed031e180dd76125a1b1ffbaae8d5b3d6e4 /src/platformsupport
parent45e6835727627d783b8fefdc4d1a1d92b4b528dc (diff)
Remove QRegExp usage
It's deprecated in Qt 6. Change-Id: I9ea27ed31a8df39670c0a50c9cb182c7f950ad96 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp8
1 files 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 <QtCore/QSettings>
#if QT_CONFIG(regularexpression)
#include <QtCore/QRegularExpression>
-#else
-#include <QtCore/QRegExp>
#endif
#include <QtGui/QGuiApplication>
#include <QtGui/QFontDatabase>
@@ -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)