summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/controls/Styles/Base/CircularTickmarkLabelStyle.qml4
-rw-r--r--tests/auto/extras/data/tst_circulartickmarklabel.qml9
2 files changed, 12 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
}
}
diff --git a/tests/auto/extras/data/tst_circulartickmarklabel.qml b/tests/auto/extras/data/tst_circulartickmarklabel.qml
index 2d1841e0..60d7ff9e 100644
--- a/tests/auto/extras/data/tst_circulartickmarklabel.qml
+++ b/tests/auto/extras/data/tst_circulartickmarklabel.qml
@@ -314,6 +314,15 @@ TestCase {
compare(label.__panel.tickmarkValueFromMinorIndex(((label.tickmarkCount - 1) * label.minorTickmarkCount) - 1), 98);
}
+ function test_labelText() {
+ for (var i = 0; i < label.labelCount; ++i) {
+ var labelDelegateLoader = findChild(label, "labelDelegateLoader" + i);
+ verify(labelDelegateLoader);
+ compare(labelDelegateLoader.styleData.index, i);
+ compare(labelDelegateLoader.styleData.value, i * label.labelStepSize);
+ }
+ }
+
function test_invalidValues() {
// Shouldn't produce warnings.
label.labelStepSize = 0;