completed image ocr
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "settings.h"
|
||||
#include <iostream>
|
||||
#include <QFileDialog>
|
||||
#include "image/checkimage.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
||||
@@ -36,20 +37,20 @@ void MainWindow::setupStoresList() {
|
||||
}
|
||||
|
||||
void MainWindow::on_checkType_currentIndexChanged(int index) {
|
||||
|
||||
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() {
|
||||
QString s(ui->checkContent->toPlainText());
|
||||
QString s;
|
||||
switch (ui->checkType->currentIndex()) {
|
||||
case 0:
|
||||
s = ui->checkContent->toPlainText();
|
||||
break;
|
||||
case 1:
|
||||
s = ui->checkContentFromImage->toPlainText();
|
||||
break;
|
||||
}
|
||||
|
||||
std::wstring check_plaintext = s.toStdWString();
|
||||
parser.set_module(parser.search_modules()[0]);
|
||||
|
||||
@@ -81,6 +82,12 @@ void MainWindow::on_chooseImageButton_clicked() {
|
||||
std::cout << filename.toStdString() << std::endl;
|
||||
|
||||
// this->options.set_path(filename.toStdString());
|
||||
ui->pathLabel->setText("Path to export: " + filename);
|
||||
std::string new_text = "Path to export: " + filename.toStdString();
|
||||
ui->pathLabel->setText(QString::fromStdString(new_text));
|
||||
|
||||
CheckImage i(filename.toStdString());
|
||||
std::string parsed = i.parse_text();
|
||||
|
||||
ui->checkContentFromImage->setPlainText(QString::fromStdString(parsed));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user