add autodetect in ocr scene
This commit is contained in:
parent
6b815dbe0a
commit
c17af59358
13
ocrscene.cpp
13
ocrscene.cpp
|
@ -67,7 +67,16 @@ void OCRScene::on_choose_image_button_clicked() {
|
|||
std::string parsed = i.parse_text();
|
||||
|
||||
ui->check_text_edit->setPlainText(QString::fromStdString(parsed));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void OCRScene::on_check_text_edit_textChanged() {
|
||||
std::string store = parser.try_autodetect_store(ui->check_text_edit->toPlainText().toStdString());
|
||||
if (store == "") {
|
||||
std::cerr << tr("Could not autodetect store. If you beleive that this is an error, please, report to the developer.").toStdString() << std::endl;
|
||||
return;
|
||||
}
|
||||
unsigned int index = ui->store_combo_box->findText(QString::fromStdString(store));
|
||||
ui->store_combo_box->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ private slots:
|
|||
|
||||
void on_choose_image_button_clicked();
|
||||
|
||||
void on_check_text_edit_textChanged();
|
||||
|
||||
private:
|
||||
Ui::OCRScene *ui;
|
||||
Parser parser;
|
||||
|
|
Loading…
Reference in New Issue