summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <mart@kde.org>2016-01-11 14:57:56 +0100
committerMarco Martin <mart@kde.org>2016-01-12 16:34:22 +0000
commitfb0e8833fde306eebc31b78722d8f0178b817eb7 (patch)
tree5a0a6c1d4ef3f2392d3615beb0d93fd862455bd7
parent73bf08d2cdabb8499acf9c63b942f8df8ac0c7c1 (diff)
downloadqtquickcontrols-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>
-rw-r--r--src/controls/Private/ScrollBar.qml2
-rw-r--r--src/controls/Private/ScrollViewHelper.qml10
-rw-r--r--src/controls/ScrollView.qml2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/controls/Private/ScrollBar.qml b/src/controls/Private/ScrollBar.qml
index f6f5e26d..ca9c21cd 100644
--- a/src/controls/Private/ScrollBar.qml
+++ b/src/controls/Private/ScrollBar.qml
@@ -88,7 +88,7 @@ Item {
property int pageStep: internal.horizontal ? width : height
property bool scrollToClickposition: internal.scrollToClickPosition
anchors.fill: parent
- cursorShape: __panel.visible ? Qt.ArrowCursor : Qt.IBeamCursor // forces a cursor change
+ cursorShape: __panel && __panel.visible ? Qt.ArrowCursor : Qt.IBeamCursor // forces a cursor change
property bool autoincrement: false
property bool scrollToClickPosition: __style ? __style.scrollToClickedPosition : 0
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
diff --git a/src/controls/ScrollView.qml b/src/controls/ScrollView.qml
index a6eaed82..d2e61c81 100644
--- a/src/controls/ScrollView.qml
+++ b/src/controls/ScrollView.qml
@@ -286,7 +286,7 @@ FocusScope {
// comes originally from QTextEdit, which sets 20px steps by default, as well as
// QQuickWheelArea.
// TODO: centralize somewhere, QPlatformTheme?
- scrollSpeed: 20 * (__style.__wheelScrollLines || 1)
+ scrollSpeed: 20 * (__style && __style.__wheelScrollLines || 1)
Connections {
target: flickableItem