QmlDesigner: Do not allow keyboard focus on macOS for puppet

Since we integrated the 3D view no keyboard focus is required anymore.

Change-Id: Ia523e1a6b0c1d0ef9912775a91022f28de47b54a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Thomas Hartmann
2020-03-25 13:38:05 +01:00
parent b04391619b
commit fccdc91e51
2 changed files with 3 additions and 13 deletions

View File

@@ -28,5 +28,7 @@ be met: https://www.gnu.org/licenses/gpl-3.0.html.</string>
<string>qml2puppet</string>
<key>CFBundleIdentifier</key>
<string>org.qt-project.qtcreator.qml2puppet</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

View File

@@ -133,19 +133,7 @@ int main(int argc, char *argv[])
// subpixel antialiasing and instead use gray.
qputenv("QSG_DISTANCEFIELD_ANTIALIASING", "gray");
#ifdef Q_OS_MACOS
if (!qEnvironmentVariableIsSet("QMLDESIGNER_QUICK3D_MODE")) {
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
} else {
// 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
}
}
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
#endif
//If a style different from Desktop is set we have to use QGuiApplication