Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8
-
None
Description
When constructing a `QGuiApplication`, passing a platform argument that has a colon will have that colon be split upon.
For example, a "-platform" arguments such as "offscreen:configuration=C:\foo" will be read as the "offscreen" platform plugin with arguments "configuration=C" and "\foo".
The documentation seems to state that:
You can specify platform-specific arguments for the -platform option. Place them after the platform plugin name following a colon as a comma-separated list. For example, -platform windows:dialogs=xp,fontengine=freetype.
Which seems to imply that after the first colon, which splits the platform plugin name from its arguments, only a comma should be a special delimiter, so that the above should instead have been read as the "offscreen" platform plugin with arguments "configuration=C:\foo".
This seems to happen in `init_platform` in `qguiapplication.cpp`:
static void init_platform(const QString &pluginNamesWithArguments, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv) { ... QStringList plugins = pluginNamesWithArguments.split(u';', Qt::SkipEmptyParts); QStringList platformArguments; QStringList availablePlugins = QPlatformIntegrationFactory::keys(platformPluginPath); for (const auto &pluginArgument : plugins) { // Split into platform name and arguments QStringList arguments = pluginArgument.split(u':', Qt::SkipEmptyParts); ...
I would expect, standing by the documentation, that passing an argument that has a colon somewhere, especially in its value, should not be read so that the colon is a separator.