added ui for ofd

This commit is contained in:
leca 2025-03-11 19:37:58 +03:00
parent cb3d6c2a3f
commit 4c7a25c53e
11 changed files with 562 additions and 31 deletions

View File

@ -38,6 +38,7 @@ set(PROJECT_SOURCES
emailtextscene.h emailtextscene.cpp scenes/emailtextscene.ui
ocrscene.h ocrscene.cpp scenes/ocrscene.ui
ofdscene.h ofdscene.cpp scenes/ofdscene.ui
)
set(TRANSLATION_SOURCES
@ -45,6 +46,7 @@ set(TRANSLATION_SOURCES
mainwindow.cpp mainwindow.h scenes/mainwindow.ui
emailtextscene.cpp emailtextscene.h scenes/emailtextscene.ui
ocrscene.cpp ocrscene.h scenes/ocrscene.ui
ofdscene.cpp ofdscene.h scenes/ofdscene.ui
)
set(TS_FILES

View File

@ -66,9 +66,15 @@ int main(int argc, char *argv[]) {
//OCR scene
QWidget *ocrscene = loadUI(window, ":/scenes/scenes/ocrscene.ui");
//OFD scene
QWidget *ofdscene = loadUI(window, ":/scenes/scenes/ofdscene.ui");
sceneLayout->addWidget(mainwindowscene);
sceneLayout->addWidget(emailtextscene);
sceneLayout->addWidget(ocrscene);
sceneLayout->addWidget(ofdscene);
//Setting all back buttons
for (uint32_t sceneIndex = 0; sceneIndex < sceneLayout->count(); sceneIndex ++) {

12
ofdscene.cpp Normal file
View File

@ -0,0 +1,12 @@
#include "ofdscene.h"
#include "ui_ofdscene.h"
OFDScene::OFDScene(QWidget *parent)
: QWidget(parent)
, ui(new Ui::OFDScene) {
ui->setupUi(this);
}
OFDScene::~OFDScene() {
delete ui;
}

22
ofdscene.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef OFDSCENE_H
#define OFDSCENE_H
#include <QWidget>
namespace Ui {
class OFDScene;
}
class OFDScene : public QWidget
{
Q_OBJECT
public:
explicit OFDScene(QWidget *parent = nullptr);
~OFDScene();
private:
Ui::OFDScene *ui;
};
#endif // OFDSCENE_H

View File

@ -73,7 +73,7 @@
</rect>
</property>
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="Text">
<attribute name="title">
@ -384,7 +384,7 @@
<x>0</x>
<y>0</y>
<width>817</width>
<height>23</height>
<height>33</height>
</rect>
</property>
<widget class="QMenu" name="menuchecks_parser">

View File

@ -1,7 +1,8 @@
<RCC>
<qresource prefix="/scenes">
<file>scenes/emailtextscene.ui</file>
<file>scenes/ocrscene.ui</file>
<file>scenes/ocrscene.ui</file>
<file>scenes/mainwindow.ui</file>
<file>scenes/ofdscene.ui</file>
</qresource>
</RCC>

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>927</width>
<height>603</height>
<width>1077</width>
<height>608</height>
</rect>
</property>
<property name="windowTitle">
@ -17,22 +17,6 @@
<item row="2" column="1">
<widget class="QTextEdit" name="check_content"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="check_content_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Check content</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="parse_button">
<property name="text">
@ -53,6 +37,19 @@
</property>
</widget>
</item>
<item row="1" column="1" alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="QLabel" name="check_content_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Check content</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -6,13 +6,98 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>992</width>
<height>634</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
<number>8</number>
</property>
<item row="1" column="0">
<widget class="QPushButton" name="choose_image_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Choose</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="path_to_image_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Path to image:</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="instructions_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Recognized text will be shown below as soon as image will be processed. Please, edit it</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QTextEdit" name="check_text_edit"/>
</item>
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="back_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Back</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QPushButton" name="parse_button">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Parse</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>

190
scenes/ofdscene.ui Normal file
View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OFDScene</class>
<widget class="QWidget" name="OFDScene">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>894</width>
<height>625</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
</property>
<item row="8" column="0">
<widget class="QLabel" name="total_label">
<property name="text">
<string>Total</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="back_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Back</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="or_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>or</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QDoubleSpinBox" name="total_spin_box"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="fd_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>FD (Fiscal Document)</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="datetime_label">
<property name="text">
<string>Date and time of purchase</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QComboBox" name="operation_type_combo_box">
<item>
<property name="text">
<string>Funds income</string>
</property>
</item>
<item>
<property name="text">
<string>Funds return</string>
</property>
</item>
<item>
<property name="text">
<string>Funds spend</string>
</property>
</item>
<item>
<property name="text">
<string>Spends return</string>
</property>
</item>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="fd_line_edit"/>
</item>
<item row="2" column="0" colspan="3">
<widget class="QLabel" name="info_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="fn_line_edit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="fi_line_edit"/>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="binary_eye_button">
<property name="text">
<string>Use your phone as a QR code scanner</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="fn_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>FN (Fiscal Number)</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="fi_label">
<property name="text">
<string>FI (Fiscal Identifier)</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QDateTimeEdit" name="purchase_datetime_edit"/>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="choose_image_button">
<property name="text">
<string>Choose image on your PC</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="operation_type_label">
<property name="text">
<string>Operation type</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="3">
<widget class="QPushButton" name="parse_button">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Parse</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -28,17 +28,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="29"/>
<location filename="../scenes/emailtextscene.ui" line="49"/>
<source>Check content</source>
<translation type="unfinished">Check content</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="39"/>
<location filename="../scenes/emailtextscene.ui" line="23"/>
<source>Parse</source>
<translation type="unfinished">Parse</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="52"/>
<location filename="../scenes/emailtextscene.ui" line="36"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
@ -201,10 +201,118 @@
<context>
<name>OCRScene</name>
<message>
<location filename="../scenes/ocrscene.ui" line="14"/>
<location filename="../scenes/ocrscene.ui" line="20"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="41"/>
<source>Choose</source>
<translation type="unfinished">Choose</translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="54"/>
<source>Path to image:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="67"/>
<source>Recognized text will be shown below as soon as image will be processed. Please, edit it</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="83"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="96"/>
<source>Parse</source>
<translation type="unfinished">Parse</translation>
</message>
</context>
<context>
<name>OFDScene</name>
<message>
<location filename="../scenes/ofdscene.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="23"/>
<source>Total</source>
<translation type="unfinished">Total</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="36"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="49"/>
<source>or</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="65"/>
<source>FD (Fiscal Document)</source>
<translation type="unfinished">FD (Fiscal Document)</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="72"/>
<source>Date and time of purchase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="80"/>
<source>Funds income</source>
<translation type="unfinished">Funds income</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="85"/>
<source>Funds return</source>
<translation type="unfinished">Funds return</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="90"/>
<source>Funds spend</source>
<translation type="unfinished">Funds spend</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="95"/>
<source>Spends return</source>
<translation type="unfinished">Spends return</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="132"/>
<source>Use your phone as a QR code scanner</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="145"/>
<source>FN (Fiscal Number)</source>
<translation type="unfinished">FN (Fiscal Number)</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="152"/>
<source>FI (Fiscal Identifier)</source>
<translation type="unfinished">FI (Fiscal Identifier)</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="162"/>
<source>Choose image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="169"/>
<source>Operation type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="182"/>
<source>Parse</source>
<translation type="unfinished">Parse</translation>
</message>
</context>
<context>
<name>OutputDialog</name>

View File

@ -28,17 +28,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="29"/>
<location filename="../scenes/emailtextscene.ui" line="49"/>
<source>Check content</source>
<translation type="unfinished">Контент чека</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="39"/>
<location filename="../scenes/emailtextscene.ui" line="23"/>
<source>Parse</source>
<translation type="unfinished">Парсить</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="52"/>
<location filename="../scenes/emailtextscene.ui" line="36"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
@ -201,10 +201,118 @@
<context>
<name>OCRScene</name>
<message>
<location filename="../scenes/ocrscene.ui" line="14"/>
<location filename="../scenes/ocrscene.ui" line="20"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="41"/>
<source>Choose</source>
<translation type="unfinished">Выбрать</translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="54"/>
<source>Path to image:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="67"/>
<source>Recognized text will be shown below as soon as image will be processed. Please, edit it</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="83"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="96"/>
<source>Parse</source>
<translation type="unfinished">Парсить</translation>
</message>
</context>
<context>
<name>OFDScene</name>
<message>
<location filename="../scenes/ofdscene.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="23"/>
<source>Total</source>
<translation type="unfinished">Итого</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="36"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="49"/>
<source>or</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="65"/>
<source>FD (Fiscal Document)</source>
<translation type="unfinished">ФД</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="72"/>
<source>Date and time of purchase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="80"/>
<source>Funds income</source>
<translation type="unfinished">Приход средств</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="85"/>
<source>Funds return</source>
<translation type="unfinished">Возврат средств</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="90"/>
<source>Funds spend</source>
<translation type="unfinished">Расход средств</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="95"/>
<source>Spends return</source>
<translation type="unfinished">Возврат расхода</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="132"/>
<source>Use your phone as a QR code scanner</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="145"/>
<source>FN (Fiscal Number)</source>
<translation type="unfinished">ФН</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="152"/>
<source>FI (Fiscal Identifier)</source>
<translation type="unfinished">ФП</translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="162"/>
<source>Choose image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="169"/>
<source>Operation type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="182"/>
<source>Parse</source>
<translation type="unfinished">Парсить</translation>
</message>
</context>
<context>
<name>OutputDialog</name>