Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom under Qt6 seemingly not working, try fixing #4764

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions src/qml/imports/QFieldControls/+Qt6/QFieldCamera.qml
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,34 @@ Popup {
}
}

Video {
id: videoPreview

visible: cameraItem.state == "VideoPreview"

anchors.fill: parent

loops: MediaPlayer.Infinite

muted: true
}

Image {
id: photoPreview

visible: cameraItem.state == "PhotoPreview"

anchors.fill: parent

fillMode: Image.PreserveAspectFit
smooth: true
focus: visible
}

PinchHandler {
enabled: cameraItem.visible && cameraItem.isCapturing
target: null
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.TakeOverForbidden
acceptedDevices: PointerDevice.TouchScreen | PointerDevice.TouchPad

property real oldScale: 1.0
Expand Down Expand Up @@ -198,30 +223,6 @@ Popup {
}
}

Video {
id: videoPreview

visible: cameraItem.state == "VideoPreview"

anchors.fill: parent

loops: MediaPlayer.Infinite

muted: true
}

Image {
id: photoPreview

visible: cameraItem.state == "PhotoPreview"

anchors.fill: parent

fillMode: Image.PreserveAspectFit
smooth: true
focus: visible
}

Rectangle {
x: cameraItem.isPortraitMode ? 0 : parent.width - 100
y: cameraItem.isPortraitMode ? parent.height - 100 : 0
Expand Down Expand Up @@ -302,7 +303,7 @@ Popup {

QfToolButton {
id: zoomButton
visible: cameraItem.isCapturing
visible: cameraItem.isCapturing && (camera.maximumZoomFactor !== 1.0 || camera.minimumZoomFactor !== 1.0)

x: cameraItem.isPortraitMode ? (parent.width / 4) - (width / 2) : (parent.width - width) / 2
y: cameraItem.isPortraitMode ? (parent.height - height) / 2 : (parent.height / 4) * 3 - (height / 2)
Expand Down
Loading