diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-06-18 11:56:23 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-06-18 12:20:56 +0300 |
commit | 436f8747d5a51aef89bf8ffb55fca475ea3d5d60 (patch) | |
tree | 1fdba50c27dad13a3a2df3aefbbe9c9515746857 /examples/qmlbarchart/qml | |
parent | de9e7fe163ec3e4aca5216aaf9d85de5e8154509 (diff) |
Convert mouse position from QML to Qt coordinates
QML has (0, 0) at bottom left, Qt at top left. For rotating to work
correctly on both, we need to convert QML mouse coordinates before passing
them to renderer.
Change-Id: Ic85fbaec2f75c0432f81dfb48070f7ab598c8e00
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Diffstat (limited to 'examples/qmlbarchart/qml')
-rw-r--r-- | examples/qmlbarchart/qml/qmlbarchart/main.qml | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/examples/qmlbarchart/qml/qmlbarchart/main.qml b/examples/qmlbarchart/qml/qmlbarchart/main.qml index 33297269..218ec363 100644 --- a/examples/qmlbarchart/qml/qmlbarchart/main.qml +++ b/examples/qmlbarchart/qml/qmlbarchart/main.qml @@ -80,12 +80,25 @@ Item { Bars3D { id: testchart - width: mainview.width - height: mainview.height + width: dataView.width + height: dataView.height - // Component.onCompleted: { - // data = testdata1 - // } + Component.onCompleted: { + //data = testdata1 + // This allows us to flip the texture to be displayed correctly in scene graph + // TODO: Find a way to do it in code.. + rotation.angle = 180 + } + + // This allows us to flip the texture to be displayed correctly in scene graph + // TODO: Find a way to do it in code.. + transform: [ + Rotation { + id: rotation; + axis.x: 1; axis.z: 0; axis.y: 0; angle: 0; + origin.x: width / 2; origin.y: height / 2; + } + ] gridVisible: true shadowQuality: Bars3D.ShadowNone @@ -96,9 +109,6 @@ Item { Component.onCompleted: { - // This allows us to flip the texture to be displayed correctly in scene graph - // TODO: Find a way to do it in code.. - //rotation.angle = 180 testrow1.addItem(testitem1); testrow1.addItem(testitem2); testrow1.addItem(testitem3); |