summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-11-04 11:26:56 +0100
committerJędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>2015-11-04 12:59:30 +0000
commita68b58a35aeafad279236d31c28acda02baff5cf (patch)
tree46cb8071b5fb84cbcaea5f7578004267e7a7fb09 /src
parentb2492f31fd55b7b7335154464c1c12a6895f5a23 (diff)
downloadqtquickcontrols-a68b58a35aeafad279236d31c28acda02baff5cf.tar.gz
Fix CircularGauge's tickmark labels all being set 0
We were relying on model.get() to somehow reevaluate after we'd updated properties of model items, which somehow worked until 4876ea6a18ccdfd72014582aa5d50ab9f6b6ec9e. The correct approach is to do the same thing as we do for styleData.index: rely on the model properties that are exposed to the delegate, which do get updated. Change-Id: I529ab7dcc142187fc185b11658dc5e1496b6d6db Task-number: QTBUG-48839 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/controls/Styles/Base/CircularTickmarkLabelStyle.qml4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml b/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml
index 010e9245..6e1c6740 100644
--- a/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml
+++ b/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml
@@ -285,6 +285,7 @@ Style {
}
delegate: Loader {
id: tickmarkLabelDelegateLoader
+ objectName: "labelDelegateLoader" + index
sourceComponent: tickmarkLabel
x: pos.x
y: pos.y
@@ -292,8 +293,9 @@ Style {
readonly property point pos: panelItem.labelPosFromIndex(index, width, height);
readonly property int __index: index
+ readonly property real __value: value
property QtObject styleData: QtObject {
- readonly property var value: index != -1 ? labelItemRepeater.model.get(index).value : 0
+ readonly property var value: index != -1 ? tickmarkLabelDelegateLoader.__value : 0
readonly property alias index: tickmarkLabelDelegateLoader.__index
}
}