This commit is contained in:
leca 2024-09-01 16:15:00 +03:00
parent f9b0b75062
commit 5c6700f621
5 changed files with 83 additions and 109 deletions

View File

@ -3,9 +3,9 @@
#include "../goods/goods.h"
#include <vector>
class Check
{
class Check {
std::vector<Goods> goods;
public:
Check();
void add_goods(Goods);

View File

@ -5,6 +5,7 @@
#include "outputdialog.h"
#include "settings.h"
#include <iostream>
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) {
@ -35,14 +36,16 @@ void MainWindow::setupStoresList() {
}
void MainWindow::on_checkType_currentIndexChanged(int index) {
switch (index) {
case 0:
ui->checkInfoText->setVisible(true);
break;
case 1:
ui->checkInfoText->setVisible(false);
break;
}
ui->inputHolder->setCurrentIndex(index);
// switch (index) {
// case 0:
// ui->checkInfoText->setVisible(true);
// break;
// case 1:
// ui->checkInfoText->setVisible(false);
// break;
// }
}
void MainWindow::on_parseButton_clicked() {
@ -72,3 +75,12 @@ void MainWindow::on_storeType_currentIndexChanged(int index) {
std::string module = parser.search_modules()[index];
parser.set_module(module);
}
void MainWindow::on_chooseImageButton_clicked() {
QString filename = QFileDialog::getOpenFileName();
std::cout << filename.toStdString() << std::endl;
// this->options.set_path(filename.toStdString());
ui->pathLabel->setText("Path to export: " + filename);
}

View File

@ -31,6 +31,8 @@ private slots:
void on_storeType_currentIndexChanged(int index);
void on_chooseImageButton_clicked();
private:
Ui::MainWindow *ui;
};

View File

@ -66,28 +66,29 @@
</item>
<item>
<property name="text">
<string>Image (not yet implemented)</string>
<string>Image (OCR)</string>
</property>
</item>
</widget>
<widget class="QWidget" name="checkInfoText" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<widget class="QStackedWidget" name="inputHolder">
<property name="geometry">
<rect>
<x>0</x>
<y>70</y>
<width>421</width>
<height>511</height>
<x>10</x>
<y>80</y>
<width>501</width>
<height>471</height>
</rect>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="page_5">
<widget class="QLabel" name="checkContentLabel">
<property name="geometry">
<rect>
<x>20</x>
<x>10</x>
<y>10</y>
<width>121</width>
<width>101</width>
<height>18</height>
</rect>
</property>
@ -98,82 +99,42 @@
<widget class="QPlainTextEdit" name="checkContent">
<property name="geometry">
<rect>
<x>20</x>
<y>40</y>
<width>401</width>
<height>411</height>
<x>10</x>
<y>50</y>
<width>431</width>
<height>401</height>
</rect>
</property>
<property name="plainText">
<string/>
</property>
</widget>
<widget class="QPushButton" name="parseButton">
</widget>
<widget class="QWidget" name="page_6">
<widget class="QLabel" name="pathLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>480</y>
<x>110</x>
<y>20</y>
<width>161</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>Path to image: </string>
</property>
</widget>
<widget class="QPushButton" name="chooseImageButton">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>80</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Parse</string>
<string>Choose</string>
</property>
</widget>
</widget>
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>460</x>
<y>270</y>
<width>301</width>
<height>221</height>
</rect>
</property>
<property name="tabPosition">
<enum>QTabWidget::TabPosition::North</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::TabShape::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::TextElideMode::ElideNone</enum>
</property>
<property name="documentMode">
<bool>true</bool>
</property>
<property name="tabsClosable">
<bool>false</bool>
</property>
<property name="tabBarAutoHide">
<bool>true</bool>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Text</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Image</string>
</attribute>
</widget>
</widget>
<widget class="QStackedWidget" name="stackedWidget">
<property name="geometry">
<rect>
<x>460</x>
<y>60</y>
<width>241</width>
<height>151</height>
</rect>
</property>
<widget class="QWidget" name="page_5"/>
<widget class="QWidget" name="page_6"/>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">

View File

@ -102,7 +102,6 @@ void update_settings(OutputOptions &options, ColumnType t, std::string name,
void OutputDialog::on_chooseFileButton_clicked() {
QString filename = QFileDialog::getSaveFileName();
std::cout << filename.toStdString() << std::endl;
this->options.set_path(filename.toStdString());
ui->pathLabel->setText("Path to export: " + filename);
}