diff options
Diffstat (limited to 'src/mainwindow')
-rw-r--r-- | src/mainwindow/menubar.cpp | 5 | ||||
-rw-r--r-- | src/mainwindow/widgets/searchform.cpp | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/mainwindow/menubar.cpp b/src/mainwindow/menubar.cpp index 5fc039a..e557d50 100644 --- a/src/mainwindow/menubar.cpp +++ b/src/mainwindow/menubar.cpp @@ -329,10 +329,7 @@ MenuBar::MenuBar(QMenu *appMenu, MainWindow *parent) auto *printer = new QPrinter(QPrinterInfo::defaultPrinter()); QPrintDialog dlg(printer, parent); if(dlg.exec() == QDialog::Accepted) { - parent->currentView()->page()->print(printer, [printer](bool success) { - Q_UNUSED(success); - delete printer; - }); + parent->currentView()->print(printer); } } }); diff --git a/src/mainwindow/widgets/searchform.cpp b/src/mainwindow/widgets/searchform.cpp index e10933b..af54f5c 100644 --- a/src/mainwindow/widgets/searchform.cpp +++ b/src/mainwindow/widgets/searchform.cpp @@ -10,6 +10,7 @@ #include "ui_searchform.h" #include <QHideEvent> #include <QShowEvent> +#include <QWebEngineFindTextResult> #include <QWebEngineView> SearchForm::SearchForm(QWidget *parent) @@ -26,7 +27,8 @@ SearchForm::SearchForm(QWidget *parent) QWebEnginePage::FindFlags searchFlags; searchFlags.setFlag(QWebEnginePage::FindCaseSensitively, ui->caseSensitivity_checkBox->isChecked()); searchFlags.setFlag(QWebEnginePage::FindBackward, ui->reverseSearch_checkBox->isChecked()); - m_view->findText(ui->lineEdit->text(), searchFlags, [this](bool found) { + m_view->findText(ui->lineEdit->text(), searchFlags, [this](const QWebEngineFindTextResult &result) { + const bool found = result.numberOfMatches() > 0; ui->result_label->setVisible(!found); }); } |