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")
67 KQuickImageEditor.ImageItem
70 readonly
property real ratioX: editImage.paintedWidth / editImage.nativeWidth;
71 readonly
property real ratioY: editImage.paintedHeight / editImage.nativeHeight;
73 fillMode: KQuickImageEditor.ImageItem.PreserveAspectFit
80 KQuickImageEditor.ImageDocument
86 KQuickImageEditor.SelectionTool
90 width: editImage.paintedWidth
91 height: editImage.paintedHeight
92 x: editImage.horizontalPadding
93 y: editImage.verticalPadding
95 KQuickImageEditor.CropBackground
99 insideX: selectionTool.selectionX
100 insideY: selectionTool.selectionY
101 insideWidth: selectionTool.selectionWidth
102 insideHeight: selectionTool.selectionHeight
105 target: selectionTool.selectionArea
106 function onDoubleClicked() {
107 _ocr.area =
Qt.rect(selectionTool.selectionX / editImage.ratioX,
108 selectionTool.selectionY / editImage.ratioY,
109 selectionTool.selectionWidth / editImage.ratioX,
110 selectionTool.selectionHeight / editImage.ratioY)
113 _listModel.append({
'text': _ocr.getText()})
120 selectionTool.selectionX = 0
121 selectionTool.selectionY = 0
122 selectionTool.selectionWidth =
Qt.binding(() => selectionTool.width)
123 selectionTool.selectionHeight =
Qt.binding(() => selectionTool.height)
129 visible: _textArea.text
137 Maui.Theme.colorSet:
Maui.Theme.Window
139 ListModel { id: _listModel}
152 width: ListView.view.width
153 onClicked:
Maui.Handy.copyTextToClipboard(model.text)
155 background: Rectangle
157 radius:
Maui.Style.radiusV
158 color:
Maui.Theme.alternateBackgroundColor
161 contentItem: TextArea
QString i18n(const char *text, const TYPE &arg...)
QString path(const QString &relativePath)