Fix libcamera id reference scope issues in CameraSource and SettingsMenu#239
Merged
saeugetier merged 5 commits intoJan 27, 2026
Conversation
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update libcamera based camera implementation
Fix libcamera id reference scope issue in CameraSource
Jan 27, 2026
Owner
|
@copilot please fix this comment as well #229 (comment) |
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
Author
Fixed in commit 759e302. Added a local |
Copilot
AI
changed the title
Fix libcamera id reference scope issue in CameraSource
Fix libcamera id reference scope issues in CameraSource and SettingsMenu
Jan 27, 2026
saeugetier
reviewed
Jan 27, 2026
| id: gphotoCamera | ||
| } | ||
|
|
||
| Libcamera { |
Owner
There was a problem hiding this comment.
@copilot the instance of libcamera should come from application via property
Author
There was a problem hiding this comment.
Fixed in commit 644d198. Removed the local Libcamera instance and now SettingsMenu receives the libcamera instance from Application.qml via property (Application → ApplicationFlow → ApplicationFlowForm → SettingsMenu). Updated the reference to use form.libcamera with null check.
Co-authored-by: saeugetier <1408260+saeugetier@users.noreply.github.com>
b4b9484
into
192-direct-support-of-raspberry-pi-cameras-via-libcamera
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both
CameraSource.qmlandSettingsMenu.qmlwere directly referencing thelibcameraid or module without proper instances, causing runtime failures since QML ids are scoped to their defining file and importing a module doesn't create an instance.Changes
CameraSource.qml
Added property threading: Pass
libcamerainstance through component hierarchy via properties:Updated CameraSource.qml: Replaced all bare
libcamerareferences withcameraSource.libcameraproperty access:availableCameras(),startCamera(),stopCamera(),captureImage()onErrorOccurred,onImageCapturedvideoFrameInputproperty changesExample change:
SettingsMenu.qml
Added property threading: Pass
libcamerainstance through component hierarchy via properties:Updated SettingsMenu.qml: Replaced bare
libcamerareference withform.libcameraproperty access:availableCameras()for camera enumerationThis approach maintains a single
Libcamerainstance throughout the application, defined inApplication.qmland passed as a property to all components that need it. Properties are declared in UI form files (*Form.ui.qml) to follow QML inheritance patterns and avoid shadowing in derived components.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.