diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2017-08-09 17:36:44 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-05-15 09:11:57 +0000 |
commit | 9e1a353a864cf777034b969a59fb1d616b7bfc73 (patch) | |
tree | ed8faae6a5ca840e21936e7f7ae729be209b1eba /src/quicktemplates2/qquickdial_p.h | |
parent | 4458589b4082ca060384f5b3af8dfcbdb677da4d (diff) |
Dial: add inputMode property
This property adds two new ways of interacting with the dial:
horizontally and vertically. These new input modes use a relative
input system, which means that, unlike the old absolute input system,
changes to the dial's position are "added" to its value. This results
in a dial that is less "jumpy", making it safe for operations that
could be harmful if done incorrectly, like adjusting audio levels.
[ChangeLog][Controls][Dial] Added the inputMode property. This property
controls how the dial is interacted with. The circular input mode
(default, old behavior) operates on an absolute input system, whereas
the horizontal and vertical input modes use a relative input system.
Task-number: QTBUG-56323
Change-Id: Iab4e7f048b4797ab626741326ce709914e67bd31
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickdial_p.h')
-rw-r--r-- | src/quicktemplates2/qquickdial_p.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdial_p.h b/src/quicktemplates2/qquickdial_p.h index d2caccfc..cc641c78 100644 --- a/src/quicktemplates2/qquickdial_p.h +++ b/src/quicktemplates2/qquickdial_p.h @@ -72,6 +72,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDial : public QQuickControl Q_PROPERTY(QQuickItem *handle READ handle WRITE setHandle NOTIFY handleChanged FINAL) // 2.2 (Qt 5.9) Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION 2) + // 2.5 (Qt 5.12) + Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode NOTIFY inputModeChanged FINAL REVISION 5) Q_CLASSINFO("DeferredPropertyNames", "background,handle") public: @@ -103,6 +105,13 @@ public: SnapMode snapMode() const; void setSnapMode(SnapMode mode); + enum InputMode { + Circular, + Horizontal, + Vertical, + }; + Q_ENUM(InputMode) + bool wrap() const; void setWrap(bool wrap); @@ -116,6 +125,10 @@ public: bool live() const; void setLive(bool live); + // 2.5 (Qt 5.12) + InputMode inputMode() const; + void setInputMode(InputMode mode); + public Q_SLOTS: void increase(); void decrease(); @@ -134,6 +147,8 @@ Q_SIGNALS: // 2.2 (Qt 5.9) Q_REVISION(2) void moved(); Q_REVISION(2) void liveChanged(); + // 2.5 (Qt 5.12) + Q_REVISION(5) void inputModeChanged(); protected: void keyPressEvent(QKeyEvent *event) override; |