aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/glue/qtpositioning.cpp
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-01-26 13:37:56 +0100
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-02-21 16:10:28 +0100
commit5958adfebd8bda55debdc59e334cc1df2681c371 (patch)
treea3180b6691620d713115abd1508c73712dee4234 /sources/pyside6/PySide6/glue/qtpositioning.cpp
parentde503531fe1e63b614591283453ccdc1c7d7e004 (diff)
Desktop Deployment: link permission libraries for macOS
- The macOS permission backends are packaged as static libraries which are linked directly to the C++ application during the build step. Since this is not possible to be done dynamically when pyside6-deploy is run, we link the QtCore PySide6 binary (QtCore.abi3.so) to the permission static binaries. This also makes sense since the Qt permission API is a part of QtCore. ~Note~: The idea of checking and requesting permissions for macOS only exists when the Python application is packaged as a macOS application bundle. When Python is run in interpreter mode, the Qt permission API does not work. - The QtLocation Permission plugin cannot be statically linked to QtCore PySide6 binary because it required QtCore Qt framework bundle to be loaded prior to calling Q_IMPORT_PLUGIN. Hence, we statically link QDarwinLocationPermissionPlugin to QtPositioning because QtPositioning has the classes that requires permissions. Pick-to: 6.6 6.5 Task-number: PYSIDE-2468 Change-Id: I2ff64ed8f01f8318755a30eb4a66f7f968bd2d04 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/glue/qtpositioning.cpp')
-rw-r--r--sources/pyside6/PySide6/glue/qtpositioning.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/glue/qtpositioning.cpp b/sources/pyside6/PySide6/glue/qtpositioning.cpp
new file mode 100644
index 000000000..91c331c74
--- /dev/null
+++ b/sources/pyside6/PySide6/glue/qtpositioning.cpp
@@ -0,0 +1,14 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+/*********************************************************************
+ * INJECT CODE
+ ********************************************************************/
+
+// @snippet darwin_location_permission_plugin
+#ifdef Q_OS_DARWIN
+#include<QtCore/qplugin.h>
+// register the static plugin and setup its metadata
+Q_IMPORT_PLUGIN(QDarwinLocationPermissionPlugin)
+#endif
+// @snippet darwin_location_permission_plugin