diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-03-01 17:43:45 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-04-04 15:07:12 +0000 |
commit | 449ebc4fbc26db7b8ef4091f780163e3045b97c7 (patch) | |
tree | acaf476ffff80dbca05aaeda418ba78307665933 /src/quicktemplates2/qquickcontrol_p.h | |
parent | f249c3d30de43e6f0e4f8905f8a4090a912b0a08 (diff) |
QQuickControl: update baseline offset automatically
...unless explicitly defined. All buttons repeated the same binding.
[ChangeLog][Controls][Control] Unless explicitly specified, baselineOffset
is now automatically updated based on the top padding of the control and
the baselineOffset of the contentItem. Styles no longer need to specify
the baselineOffset in QML.
Change-Id: I9c6f61371fee05a06b5dd31b27d8baf9da0bdeeb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickcontrol_p.h')
-rw-r--r-- | src/quicktemplates2/qquickcontrol_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickcontrol_p.h b/src/quicktemplates2/qquickcontrol_p.h index cd317850..6e7cb42f 100644 --- a/src/quicktemplates2/qquickcontrol_p.h +++ b/src/quicktemplates2/qquickcontrol_p.h @@ -79,6 +79,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickControl : public QQuickItem Q_PROPERTY(bool wheelEnabled READ isWheelEnabled WRITE setWheelEnabled NOTIFY wheelEnabledChanged FINAL) Q_PROPERTY(QQuickItem *background READ background WRITE setBackground NOTIFY backgroundChanged FINAL) Q_PROPERTY(QQuickItem *contentItem READ contentItem WRITE setContentItem NOTIFY contentItemChanged FINAL) + Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset RESET resetBaselineOffset NOTIFY baselineOffsetChanged FINAL) // 2.3 (Qt 5.10) Q_PROPERTY(QPalette palette READ palette WRITE setPalette RESET resetPalette NOTIFY paletteChanged FINAL REVISION 3) // 2.5 (Qt 5.12) @@ -150,6 +151,10 @@ public: QQuickItem *contentItem() const; void setContentItem(QQuickItem *item); + qreal baselineOffset() const; + void setBaselineOffset(qreal offset); + void resetBaselineOffset(); + // 2.3 (Qt 5.10) QPalette palette() const; void setPalette(const QPalette &palette); @@ -184,6 +189,7 @@ Q_SIGNALS: void wheelEnabledChanged(); void backgroundChanged(); void contentItemChanged(); + void baselineOffsetChanged(); // 2.3 (Qt 5.10) Q_REVISION(3) void paletteChanged(); // 2.5 (Qt 5.12) |