diff options
Diffstat (limited to 'src/core/api')
-rw-r--r-- | src/core/api/qwebenginepage.cpp | 5 | ||||
-rw-r--r-- | src/core/api/qwebenginepage.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp index d073b4996..3088133f7 100644 --- a/src/core/api/qwebenginepage.cpp +++ b/src/core/api/qwebenginepage.cpp @@ -1530,11 +1530,12 @@ void QWebEnginePage::replaceMisspelledWord(const QString &replacement) d->adapter->replaceMisspelling(replacement); } -void QWebEnginePage::findText(const QString &subString, FindFlags options, const QWebEngineCallback<bool> &resultCallback) +void QWebEnginePage::findText(const QString &subString, FindFlags options, const std::function<void(bool)> &resultCallback) { Q_D(QWebEnginePage); if (!d->adapter->isInitialized()) { - QtWebEngineCore::CallbackDirectory().invokeEmpty(resultCallback); + if (resultCallback) + resultCallback(false); return; } diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h index fb01c283d..78d759e1a 100644 --- a/src/core/api/qwebenginepage.h +++ b/src/core/api/qwebenginepage.h @@ -53,6 +53,8 @@ #include <QtGui/qaction.h> #include <QtNetwork/qnetworkaccessmanager.h> +#include <functional> + QT_BEGIN_NAMESPACE class QMenu; @@ -257,7 +259,7 @@ public: bool event(QEvent*) override; - void findText(const QString &subString, FindFlags options = FindFlags(), const QWebEngineCallback<bool> &resultCallback = QWebEngineCallback<bool>()); + void findText(const QString &subString, FindFlags options = {}, const std::function<void(bool)> &resultCallback = std::function<void(bool)>()); void setFeaturePermission(const QUrl &securityOrigin, Feature feature, PermissionPolicy policy); |