summaryrefslogtreecommitdiff
path: root/src/webengine/api/qquickwebenginedialogrequests_p.h
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2019-02-05 15:07:24 +0100
committerSzabolcs David <davidsz@inf.u-szeged.hu>2019-02-19 14:48:34 +0000
commitfd1a34045b09d9c7e927d814b87617c2424e68a8 (patch)
tree12643f1840f754593d23cacfee35d2a72205b6f0 /src/webengine/api/qquickwebenginedialogrequests_p.h
parent14988cd6b243986f501edbba678796ea5efe2c28 (diff)
downloadqtwebengine-fd1a34045b09d9c7e927d814b87617c2424e68a8.tar.gz
Add a way to customize tooltips in WebEngineView
Implement a tooltipRequested signal and a corresponding request class to expose tooltip information to the users. Task-number: QTBUG-59290 Change-Id: I4e31773c62a65d6f340aaa74237cb0076252cd5b Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebenginedialogrequests_p.h')
-rw-r--r--src/webengine/api/qquickwebenginedialogrequests_p.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginedialogrequests_p.h b/src/webengine/api/qquickwebenginedialogrequests_p.h
index cdb10c26b..5e3f7c547 100644
--- a/src/webengine/api/qquickwebenginedialogrequests_p.h
+++ b/src/webengine/api/qquickwebenginedialogrequests_p.h
@@ -260,6 +260,39 @@ private:
friend class QQuickWebEngineViewPrivate;
};
+class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTooltipRequest : public QObject {
+ Q_OBJECT
+public:
+ enum RequestType {
+ Show,
+ Hide,
+ };
+ Q_ENUM(RequestType)
+ Q_PROPERTY(int x READ x CONSTANT FINAL)
+ Q_PROPERTY(int y READ y CONSTANT FINAL)
+ Q_PROPERTY(QString text READ text CONSTANT FINAL)
+ Q_PROPERTY(RequestType type READ type CONSTANT FINAL)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+
+ ~QQuickWebEngineTooltipRequest();
+ int x() const;
+ int y() const;
+ QString text() const;
+ RequestType type() const;
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+
+private:
+ QQuickWebEngineTooltipRequest(const QString &text = QString(),
+ QObject *parent = nullptr);
+ QPoint m_position;
+ QString m_text;
+ RequestType m_type;
+ bool m_accepted;
+ friend class QQuickWebEngineViewPrivate;
+ Q_DISABLE_COPY(QQuickWebEngineTooltipRequest)
+};
+
QT_END_NAMESPACE
#endif // QQUICKWEBENGINDIALOGREQUESTS_H