diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-10-14 11:18:35 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-10-14 13:38:58 +0200 |
commit | bef3a43c8d8e9530719fe61ac8fc233c3b807035 (patch) | |
tree | 0a7a2a730b3bff744093c6e5efeaff913cc4746d | |
parent | ee08174435287c483e287a29467c8c5d30fc197b (diff) |
nativestyle, transitionDuration: make property CONSTANT
Even if the value of transitionDuration never change, the QML
engine will still complain if you use the property in a
binding, saying that it's not notifyable. So to silence
the engine, make it CONSTANT.
Also, in macos/ScrollBar.qml, ensure we actually read
the transitionDuration from a styleitem (parent is
apparently not).
Change-Id: I58e89e8771dd645ecd8a0b75a7e3871845d270be
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
-rw-r--r-- | src/imports/controls/macos/ScrollBar.qml | 2 | ||||
-rw-r--r-- | src/imports/nativestyle/items/qquickstyleitem.h | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/imports/controls/macos/ScrollBar.qml b/src/imports/controls/macos/ScrollBar.qml index d0ad6e9b..4a9f764b 100644 --- a/src/imports/controls/macos/ScrollBar.qml +++ b/src/imports/controls/macos/ScrollBar.qml @@ -58,7 +58,7 @@ NativeStyle.DefaultScrollBar { overrideState: NativeStyle.StyleItem.AlwaysHovered opacity: controlRoot.hovered || control.pressed ? 1 : 0 visible: contentItem instanceof NativeStyle.StyleItem - Behavior on opacity { NumberAnimation { duration: parent.transitionDuration } } + Behavior on opacity { NumberAnimation { duration: contentItem.transitionDuration } } } } diff --git a/src/imports/nativestyle/items/qquickstyleitem.h b/src/imports/nativestyle/items/qquickstyleitem.h index 0834662c..2c8c9920 100644 --- a/src/imports/nativestyle/items/qquickstyleitem.h +++ b/src/imports/nativestyle/items/qquickstyleitem.h @@ -160,14 +160,13 @@ class QQuickStyleItem : public QQuickItem Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth) Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight) Q_PROPERTY(bool useNinePatchImage MEMBER m_useNinePatchImage) - Q_PROPERTY(OverrideState overrideState MEMBER m_overrideState) - Q_PROPERTY(int transitionDuration MEMBER m_transitionDuration) // Output Q_PROPERTY(QQuickStyleMargins contentPadding READ contentPadding() NOTIFY contentPaddingChanged) Q_PROPERTY(QQuickStyleMargins layoutMargins READ layoutMargins() NOTIFY layoutMarginsChanged) Q_PROPERTY(QSize minimumSize READ minimumSize() NOTIFY minimumSizeChanged) + Q_PROPERTY(int transitionDuration MEMBER m_transitionDuration CONSTANT) QML_NAMED_ELEMENT(StyleItem) QML_UNCREATABLE("StyleItem is an abstract base class.") |