diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-09-18 10:56:51 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-27 11:06:24 +0000 |
commit | 6115585477bea66d90acbbd8a25b898d121bd50e (patch) | |
tree | e768a73536e7f4219c6e2b2c8eadf88fb931100f /src/quicktemplates2/qquickabstractbutton_p.h | |
parent | 960798f9117bc5aa4aa55bf868cbb0286f8e99b6 (diff) |
QQuickAbstractButton: expose the press point
This has been frequently requested to make it possible to position
context menus, for example. The initial press point is used for drag
threshold, so we need to maintain the current press point separately.
[ChangeLog][Controls][AbstractButton] Added pressX and pressY
properties.
Task-number: QTBUG-62811
Change-Id: Ibb7b9d254ccf68876d5a3049881fee29a45530e4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton_p.h')
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton_p.h b/src/quicktemplates2/qquickabstractbutton_p.h index a123bab7..ccaf6d19 100644 --- a/src/quicktemplates2/qquickabstractbutton_p.h +++ b/src/quicktemplates2/qquickabstractbutton_p.h @@ -72,6 +72,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickAbstractButton : public QQuickContr Q_PROPERTY(QQuickAction *action READ action WRITE setAction NOTIFY actionChanged FINAL REVISION 3) Q_PROPERTY(int autoRepeatDelay READ autoRepeatDelay WRITE setAutoRepeatDelay NOTIFY autoRepeatDelayChanged FINAL REVISION 4) Q_PROPERTY(int autoRepeatInterval READ autoRepeatInterval WRITE setAutoRepeatInterval NOTIFY autoRepeatIntervalChanged FINAL REVISION 4) + Q_PROPERTY(qreal pressX READ pressX NOTIFY pressXChanged FINAL REVISION 4) + Q_PROPERTY(qreal pressY READ pressY NOTIFY pressYChanged FINAL REVISION 4) public: explicit QQuickAbstractButton(QQuickItem *parent = nullptr); @@ -130,6 +132,9 @@ public: int autoRepeatInterval() const; void setAutoRepeatInterval(int interval); + qreal pressX() const; + qreal pressY() const; + public Q_SLOTS: void toggle(); @@ -154,6 +159,8 @@ Q_SIGNALS: Q_REVISION(3) void actionChanged(); Q_REVISION(4) void autoRepeatDelayChanged(); Q_REVISION(4) void autoRepeatIntervalChanged(); + Q_REVISION(4) void pressXChanged(); + Q_REVISION(4) void pressYChanged(); protected: QQuickAbstractButton(QQuickAbstractButtonPrivate &dd, QQuickItem *parent); |