diff options
author | Marco Martin <mart@kde.org> | 2016-01-11 14:57:56 +0100 |
---|---|---|
committer | Marco Martin <mart@kde.org> | 2016-01-12 16:34:22 +0000 |
commit | fb0e8833fde306eebc31b78722d8f0178b817eb7 (patch) | |
tree | 5a0a6c1d4ef3f2392d3615beb0d93fd862455bd7 /src/controls/Private/ScrollViewHelper.qml | |
parent | 73bf08d2cdabb8499acf9c63b942f8df8ac0c7c1 (diff) | |
download | qtquickcontrols-fb0e8833fde306eebc31b78722d8f0178b817eb7.tar.gz |
Check for __style existence before accessing it
Since __style is loaded by a Loader, very early in initialization, it
may still be null. so check for its existence before accessing it.
When it will be fully loaded the property binding will cause a
reevaluation with the proper values.
This fixes __wheelScrollLines never being loaded from the style.
Change-Id: I5967265a4d31e1be2c972daa79b9389fecc25933
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls/Private/ScrollViewHelper.qml')
-rw-r--r-- | src/controls/Private/ScrollViewHelper.qml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/controls/Private/ScrollViewHelper.qml b/src/controls/Private/ScrollViewHelper.qml index d34aa555..24def4c9 100644 --- a/src/controls/Private/ScrollViewHelper.qml +++ b/src/controls/Private/ScrollViewHelper.qml @@ -58,10 +58,10 @@ Item { property int verticalScrollBarPolicy: Qt.ScrollBarAsNeeded - property int leftMargin: outerFrame ? root.__style.padding.left : 0 - property int rightMargin: outerFrame ? root.__style.padding.right : 0 - property int topMargin: outerFrame ? root.__style.padding.top : 0 - property int bottomMargin: outerFrame ? root.__style.padding.bottom : 0 + property int leftMargin: outerFrame && root.__style ? root.__style.padding.left : 0 + property int rightMargin: outerFrame && root.__style ? root.__style.padding.right : 0 + property int topMargin: outerFrame && root.__style ? root.__style.padding.top : 0 + property int bottomMargin: outerFrame && root.__style ? root.__style.padding.bottom : 0 anchors.fill: parent @@ -101,7 +101,7 @@ Item { Loader { id: cornerFill z: 1 - sourceComponent: __style.corner + sourceComponent: __style ? __style.corner : null anchors.right: parent.right anchors.bottom: parent.bottom anchors.bottomMargin: bottomMargin |