summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorTitta Heikkala <titta.heikkala@theqtcompany.com>2015-07-10 09:56:38 +0300
committerTitta Heikkala <titta.heikkala@theqtcompany.com>2015-08-10 07:46:31 +0000
commit956ee548c718c79558051a82013953503e381f2e (patch)
tree9c597a82350c8e70c319a6635d09eb452bb29539 /tests/manual
parentb99b50e22ed34519ea07a68332d4abe49662ceac (diff)
Added mapToXxx methods to ChartView
Added mapToPosition and mapToValue methods to ChartView. These correspond to the ones QChart has. Change-Id: I5d0477d3f704b6f56243b31848d175fd17f24ff6 Task-number: QTRD-3494 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml
index e15b1372..d813e1cb 100644
--- a/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml
+++ b/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml
@@ -111,4 +111,22 @@ ChartView {
NumberAnimation { duration: 800 }
}
}
+
+ MouseArea {
+ id: zoomArea
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton
+ property point mousePoint;
+ property point valuePoint;
+
+ onPressed: {
+ mousePoint.x = mouse.x
+ mousePoint.y = mouse.y
+ valuePoint = chart.mapToValue(mousePoint, series("line"));
+ // Mouse point and position should be the same!
+ console.log("mouse point: " + mouse.x + ", " + mouse.y);
+ console.log("value point: " + valuePoint);
+ console.log("position: " + chart.mapToPosition(valuePoint, series("line")));
+ }
+ }
}