diff options
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp index 22460eaf6b..85c8e512d5 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp @@ -132,8 +132,16 @@ int main(int argc, char *argv[]) // Since we always render text into an FBO, we need to globally disable // subpixel antialiasing and instead use gray. qputenv("QSG_DISTANCEFIELD_ANTIALIASING", "gray"); -#ifdef Q_OS_OSX //This keeps qml2puppet from stealing focus - qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true"); +#ifdef Q_OS_MACOS + // We have to parse the arguments before Q[Gui]Application creation + // Since the Qt arguments are not filtered out, yet we do not know the position of the argument + for (int i = 0; i < argc; ++i) { + const char *arg = argv[i]; + //In previewmode and rendermode we hide the process + if (!qstrcmp(arg, "previewmode") || !qstrcmp(arg, "rendermode")) + qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true"); + // This keeps qml2puppet from stealing focus + } #endif //If a style different from Desktop is set we have to use QGuiApplication |