summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-04-16 17:07:42 +0200
committerLars Knoll <lars.knoll@qt.io>2021-04-19 11:10:03 +0000
commit0a555040fc4655b3ae31e3e49ca5e104d96617fe (patch)
treeedc5db645f3396e99a7c45c069d469df619d7197 /examples
parented2c55a7095d026aa75fe82d2ea448bfa4eb79c4 (diff)
Some smaller fixes for declarative-camera
Add Info.plist template to get camera permissions on macOS Fix camera selection if you have more than one camera Avoid some warnings about non notifiable properties Change-Id: I30e2802053019bb91e6650c9162601aad25bb74d Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/multimedia/declarative-camera/CMakeLists.txt2
-rw-r--r--examples/multimedia/declarative-camera/CameraListPopup.qml3
-rw-r--r--examples/multimedia/declarative-camera/Info.plist.in49
3 files changed, 51 insertions, 3 deletions
diff --git a/examples/multimedia/declarative-camera/CMakeLists.txt b/examples/multimedia/declarative-camera/CMakeLists.txt
index e978f7f77..3746c1c3a 100644
--- a/examples/multimedia/declarative-camera/CMakeLists.txt
+++ b/examples/multimedia/declarative-camera/CMakeLists.txt
@@ -27,6 +27,7 @@ qt_add_executable(declarative-camera
set_target_properties(declarative-camera PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
)
# special case begin
target_include_directories(declarative-camera PUBLIC
@@ -41,7 +42,6 @@ target_link_libraries(declarative-camera PUBLIC
Qt::Quick
)
-
# Resources:
set(declarative-camera_resource_files
"CameraButton.qml"
diff --git a/examples/multimedia/declarative-camera/CameraListPopup.qml b/examples/multimedia/declarative-camera/CameraListPopup.qml
index 31f320f20..3b8ba3f84 100644
--- a/examples/multimedia/declarative-camera/CameraListPopup.qml
+++ b/examples/multimedia/declarative-camera/CameraListPopup.qml
@@ -96,8 +96,7 @@ Popup {
anchors.fill: parent
onClicked: {
view.currentIndex = index
- cameraListPopup.currentValue = modelData.deviceId
- cameraListPopup.selected(modelData.deviceId)
+ cameraListPopup.currentValue = modelData
}
}
}
diff --git a/examples/multimedia/declarative-camera/Info.plist.in b/examples/multimedia/declarative-camera/Info.plist.in
new file mode 100644
index 000000000..daa641fb7
--- /dev/null
+++ b/examples/multimedia/declarative-camera/Info.plist.in
@@ -0,0 +1,49 @@
+<?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>CFBundleLongVersionString</key>
+ <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+
+ <key>CFBundleGetInfoString</key>
+ <string>${MACOSX_BUNDLE_INFO_STRING}</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>NSPrincipalClass</key>
+ <string>NSApplication</string>
+
+ <key>NSCameraUsageDescription</key>
+ <string>Qt Multimedia Example</string>
+ <key>NSMicrophoneUsageDescription</key>
+ <string>Qt Multimedia Example</string>
+
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+</dict>
+</plist>