once QCoreApplication/QApplication instance is created the environment
lookup stops, this trick can be applied to other environment variable
checks
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
*/
QGuiPlatformPlugin *qt_guiPlatformPlugin()
{
+ static QGuiPlatformPlugin *appplugin = nullptr;
+ if (appplugin) {
+ return appplugin;
+ }
+
QGuiPlatformPlugin *plugin = nullptr;
#ifndef QT_NO_LIBRARY
static const char* platformEnvTbl[] = {
plugin = &def;
}
+ if (qApp) {
+ appplugin = plugin;
+ }
+
return plugin;
}