Files
RedBear-OS/local/recipes/kde/kf6-prison/source/tests/scanner-qt6.qml
T
vasilito 1e71b37bdb chore: close session — commit all remaining pre-existing state
Finalize all non-artifact changes accumulated from other sessions:
- config updates, recipe changes, source edits, patches
- pkgar/cache artifacts intentionally excluded (build outputs)

This is the maximum achievable scope for this session.
Hardware-accelerated KDE blocked by: QML gate, KWin/Plasma builds,
hardware GPU validation — all require build system + physical GPU.
2026-05-01 03:15:20 +01:00

49 lines
1.4 KiB
QML

/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: MIT
*/
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtMultimedia 6.2
import org.kde.prison.scanner 1.0 as Prison
ApplicationWindow {
width: 1024
height: 768
visible: true
VideoOutput {
id: viewFinder
anchors.fill: parent
}
Prison.VideoScanner {
id: scanner
formats: Prison.Format.QRCode | Prison.Format.Aztec
onResultChanged: console.log(result.text, result.format);
videoSink: viewFinder.videoSink
}
CaptureSession {
camera: Camera {
id: camera
active: true
function onErrorOccurred(error, errorString) {
console.log("Camera error: " + camera.errorString)
}
}
videoOutput: viewFinder
}
Rectangle {
color: "#80ff0000"
x: viewFinder.contentRect.x + scanner.result.boundingRect.x / viewFinder.sourceRect.width * viewFinder.contentRect.width
y: viewFinder.contentRect.y + scanner.result.boundingRect.y / viewFinder.sourceRect.height * viewFinder.contentRect.height
width: scanner.result.boundingRect.width / viewFinder.sourceRect.width * viewFinder.contentRect.width
height: scanner.result.boundingRect.height / viewFinder.sourceRect.height * viewFinder.contentRect.height
}
}