diff options
author | Axel Spoerl <[email protected]> | 2025-03-18 08:29:47 +0100 |
---|---|---|
committer | Axel Spoerl <[email protected]> | 2025-03-26 14:33:39 +0100 |
commit | 22e05d74b2d01cc49c2893f66824d6e229558320 (patch) | |
tree | 89b1b9fd657f6f457dc3c6bdd1cecf25858026a2 | |
parent | 86e3573671ec3ea919e534957bf9dc320f853575 (diff) |
qguiapplication.cpp / init_platform() - optimize ranged loop and style
Use std::as_const() for a QStringList in a ranged for-loop.
Use auto * for a pointer.
Pick-to: 6.9 6.8 6.5
Fixes: QTBUG-134702
Change-Id: Ia092933fe959afdd6b6e0a9743e3603c29b291d8
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Liang Qi <[email protected]>
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 0ca39d72451..0d4a5dd7d69 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1291,7 +1291,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString QStringList plugins = pluginNamesWithArguments.split(u';', Qt::SkipEmptyParts); QStringList platformArguments; QStringList availablePlugins = QPlatformIntegrationFactory::keys(platformPluginPath); - for (const auto &pluginArgument : plugins) { + for (const auto &pluginArgument : std::as_const(plugins)) { // Split into platform name and arguments QStringList arguments = pluginArgument.split(u':', Qt::SkipEmptyParts); if (arguments.isEmpty()) @@ -1411,7 +1411,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString } } - const auto platformIntegration = QGuiApplicationPrivate::platformIntegration(); + const auto *platformIntegration = QGuiApplicationPrivate::platformIntegration(); fontSmoothingGamma = platformIntegration->styleHint(QPlatformIntegration::FontSmoothingGamma).toReal(); QCoreApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus, !QGuiApplication::styleHints()->showShortcutsInContextMenus()); |