From 9beca180adc3109e9e258cbf54459960b33fa7d6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 3 Jun 2014 10:36:46 +0300 Subject: Misc fixes for bugs found during examples testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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ää --- .../datavisualization/qmlbars/qml/qmlbars/main.qml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'examples/datavisualization/qmlbars/qml') 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 } } } -- cgit v1.2.3