From 6740f93cf80237f2faeb4ef7c523eb49253c1d57 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:45:33 +0000 Subject: [PATCH 1/5] Initial plan From fceefe809f45aae89eb9a652178ed906d38a3bbd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:50:00 +0000 Subject: [PATCH 2/5] Pass libcamera instance as property through component hierarchy Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com> --- qml/Application.qml | 1 + qml/ApplicationFlow.qml | 1 + qml/ApplicationFlowForm.ui.qml | 2 ++ qml/SnapshotMenu.qml | 1 + qml/SnapshotMenuForm.ui.qml | 2 ++ qml/content/CameraRenderer.qml | 2 ++ qml/content/CameraSource.qml | 33 +++++++++++++++++++++------------ 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/qml/Application.qml b/qml/Application.qml index d9d6093a..7c80b9e7 100644 --- a/qml/Application.qml +++ b/qml/Application.qml @@ -80,6 +80,7 @@ ApplicationWindow { height: parent.height width: parent.width collageMenu.printer : printer + libcamera: libcamera settingsMenu.switchPrinter.onCheckedChanged: { diff --git a/qml/ApplicationFlow.qml b/qml/ApplicationFlow.qml index 01e1879e..ec324317 100644 --- a/qml/ApplicationFlow.qml +++ b/qml/ApplicationFlow.qml @@ -8,6 +8,7 @@ ApplicationFlowForm { height: parent.height property int animationDuration : 500 + property var libcamera mainMenuModel: modelFactory.getCollageIconModel() diff --git a/qml/ApplicationFlowForm.ui.qml b/qml/ApplicationFlowForm.ui.qml index b8f7553c..bae6bd2f 100644 --- a/qml/ApplicationFlowForm.ui.qml +++ b/qml/ApplicationFlowForm.ui.qml @@ -11,6 +11,7 @@ Item { property alias collageMenu: collageMenu property alias galleryMenu: galleryMenu property alias settingsMenu: settingsMenu + property var libcamera property real slideValueCollageSelection: 0.0 property real slideValueSnapshotMenu: 1.0 @@ -36,6 +37,7 @@ Item { width: root.width height: root.height state: "deactivated" + libcamera: root.libcamera } ImagePreview { diff --git a/qml/SnapshotMenu.qml b/qml/SnapshotMenu.qml index bf506bb1..0cdd6d0b 100644 --- a/qml/SnapshotMenu.qml +++ b/qml/SnapshotMenu.qml @@ -5,6 +5,7 @@ SnapshotMenuForm { id: form property bool snapshotTimeoutEnable : false + property var libcamera signal captured(string filename) signal abort diff --git a/qml/SnapshotMenuForm.ui.qml b/qml/SnapshotMenuForm.ui.qml index 1879108e..b0a4d8b2 100644 --- a/qml/SnapshotMenuForm.ui.qml +++ b/qml/SnapshotMenuForm.ui.qml @@ -14,10 +14,12 @@ Item { property alias shutterButton: shutterButton property alias countdown: shutterButton.countDownTime property bool hideSnapshotSettingsPane: false + property var libcamera CameraRenderer { id: cameraRenderer anchors.fill: parent + libcamera: element.libcamera Text { id: failureText diff --git a/qml/content/CameraRenderer.qml b/qml/content/CameraRenderer.qml index d4963f17..8ebfd49f 100644 --- a/qml/content/CameraRenderer.qml +++ b/qml/content/CameraRenderer.qml @@ -18,6 +18,7 @@ Item { property alias backgroundFilter: backgroundFilter property bool backgroundFilterEnabled: false property url backgroundImage: "" + property var libcamera onCameraNameChanged: { @@ -54,6 +55,7 @@ Item { anchors.fill: parent cameraName: renderer.cameraName + libcamera: renderer.libcamera onImageCaptured: function(image) { whiteOverlay.state = "released" diff --git a/qml/content/CameraSource.qml b/qml/content/CameraSource.qml index 40954766..8ad7df81 100644 --- a/qml/content/CameraSource.qml +++ b/qml/content/CameraSource.qml @@ -12,6 +12,7 @@ Item property alias output: output property string cameraName: "" property bool readyForCapture: ((cameraSession.imageCapture.readyForCapture) || (cameraSource.state === "GPhotoCamera") || (cameraSource.state === "Libcamera")) + property var libcamera signal imageCaptured(var image) signal errorOccurred(var errorString) @@ -37,12 +38,14 @@ Item return } } - var libcameras = libcamera.availableCameras() - for (var j = 0; j < libcameras.length; j++) { - if (libcameras[j] === cameraName) { - cameraSource.state = "Libcamera" - console.log("CameraSource using Libcamera camera device: " + cameraName) - return + if (cameraSource.libcamera) { + var libcameras = cameraSource.libcamera.availableCameras() + for (var j = 0; j < libcameras.length; j++) { + if (libcameras[j] === cameraName) { + cameraSource.state = "Libcamera" + console.log("CameraSource using Libcamera camera device: " + cameraName) + return + } } } @@ -62,7 +65,9 @@ Item } else if(state === "Libcamera") { - libcamera.startCamera(cameraName) + if (cameraSource.libcamera) { + cameraSource.libcamera.startCamera(cameraName) + } } else { @@ -82,7 +87,9 @@ Item } else if(state === "Libcamera") { - libcamera.stopCamera() + if (cameraSource.libcamera) { + cameraSource.libcamera.stopCamera() + } } else { @@ -100,7 +107,9 @@ Item else if(state === "Libcamera") { console.log("Libcamera capture") - libcamera.captureImage() + if (cameraSource.libcamera) { + cameraSource.libcamera.captureImage() + } } else if(state === "GPhotoCamera") { @@ -118,7 +127,7 @@ Item } Connections { - target: libcamera + target: cameraSource.libcamera function onErrorOccurred(errorString) { if(state === "Libcamera") { @@ -129,7 +138,7 @@ Item Connections { - target: libcamera + target: cameraSource.libcamera function onImageCaptured(image) { cameraSource.imageCaptured(image) } @@ -262,7 +271,7 @@ Item name: "Libcamera" PropertyChanges { target: cameraSession - videoFrameInput: libcamera + videoFrameInput: cameraSource.libcamera } }, State { From 00515ecbf508e51c664b82d7ce687bb550984cea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:51:36 +0000 Subject: [PATCH 3/5] Remove duplicate libcamera property declarations Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com> --- qml/ApplicationFlow.qml | 1 - qml/SnapshotMenu.qml | 1 - 2 files changed, 2 deletions(-) diff --git a/qml/ApplicationFlow.qml b/qml/ApplicationFlow.qml index ec324317..01e1879e 100644 --- a/qml/ApplicationFlow.qml +++ b/qml/ApplicationFlow.qml @@ -8,7 +8,6 @@ ApplicationFlowForm { height: parent.height property int animationDuration : 500 - property var libcamera mainMenuModel: modelFactory.getCollageIconModel() diff --git a/qml/SnapshotMenu.qml b/qml/SnapshotMenu.qml index 0cdd6d0b..bf506bb1 100644 --- a/qml/SnapshotMenu.qml +++ b/qml/SnapshotMenu.qml @@ -5,7 +5,6 @@ SnapshotMenuForm { id: form property bool snapshotTimeoutEnable : false - property var libcamera signal captured(string filename) signal abort From 759e30200d50df61824b054970725bc4eaa5d9e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:57:18 +0000 Subject: [PATCH 4/5] Add Libcamera instance to SettingsMenu for camera enumeration Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com> --- qml/SettingsMenu.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qml/SettingsMenu.qml b/qml/SettingsMenu.qml index 696a1bf6..f6118959 100644 --- a/qml/SettingsMenu.qml +++ b/qml/SettingsMenu.qml @@ -46,6 +46,10 @@ SettingsMenuForm { id: gphotoCamera } + Libcamera { + id: libcamera + } + MediaDevices { id: mediaDevices From 644d19839ad64c2e0f1bba905d148eb06fdd7e76 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 19:05:30 +0000 Subject: [PATCH 5/5] Pass libcamera instance from Application to SettingsMenu via property Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com> --- qml/ApplicationFlowForm.ui.qml | 1 + qml/SettingsMenu.qml | 16 +++++++--------- qml/SettingsMenuForm.ui.qml | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qml/ApplicationFlowForm.ui.qml b/qml/ApplicationFlowForm.ui.qml index bae6bd2f..f97cb617 100644 --- a/qml/ApplicationFlowForm.ui.qml +++ b/qml/ApplicationFlowForm.ui.qml @@ -75,6 +75,7 @@ Item { z: 0 width: root.width height: root.height + libcamera: root.libcamera } states: [ diff --git a/qml/SettingsMenu.qml b/qml/SettingsMenu.qml index f6118959..90e69ca9 100644 --- a/qml/SettingsMenu.qml +++ b/qml/SettingsMenu.qml @@ -33,11 +33,13 @@ SettingsMenuForm { { listModel.push(gphotoCameras[i]) } - var libcameras = libcamera.availableCameras(); - console.log("Libcamera Camera Count: " + Number(libcameras.length).toString()) - for(i = 0; i < libcameras.length; i++) - { - listModel.push(libcameras[i]) + if (form.libcamera) { + var libcameras = form.libcamera.availableCameras(); + console.log("Libcamera Camera Count: " + Number(libcameras.length).toString()) + for(i = 0; i < libcameras.length; i++) + { + listModel.push(libcameras[i]) + } } return listModel; } @@ -46,10 +48,6 @@ SettingsMenuForm { id: gphotoCamera } - Libcamera { - id: libcamera - } - MediaDevices { id: mediaDevices diff --git a/qml/SettingsMenuForm.ui.qml b/qml/SettingsMenuForm.ui.qml index b4aba3d8..03496fc8 100644 --- a/qml/SettingsMenuForm.ui.qml +++ b/qml/SettingsMenuForm.ui.qml @@ -30,6 +30,7 @@ Item { property alias comboBoxCameraOrientation: comboBoxCameraOrientation property alias comboBoxNeuralNetworkRuntime: comboBoxNeuralNetworkRuntime property alias buttonSelectPhotoDirectory: buttonSelectPhotoDirectory + property var libcamera ColumnLayout { anchors.fill: parent