From 6880277f23b47117f7788f08f855ed99b5120f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Mon, 12 May 2014 10:06:27 +0300 Subject: CustomDataItem made into a public class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTRD-3055 Change-Id: I1e449df7c1bcb48fc639dbae579e2e1499c9ef2b Reviewed-by: Tomi Korpipää --- tests/qmlcamera/qml/qmlcamera/main.qml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'tests/qmlcamera') diff --git a/tests/qmlcamera/qml/qmlcamera/main.qml b/tests/qmlcamera/qml/qmlcamera/main.qml index 56e7d035..0f708615 100644 --- a/tests/qmlcamera/qml/qmlcamera/main.qml +++ b/tests/qmlcamera/qml/qmlcamera/main.qml @@ -18,7 +18,7 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 -import QtDataVisualization 1.0 +import QtDataVisualization 1.1 import "." Rectangle { @@ -66,6 +66,16 @@ Rectangle { scene.activeCamera.yRotation: camControlArea.yValue scene.activeCamera.zoomLevel: zoomSlider.value inputHandler: null + + customItemList: [shuttleItem] + } + + Custom3DItem { + id: shuttleItem + meshFile: ":/items/shuttle.obj" + textureFile: ":/items/shuttle.png" + position: Qt.vector3d(5.0,35.0,3.0) + scaling: Qt.vector3d(0.2,0.2,0.2) } MouseArea { @@ -168,23 +178,10 @@ Rectangle { id: shuttleAdd anchors.bottom: dataToggle.top width: camControlArea.width - text: "Add Shuttle" - property bool addObject: true + text: "Remove Shuttle" 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 - } + testChart.removeCustomItemAt(Qt.vector3d(5.0,35.0,3.0)) + text = "Shuttle has been deleted" } } - } -- cgit v1.2.3