diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-06-03 10:36:46 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-06-03 10:44:39 +0300 |
commit | 9beca180adc3109e9e258cbf54459960b33fa7d6 (patch) | |
tree | 97a3377cb26d9d9e6964c878bc2bfd97b28f67ad /examples/datavisualization/qmlbars | |
parent | d946344ac21393e4b08e42e657d217a0981840f9 (diff) |
Misc fixes for bugs found during examples testing
- qmlbars TableView year/month display got messed up when scrolled.
- qmllegend black background on transparent item bug was back due to
some changes in 5.3. Worked around the issue differently.
- qmloscilloscope displayed warnings about circular property binding.
- Incorrect count was used to determine amount of labels for rows
in bar charts.
Change-Id: Id5851019af258c256a92648561bb8ce766993b5c
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/datavisualization/qmlbars')
-rw-r--r-- | examples/datavisualization/qmlbars/qml/qmlbars/main.qml | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml index 32767cc4..5172e27d 100644 --- a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml +++ b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml @@ -185,18 +185,22 @@ Rectangle { anchors.right: parent.right color: styleData.textColor elide: styleData.elideMode - text: styleData.value + text: customText horizontalAlignment: styleData.textAlignment - property bool customFormatted: false + property string originalText: styleData.value + property string customText - onTextChanged: { - if (styleData.column === 0 && !customFormatted) { - customFormatted = true - var pattern = /(\d\d\d\d)-(\d\d)/ - var matches = pattern.exec(delegateText.text) - var colIndex = parseInt(matches[2], 10) - 1 - delegateText.text = matches[1] + " - " + graphAxes.column.labels[colIndex] + onOriginalTextChanged: { + if (styleData.column === 0) { + if (delegateText.originalText !== "") { + var pattern = /(\d\d\d\d)-(\d\d)/ + var matches = pattern.exec(delegateText.originalText) + var colIndex = parseInt(matches[2], 10) - 1 + delegateText.customText = matches[1] + " - " + graphAxes.column.labels[colIndex] + } + } else { + delegateText.customText = originalText } } } |