6#include "findbarwebengineview.h"
7#include <PimCommon/LineEditWithCompleterNg>
9#include <QWebEngineFindTextResult>
10#include <QWebEngineView>
11using namespace WebEngineViewer;
13class WebEngineViewer::FindBarWebEngineViewPrivate
16 FindBarWebEngineViewPrivate(QWebEngineView *view)
21 QWebEngineView *
const mView;
24FindBarWebEngineView::FindBarWebEngineView(QWebEngineView *view,
QWidget *parent)
26 , d(new WebEngineViewer::FindBarWebEngineViewPrivate(view))
30FindBarWebEngineView::~FindBarWebEngineView() =
default;
32void FindBarWebEngineView::searchText(
bool backward,
bool isAutoSearch)
34 QWebEnginePage::FindFlags searchOptions;
37 searchOptions |= QWebEnginePage::FindBackward;
40 searchOptions |= QWebEnginePage::FindCaseSensitively;
47 mLastSearchStr = searchWord;
48 d->mView->findText(mLastSearchStr, searchOptions, [
this](
const QWebEngineFindTextResult &result) {
49 setFoundMatch(result.numberOfMatches() > 0);
53void FindBarWebEngineView::updateSensitivity(
bool sensitivity)
55 QWebEnginePage::FindFlags searchOptions;
57 searchOptions |= QWebEnginePage::FindCaseSensitively;
60 d->mView->findText(
QString(), searchOptions, [
this](
const QWebEngineFindTextResult &result) {
61 setFoundMatch(result.numberOfMatches() > 0);
65void FindBarWebEngineView::clearSelections()
68 mLastSearchStr.
clear();
69 FindBarBase::clearSelections();
72#include "moc_findbarwebengineview.cpp"
bool isChecked() const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const