summaryrefslogtreecommitdiffstats
path: root/tests/qmlcamera/qml/qmlcamera/main.qml
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-04-23 09:58:15 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-04-23 11:43:41 +0300
commit555acef736a72cdc92113a268826a6bba77fbe40 (patch)
tree83200c64836afbfcbbbd73bbeba2dbf8765dae98 /tests/qmlcamera/qml/qmlcamera/main.qml
parenta11dcce773b9ad2a913a32efe0c51b1221694659 (diff)
Added QML support for custom items
Task-number: QTRD-3048 Change-Id: I90e6fbee38bae858c2e0910178684e28eacc6472 Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'tests/qmlcamera/qml/qmlcamera/main.qml')
-rw-r--r--tests/qmlcamera/qml/qmlcamera/main.qml27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/qmlcamera/qml/qmlcamera/main.qml b/tests/qmlcamera/qml/qmlcamera/main.qml
index 264d613e..56e7d035 100644
--- a/tests/qmlcamera/qml/qmlcamera/main.qml
+++ b/tests/qmlcamera/qml/qmlcamera/main.qml
@@ -75,9 +75,10 @@ Rectangle {
property bool selectionOn: false
onPressed: {
- if (mouse.button == Qt.LeftButton)
+ if (mouse.button == Qt.LeftButton) {
selectionOn = true;
testChart.scene.selectionQueryPosition = Qt.point(mouse.x, mouse.y);
+ }
}
onReleased: {
@@ -162,4 +163,28 @@ Rectangle {
}
}
}
+
+ Button {
+ id: shuttleAdd
+ anchors.bottom: dataToggle.top
+ width: camControlArea.width
+ text: "Add Shuttle"
+ property bool addObject: true
+ onClicked: {
+ if (addObject === true) {
+ testChart.addCustomItem(":/items/shuttle.obj",
+ Qt.vector3d(5.0,35.0,3.0),
+ Qt.vector3d(0.2,0.2,0.2),
+ Qt.quaternion(0.0,0.0,0.0,0.0),
+ ":/items/shuttle.png")
+ text = "Remove Shuttle"
+ addObject = false
+ } else {
+ testChart.removeCustomItemAt(Qt.vector3d(5.0,35.0,3.0))
+ text = "Add Shuttle"
+ addObject = true
+ }
+ }
+ }
+
}