summaryrefslogtreecommitdiff
path: root/src/webenginequick/api
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2023-03-20 08:46:13 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-22 12:48:47 +0000
commitb71403faeedf2955e3af541f9e140305af9ba0a8 (patch)
tree5c3537c500c5c65dc473c9fd3e2d45b327fdcd95 /src/webenginequick/api
parent7d9805df3a471e7172bf72ff1bc08c63ccfd67fa (diff)
downloadqtwebengine-b71403faeedf2955e3af541f9e140305af9ba0a8.tar.gz
Move custom dialogs example to manual tests
This example shows how to use dialogs, however documentation already provides snippets for that added in 3cbe59e29a. The only missing one was tooltip, therefore add missing snippet and move example to manual tests. Task-number: QTBUG-108751 Change-Id: I84eda805455fb0276046ed1089389d605a8af672 Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 6bf30525ee49d270dae6a6440bc607513f21237c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/webenginequick/api')
-rw-r--r--src/webenginequick/api/qquickwebenginedialogrequests.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/webenginequick/api/qquickwebenginedialogrequests.cpp b/src/webenginequick/api/qquickwebenginedialogrequests.cpp
index 3c9f8a9a7..d49f17397 100644
--- a/src/webenginequick/api/qquickwebenginedialogrequests.cpp
+++ b/src/webenginequick/api/qquickwebenginedialogrequests.cpp
@@ -685,6 +685,35 @@ void QQuickWebEngineFileDialogRequest::dialogReject()
\since QtWebEngine 1.10
\brief A request for showing a tooltip to the user.
+
+ A TooltipRequest is a request object that is passed as a
+ parameter of the WebEngineView::tooltipRequested signal. Use the
+ \c onTooltipRequested signal handler to handle requests for
+ custom tooltip menus at specific positions.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default tooltip should
+ be displayed.
+
+ The following code uses a custom tooltip to handle the request:
+
+ \code
+ WebEngineView {
+ // ...
+ onTooltipRequested: function(request) {
+ if (request.type == TooltipRequest.Show) {
+ tooltip.visible = true;
+ tooltip.x = request.x;
+ tooltip.y = request.y;
+ tooltip.text = request.text;
+ } else {
+ tooltip.visible = false;
+ }
+ request.accepted = true;
+ }
+ // ...
+ }
+ \endcode
*/
QQuickWebEngineTooltipRequest::QQuickWebEngineTooltipRequest(