summaryrefslogtreecommitdiffstats
path: root/tests/manual/qml-minimal-camera
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/qml-minimal-camera')
-rw-r--r--tests/manual/qml-minimal-camera/CMakeLists.txt42
-rw-r--r--tests/manual/qml-minimal-camera/Info.plist.in46
-rw-r--r--tests/manual/qml-minimal-camera/qml-minimal-camera.cpp17
-rw-r--r--tests/manual/qml-minimal-camera/qml-minimal-camera.qml34
4 files changed, 139 insertions, 0 deletions
diff --git a/tests/manual/qml-minimal-camera/CMakeLists.txt b/tests/manual/qml-minimal-camera/CMakeLists.txt
new file mode 100644
index 000000000..fcd4676b3
--- /dev/null
+++ b/tests/manual/qml-minimal-camera/CMakeLists.txt
@@ -0,0 +1,42 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(sidepanel LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/multimedia/qml-minimal-camera")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia Qml Quick)
+
+qt_add_executable( qml-minimal-camera WIN32 MACOSX_BUNDLE
+ qml-minimal-camera.cpp
+)
+
+qt_add_qml_module( qml-minimal-camera
+ URI QmlMinimalCamera
+ NO_RESOURCE_TARGET_PATH
+ QML_FILES
+ "qml-minimal-camera.qml"
+)
+
+target_link_libraries( qml-minimal-camera PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Quick
+)
+
+install(TARGETS qml-minimal-camera
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+
+set_target_properties( qml-minimal-camera PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
+)
diff --git a/tests/manual/qml-minimal-camera/Info.plist.in b/tests/manual/qml-minimal-camera/Info.plist.in
new file mode 100644
index 000000000..46a9ecf2d
--- /dev/null
+++ b/tests/manual/qml-minimal-camera/Info.plist.in
@@ -0,0 +1,46 @@
+<?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>NSCameraUsageDescription</key>
+ <string>Qt Multimedia Example</string>
+ <key>NSMicrophoneUsageDescription</key>
+ <string>Qt Multimedia Example</string>
+
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+</dict>
+</plist>
diff --git a/tests/manual/qml-minimal-camera/qml-minimal-camera.cpp b/tests/manual/qml-minimal-camera/qml-minimal-camera.cpp
new file mode 100644
index 000000000..c61b92992
--- /dev/null
+++ b/tests/manual/qml-minimal-camera/qml-minimal-camera.cpp
@@ -0,0 +1,17 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl("qrc:/qml-minimal-camera.qml"));
+ if (engine.rootObjects().isEmpty())
+ return -1;
+
+ return app.exec();
+}
diff --git a/tests/manual/qml-minimal-camera/qml-minimal-camera.qml b/tests/manual/qml-minimal-camera/qml-minimal-camera.qml
new file mode 100644
index 000000000..3965c663e
--- /dev/null
+++ b/tests/manual/qml-minimal-camera/qml-minimal-camera.qml
@@ -0,0 +1,34 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+import QtMultimedia
+
+ApplicationWindow {
+ id: window
+ width: 800
+ height: 600
+ visible: true
+ title: qsTr("QmlMinimalCamera")
+
+ MediaDevices {
+ id: mediaDevices
+ }
+
+ CaptureSession {
+ id: captureSession
+ videoOutput: output
+ camera: Camera {
+ id: camera
+ cameraDevice: mediaDevices.defaultVideoInput
+ }
+
+ Component.onCompleted: camera.start()
+ }
+
+ VideoOutput {
+ id: output
+ visible: true
+ }
+}