diff options
author | Michael BrĂ¼ning <michael.bruning@qt.io> | 2023-06-27 20:16:54 +0200 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@qt.io> | 2023-07-26 11:44:42 +0200 |
commit | 3106a9ab7897cb3de9c640a7699d06e3f02a295d (patch) | |
tree | 81196483be489ae2069a95624345ac4678507ccf /examples/webenginewidgets/maps | |
parent | ab21f39c6a54be331dd8a155d3374bfe790e0274 (diff) |
Fix geolocation permissions to use new Qt Permissions API
QtPositioningHelper now uses the Qt Permissions API. Also fixup the
examples Simple Browser, Quick Nano Browser and Maps to use the right
key on macOS and sign the application as part of the build process
Moves the Geopermission auto tests to manual tests for webenginequick
and webenginewidgets on macOS.
Pick-to: 6.6
Fixes: QTBUG-114939
Change-Id: Id6771889f20c866d2fcdbb477dbbb7da30367043
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'examples/webenginewidgets/maps')
-rw-r--r-- | examples/webenginewidgets/maps/CMakeLists.txt | 15 | ||||
-rw-r--r-- | examples/webenginewidgets/maps/Info.cmake.macos.plist | 33 |
2 files changed, 47 insertions, 1 deletions
diff --git a/examples/webenginewidgets/maps/CMakeLists.txt b/examples/webenginewidgets/maps/CMakeLists.txt index f6e6b94ea..524892957 100644 --- a/examples/webenginewidgets/maps/CMakeLists.txt +++ b/examples/webenginewidgets/maps/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2022 The Qt Company Ltd. +# Copyright (C) 2023 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause cmake_minimum_required(VERSION 3.16) @@ -22,6 +22,7 @@ qt_add_executable(maps set_target_properties(maps PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.maps" ) target_link_libraries(maps PUBLIC @@ -30,6 +31,18 @@ target_link_libraries(maps PUBLIC Qt::WebEngineWidgets ) +if (APPLE) + set_target_properties(maps PROPERTIES + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist" + ) + + if (NOT CMAKE_GENERATOR STREQUAL "Xcode") + # Need to sign application for location permissions to work + add_custom_command(TARGET maps + POST_BUILD COMMAND codesign -s - maps.app) + endif() +endif() + install(TARGETS maps RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/webenginewidgets/maps/Info.cmake.macos.plist b/examples/webenginewidgets/maps/Info.cmake.macos.plist new file mode 100644 index 000000000..82336b25a --- /dev/null +++ b/examples/webenginewidgets/maps/Info.cmake.macos.plist @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleName</key> + <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string> + <key>CFBundleIdentifier</key> + <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> + <key>CFBundleExecutable</key> + <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> + <key>CFBundleVersion</key> + <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> + <key>CFBundleShortVersionString</key> + <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string> + <key>LSMinimumSystemVersion</key> + <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string> + <key>NSHumanReadableCopyright</key> + <string>${MACOSX_BUNDLE_COPYRIGHT}</string> + <key>CFBundleIconFile</key> + <string>${MACOSX_BUNDLE_ICON_FILE}</string> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>NSSupportsAutomaticGraphicsSwitching</key> + <true/> + <key>NSLocationUsageDescription</key> + <string>The maps demo would like to access your location for demo purposes.</string> + +</dict> +</plist> |