8import QtQuick.Controls 2.13
9import QtQuick.Layouts 1.3
10import QtQuick.Window 2.13
12import org.mauikit.controls 1.3 as Maui
13import org.mauikit.imagetools 1.3 as IT
14import org.kde.kquickimageeditor 1.0 as KQuickImageEditor
21 property alias url : _ocr.filePath
28 headBar.rightContent: Maui.ToolButtonMenu
30 icon.name: "format-text-bold"
35 text:
i18n(
"Read Area")
36 icon.name: "transform-crop"
40 control.push(_ocrComponent)
47 text:
i18n(
"Read All")
48 icon.name: "viewimage"
51 console.log(_ocr.getText())
59 text:
i18n(
"Configure")
73 KQuickImageEditor.ImageItem
78 readonly
property real ratioX: editImage.paintedWidth / editImage.nativeWidth;
79 readonly
property real ratioY: editImage.paintedHeight / editImage.nativeHeight;
81 fillMode: KQuickImageEditor.ImageItem.PreserveAspectFit
84 KQuickImageEditor.ImageDocument
90 KQuickImageEditor.SelectionTool
94 width: editImage.paintedWidth
95 height: editImage.paintedHeight
96 x: editImage.horizontalPadding
97 y: editImage.verticalPadding
99 KQuickImageEditor.CropBackground
103 insideX: selectionTool.selectionX
104 insideY: selectionTool.selectionY
105 insideWidth: selectionTool.selectionWidth
106 insideHeight: selectionTool.selectionHeight
109 target: selectionTool.selectionArea
110 function onDoubleClicked() {
111 _ocr.area =
Qt.rect(selectionTool.selectionX / editImage.ratioX,
112 selectionTool.selectionY / editImage.ratioY,
113 selectionTool.selectionWidth / editImage.ratioX,
114 selectionTool.selectionHeight / editImage.ratioY)
117 _listModel.append({
'text': _ocr.getText()})
124 selectionTool.selectionX = 0
125 selectionTool.selectionY = 0
126 selectionTool.selectionWidth =
Qt.binding(() => selectionTool.width)
127 selectionTool.selectionHeight =
Qt.binding(() => selectionTool.height)
135 visible: _textArea.text
146 Maui.Theme.colorSet:
Maui.Theme.Window
148 ListModel { id: _listModel}
161 width: ListView.view.width
162 onClicked:
Maui.Handy.copyTextToClipboard(model.text)
164 background: Rectangle
166 radius:
Maui.Style.radiusV
167 color:
Maui.Theme.alternateBackgroundColor
170 contentItem: TextArea
QString i18n(const char *text, const TYPE &arg...)
QString path(const QString &relativePath)