summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qwebenginepage.h
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-02-10 18:04:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-13 14:28:04 +0100
commit324706a5fe9fbfd5aeaef54387dd4b08159a92a0 (patch)
tree5a99ceb64b794890fd339d0e67ea6fee5ed79abf /src/webenginewidgets/api/qwebenginepage.h
parent9cf0007b6ff49305550754babaeb67eb85c8d5ef (diff)
Implement QWebEnginePage::findText
A few changes to the API: - Return the success result asynchronously. - FindWrapsAroundDocument and HighlightAllOccurrences are enabled by defaults and cannot be disabled. - Found text isn't updating the selection on the page like QtWebKit did, but triggers a separate state not available. A find count and current index could be exposed, but isn't in this case to keep the API delta lower. This also adds the possibility to pass bool results through the CallbackDirectory and add a new tst_QWebEnginePage::findTextResult test since the old test relied on the selection to be updated when the searched text is found. Change-Id: I8189b5aea8d832df183c6c1ae03e3f08198a9c45 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage.h')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index f89115579..aac37bc99 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -76,6 +76,7 @@ class QWebEngineCallback {
public:
template <typename F>
QWebEngineCallback(F f) : d(new QtWebEnginePrivate::QWebEngineCallbackPrivate<T, F>(f)) { }
+ QWebEngineCallback() { }
private:
QExplicitlySharedDataPointer<QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> > d;
friend class QWebEnginePage;
@@ -249,8 +250,6 @@ public:
enum FindFlag {
FindBackward = 1,
FindCaseSensitively = 2,
- FindWrapsAroundDocument = 4,
- HighlightAllOccurrences = 8
};
Q_DECLARE_FLAGS(FindFlags, FindFlag)
@@ -368,7 +367,7 @@ public:
QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
- bool findText(const QString &subString, FindFlags options = 0);
+ void findText(const QString &subString, FindFlags options = 0, const QWebEngineCallback<bool> &resultCallback = QWebEngineCallback<bool>());
void setForwardUnsupportedContent(bool forward);
bool forwardUnsupportedContent() const;