From 66e6d660edabd9c89517b7d3e86ebad381c0c741 Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Tue, 19 Jun 2012 16:59:47 +1000 Subject: Get all the examples building and running on Desktop. Build the required C++ stubs for each example and deploy all the files so that the examples are runnable. Change-Id: I03d23cb37e1c484110a58934a9b0aa550d6915a6 Reviewed-by: Lorn Potter --- examples/sensors/accel/accel.pro | 2 + examples/sensors/accelbubble/accelbubble.pro | 8 +++- examples/sensors/accelbubble/accelbubble.qml | 2 + examples/sensors/accelbubble/main.cpp | 42 ++++++++++++++++++ examples/sensors/cubehouse/cubehouse.pro | 10 ++++- examples/sensors/cubehouse/main.cpp | 42 ++++++++++++++++++ examples/sensors/grue/console_app/console_app.pro | 2 + examples/sensors/grue/console_app/main.cpp | 2 +- examples/sensors/grue/grue.qml | 6 +-- examples/sensors/grue/import/import.pro | 10 +---- examples/sensors/grue/lib/lib.pro | 11 ----- examples/sensors/grue/main.cpp | 42 ++++++++++++++++++ examples/sensors/grue/plugin/plugin.pro | 7 --- examples/sensors/grue/qml.pro | 8 +++- examples/sensors/maze/main.cpp | 42 ++++++++++++++++++ examples/sensors/maze/maze.pro | 15 ++++++- examples/sensors/maze/maze.qml | 2 +- examples/sensors/maze/qml.pro | 9 ---- examples/sensors/qmlqtsensors/main.cpp | 42 ++++++++++++++++++ examples/sensors/qmlqtsensors/qml.pro | 7 --- examples/sensors/qmlqtsensors/qmlqtsensors.pro | 13 +++++- examples/sensors/qmlqtsensors/qmlqtsensors.qml | 2 +- examples/sensors/qmlsensorgestures/main.cpp | 42 ++++++++++++++++++ examples/sensors/qmlsensorgestures/qml.pro | 8 +++- .../qmlsensorgestures/qmlsensorgestures.qml | 1 - examples/sensors/sensor_explorer/main.cpp | 42 ++++++++++++++++++ examples/sensors/sensor_explorer/qml.pro | 8 +++- .../sensors/sensor_explorer/sensor_explorer.qml | 2 +- examples/sensors/sensorgestures/sensorgestures.pro | 6 ++- examples/sensors/sensors.pro | 1 + examples/sensors/shakeit/main.cpp | 42 ++++++++++++++++++ examples/sensors/shakeit/qml.pro | 8 ---- examples/sensors/shakeit/shakeit.pro | 15 ++++++- examples/sensors/shakeit/shakeit.qml | 2 + examples/sensors/stub.h | 51 ++++++++++++++++++++++ 35 files changed, 481 insertions(+), 73 deletions(-) create mode 100644 examples/sensors/accelbubble/main.cpp create mode 100644 examples/sensors/cubehouse/main.cpp create mode 100644 examples/sensors/grue/main.cpp create mode 100644 examples/sensors/maze/main.cpp delete mode 100644 examples/sensors/maze/qml.pro create mode 100644 examples/sensors/qmlqtsensors/main.cpp delete mode 100644 examples/sensors/qmlqtsensors/qml.pro create mode 100644 examples/sensors/qmlsensorgestures/main.cpp create mode 100644 examples/sensors/sensor_explorer/main.cpp create mode 100644 examples/sensors/shakeit/main.cpp delete mode 100644 examples/sensors/shakeit/qml.pro create mode 100644 examples/sensors/stub.h (limited to 'examples') diff --git a/examples/sensors/accel/accel.pro b/examples/sensors/accel/accel.pro index 86303eca..99c97b67 100644 --- a/examples/sensors/accel/accel.pro +++ b/examples/sensors/accel/accel.pro @@ -5,3 +5,5 @@ QT=core sensors SOURCES=main.cpp +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/accel +INSTALLS += target diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro index f4e0ecca..e8e5976b 100644 --- a/examples/sensors/accelbubble/accelbubble.pro +++ b/examples/sensors/accelbubble/accelbubble.pro @@ -1,4 +1,7 @@ -TEMPLATE = aux +TEMPLATE = app +TARGET = accelbubble +QT += quick +SOURCES = main.cpp app.files = \ $$files(*.qml) \ @@ -6,3 +9,6 @@ app.files = \ content \ images +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/accelbubble +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/accelbubble +INSTALLS += target app diff --git a/examples/sensors/accelbubble/accelbubble.qml b/examples/sensors/accelbubble/accelbubble.qml index a212b595..9fe289d3 100644 --- a/examples/sensors/accelbubble/accelbubble.qml +++ b/examples/sensors/accelbubble/accelbubble.qml @@ -46,6 +46,8 @@ import QtMobility.sensors 1.2 Rectangle { id: mainPage + width: 320 + height: 480 //! [1] Accelerometer { diff --git a/examples/sensors/accelbubble/main.cpp b/examples/sensors/accelbubble/main.cpp new file mode 100644 index 00000000..9e939424 --- /dev/null +++ b/examples/sensors/accelbubble/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(accelbubble) diff --git a/examples/sensors/cubehouse/cubehouse.pro b/examples/sensors/cubehouse/cubehouse.pro index 1f3f7a63..1a08d003 100644 --- a/examples/sensors/cubehouse/cubehouse.pro +++ b/examples/sensors/cubehouse/cubehouse.pro @@ -1,8 +1,14 @@ -TEMPLATE = aux +TEMPLATE = app +TARGET = cubehouse +QT += quick +SOURCES = main.cpp app.files = \ $$files(*.qml) \ icon.png \ - images \ + content \ mesh +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/cubehouse +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/cubehouse +INSTALLS += target app diff --git a/examples/sensors/cubehouse/main.cpp b/examples/sensors/cubehouse/main.cpp new file mode 100644 index 00000000..662a9c10 --- /dev/null +++ b/examples/sensors/cubehouse/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(cubehouse) diff --git a/examples/sensors/grue/console_app/console_app.pro b/examples/sensors/grue/console_app/console_app.pro index 33d43176..285fd892 100644 --- a/examples/sensors/grue/console_app/console_app.pro +++ b/examples/sensors/grue/console_app/console_app.pro @@ -4,3 +4,5 @@ CONFIG += console QT=core sensors SOURCES=main.cpp +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/grue +INSTALLS += target diff --git a/examples/sensors/grue/console_app/main.cpp b/examples/sensors/grue/console_app/main.cpp index dc62e4de..1a112aee 100644 --- a/examples/sensors/grue/console_app/main.cpp +++ b/examples/sensors/grue/console_app/main.cpp @@ -53,7 +53,7 @@ public: bool filter(QSensorReading *reading) { - int percent = reading->property("chanceOfBeingEaten").value() * 100; + int percent = reading->property("chanceOfBeingEaten").value(); if (percent == 0) { qDebug() << "It is light. You are safe from Grues."; } else if (lastPercent == 0) { diff --git a/examples/sensors/grue/grue.qml b/examples/sensors/grue/grue.qml index 05d267c7..a913e605 100644 --- a/examples/sensors/grue/grue.qml +++ b/examples/sensors/grue/grue.qml @@ -43,8 +43,8 @@ import QtMobility.sensors 1.3 import Grue 1.0 Rectangle { - width: 240 - height: 320 + width: 320 + height: 480 color: "black" GrueSensor { @@ -76,7 +76,7 @@ Rectangle { Text { id: text anchors.top: parent.top - anchors.topMargin: 20 + anchors.topMargin: 0 anchors.left: parent.left anchors.right: parent.right text: "I can't tell if you're going to be eaten by a Grue or not. You're on your own!" diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro index 753e1ef8..3f46103f 100644 --- a/examples/sensors/grue/import/import.pro +++ b/examples/sensors/grue/import/import.pro @@ -11,10 +11,7 @@ LIBS += -L$$OUT_PWD/../lib -lgruesensor SOURCES = main.cpp -MT_SYSROOT=$$(MT_SYSROOT) -!isEmpty(MT_SYSROOT):EXAMPLES_PREFIX=/opt/mt/applications -!isEmpty(EXAMPLES_PREFIX):DESTPATH=$$EXAMPLES_PREFIX/com.nokia.mt.grue/imports/Grue -else:DESTPATH=$$[QT_INSTALL_IMPORTS]/Grue +DESTPATH=$$[QT_INSTALL_IMPORTS]/Grue target.path=$$DESTPATH INSTALLS += target @@ -26,8 +23,3 @@ INSTALLS += qmldir OTHER_FILES += \ plugin.json qmldir -!isEmpty(EXAMPLES_PREFIX) { - QMAKE_LFLAGS += -Wl,-rpath,$$EXAMPLES_PREFIX/com.nokia.mt.grue/lib - DEFINES += "BUNDLED_PLUGIN=\\\"$$EXAMPLES_PREFIX/com.nokia.mt.grue/plugins/sensors/libqtsensors_grue.so\\\"" -} - diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro index e048e607..9185e294 100644 --- a/examples/sensors/grue/lib/lib.pro +++ b/examples/sensors/grue/lib/lib.pro @@ -14,14 +14,3 @@ SOURCES += gruesensor.cpp\ target.path=$$[QT_INSTALL_LIBS] INSTALLS += target - -MT_SYSROOT=$$(MT_SYSROOT) -!isEmpty(MT_SYSROOT):EXAMPLES_PREFIX=/opt/mt/applications -!isEmpty(EXAMPLES_PREFIX) { - target.path = $$EXAMPLES_PREFIX/com.nokia.mt.grue/lib - remove_so.commands = "rm $(INSTALL_ROOT)$${target.path}/lib$${TARGET}.so" - remove_so.CONFIG = no_path - remove_so.depends = install_target - INSTALLS += remove_so -} - diff --git a/examples/sensors/grue/main.cpp b/examples/sensors/grue/main.cpp new file mode 100644 index 00000000..2e89d310 --- /dev/null +++ b/examples/sensors/grue/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(grue) diff --git a/examples/sensors/grue/plugin/plugin.pro b/examples/sensors/grue/plugin/plugin.pro index 32e127f1..03e66851 100644 --- a/examples/sensors/grue/plugin/plugin.pro +++ b/examples/sensors/grue/plugin/plugin.pro @@ -18,10 +18,3 @@ INSTALLS += target OTHER_FILES += \ plugin.json - -MT_SYSROOT=$$(MT_SYSROOT) -!isEmpty(MT_SYSROOT):EXAMPLES_PREFIX=/opt/mt/applications -!isEmpty(EXAMPLES_PREFIX) { - target.path = $$EXAMPLES_PREFIX/com.nokia.mt.grue/plugins/sensors -} - diff --git a/examples/sensors/grue/qml.pro b/examples/sensors/grue/qml.pro index 269b9221..3e1097b2 100644 --- a/examples/sensors/grue/qml.pro +++ b/examples/sensors/grue/qml.pro @@ -1,7 +1,13 @@ -TEMPLATE = aux +TEMPLATE = app +TARGET = grue +QT += quick +SOURCES = main.cpp app.files = \ icon.png \ $$files(*.qml) \ grue.png +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/grue +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/grue +INSTALLS += target app diff --git a/examples/sensors/maze/main.cpp b/examples/sensors/maze/main.cpp new file mode 100644 index 00000000..052cc7c8 --- /dev/null +++ b/examples/sensors/maze/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(maze) diff --git a/examples/sensors/maze/maze.pro b/examples/sensors/maze/maze.pro index a15e39ef..f7d5a2aa 100644 --- a/examples/sensors/maze/maze.pro +++ b/examples/sensors/maze/maze.pro @@ -1,4 +1,15 @@ -TEMPLATE = subdirs +TEMPLATE = app +TARGET = maze +QT += quick +SOURCES = main.cpp -SUBDIRS = qml.pro +app.files = \ + components \ + $$files(*.qml) \ + $$files(*.js) \ + icon.png \ + content +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/maze +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/maze +INSTALLS += target app diff --git a/examples/sensors/maze/maze.qml b/examples/sensors/maze/maze.qml index 40c1d1dd..ceaf81a0 100644 --- a/examples/sensors/maze/maze.qml +++ b/examples/sensors/maze/maze.qml @@ -91,7 +91,7 @@ ApplicationWindow { Rectangle { id: gameRect x: (mainWnd.width - width) / 2 - y: 25 + y: 5 width: Lib.dimension * Lib.cellDimension height: Lib.dimension * Lib.cellDimension color: "transparent" diff --git a/examples/sensors/maze/qml.pro b/examples/sensors/maze/qml.pro deleted file mode 100644 index 463e944d..00000000 --- a/examples/sensors/maze/qml.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = aux - -app.files = \ - components \ - $$files(*.qml) \ - $$files(*.js) \ - icon.png \ - content - diff --git a/examples/sensors/qmlqtsensors/main.cpp b/examples/sensors/qmlqtsensors/main.cpp new file mode 100644 index 00000000..8c1d792e --- /dev/null +++ b/examples/sensors/qmlqtsensors/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(qmlqtsensors) diff --git a/examples/sensors/qmlqtsensors/qml.pro b/examples/sensors/qmlqtsensors/qml.pro deleted file mode 100644 index 5ea723b1..00000000 --- a/examples/sensors/qmlqtsensors/qml.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = aux - -app.files = \ - $$files(*.qml) \ - icon.png \ - components - diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.pro b/examples/sensors/qmlqtsensors/qmlqtsensors.pro index a15e39ef..facd4e81 100644 --- a/examples/sensors/qmlqtsensors/qmlqtsensors.pro +++ b/examples/sensors/qmlqtsensors/qmlqtsensors.pro @@ -1,4 +1,13 @@ -TEMPLATE = subdirs +TEMPLATE = app +TARGET = qmlqtsensors +QT += quick +SOURCES = main.cpp -SUBDIRS = qml.pro +app.files = \ + $$files(*.qml) \ + icon.png \ + components +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/qmlqtsensors +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/qmlqtsensors +INSTALLS += target app diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.qml b/examples/sensors/qmlqtsensors/qmlqtsensors.qml index 44be63aa..2bda6830 100644 --- a/examples/sensors/qmlqtsensors/qmlqtsensors.qml +++ b/examples/sensors/qmlqtsensors/qmlqtsensors.qml @@ -108,7 +108,7 @@ ApplicationWindow { Text { id: labelTitle anchors.top: mainWnd.top - anchors.topMargin: 25 + anchors.topMargin: 5 anchors.left: mainWnd.left anchors.right: mainWnd.right diff --git a/examples/sensors/qmlsensorgestures/main.cpp b/examples/sensors/qmlsensorgestures/main.cpp new file mode 100644 index 00000000..59984033 --- /dev/null +++ b/examples/sensors/qmlsensorgestures/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(qmlsensorgestures) diff --git a/examples/sensors/qmlsensorgestures/qml.pro b/examples/sensors/qmlsensorgestures/qml.pro index 3fd97ef5..7c80bd0f 100644 --- a/examples/sensors/qmlsensorgestures/qml.pro +++ b/examples/sensors/qmlsensorgestures/qml.pro @@ -1,6 +1,12 @@ -TEMPLATE = aux +TEMPLATE = app +TARGET = qmlsensorgestures +QT += quick +SOURCES = main.cpp app.files = \ $$files(*.qml) \ icon.png +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/qmlsensorgestures +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/qmlsensorgestures +INSTALLS += target app diff --git a/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml b/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml index 5a7a4e20..8dd2c7ab 100644 --- a/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml +++ b/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml @@ -77,7 +77,6 @@ Rectangle { id: viewArea width: 320 height: 460 - y: 20 color: '#d6d6d6' GestureList { diff --git a/examples/sensors/sensor_explorer/main.cpp b/examples/sensors/sensor_explorer/main.cpp new file mode 100644 index 00000000..797f9a9a --- /dev/null +++ b/examples/sensors/sensor_explorer/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(sensor_explorer) diff --git a/examples/sensors/sensor_explorer/qml.pro b/examples/sensors/sensor_explorer/qml.pro index 9564e7c3..92edcc96 100644 --- a/examples/sensors/sensor_explorer/qml.pro +++ b/examples/sensors/sensor_explorer/qml.pro @@ -1,4 +1,7 @@ -TEMPLATE = aux +TEMPLATE = app +TARGET = sensor_explorer +QT += quick +SOURCES = main.cpp app.files = \ $$files(*.qml) \ @@ -6,3 +9,6 @@ app.files = \ components \ content +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/sensor_explorer +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/sensor_explorer +INSTALLS += target app diff --git a/examples/sensors/sensor_explorer/sensor_explorer.qml b/examples/sensors/sensor_explorer/sensor_explorer.qml index 88641604..bc5e1fa6 100644 --- a/examples/sensors/sensor_explorer/sensor_explorer.qml +++ b/examples/sensors/sensor_explorer/sensor_explorer.qml @@ -58,7 +58,7 @@ ApplicationWindow { SensorList { id: sensorList anchors.top: parent.top - anchors.topMargin: 20 + anchors.topMargin: 0 anchors.left: parent.left anchors.right: parent.right height: 170 diff --git a/examples/sensors/sensorgestures/sensorgestures.pro b/examples/sensors/sensorgestures/sensorgestures.pro index 295db944..118246eb 100644 --- a/examples/sensors/sensorgestures/sensorgestures.pro +++ b/examples/sensors/sensorgestures/sensorgestures.pro @@ -9,5 +9,7 @@ HEADERS += mainwindow.h FORMS += mainwindow.ui -OTHER_FILES += \ - gesture.png +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/sensorgestures +app.files = gesture.png +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/sensorgestures +INSTALLS += target app diff --git a/examples/sensors/sensors.pro b/examples/sensors/sensors.pro index f865ece5..0c894d61 100644 --- a/examples/sensors/sensors.pro +++ b/examples/sensors/sensors.pro @@ -14,3 +14,4 @@ SUBDIRS += \ !isEmpty(QT.widgets.name):SUBDIRS += \ sensorgestures +OTHER_FILES = stub.h diff --git a/examples/sensors/shakeit/main.cpp b/examples/sensors/shakeit/main.cpp new file mode 100644 index 00000000..9a4aef36 --- /dev/null +++ b/examples/sensors/shakeit/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../stub.h" +SENSORS_EXAMPLE_MAIN(shakeit) diff --git a/examples/sensors/shakeit/qml.pro b/examples/sensors/shakeit/qml.pro deleted file mode 100644 index 1c7cc61c..00000000 --- a/examples/sensors/shakeit/qml.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = aux - -app.files = \ - $$files(*.qml) \ - icon.png \ - audio \ - content - diff --git a/examples/sensors/shakeit/shakeit.pro b/examples/sensors/shakeit/shakeit.pro index 6dc685b9..9f963909 100644 --- a/examples/sensors/shakeit/shakeit.pro +++ b/examples/sensors/shakeit/shakeit.pro @@ -1,3 +1,14 @@ -TEMPLATE = subdirs +TEMPLATE = app +TARGET = shakeit +QT += quick +SOURCES = main.cpp -SUBDIRS = qml.pro +app.files = \ + $$files(*.qml) \ + icon.png \ + audio \ + content + +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/shakeit +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/shakeit +INSTALLS += target app diff --git a/examples/sensors/shakeit/shakeit.qml b/examples/sensors/shakeit/shakeit.qml index 3b3b1f5c..556d35f5 100644 --- a/examples/sensors/shakeit/shakeit.qml +++ b/examples/sensors/shakeit/shakeit.qml @@ -49,6 +49,8 @@ import QtMultimedia 5.0 Rectangle { id: window + width: 320 + height: 480 state: "default" diff --git a/examples/sensors/stub.h b/examples/sensors/stub.h new file mode 100644 index 00000000..5f7e520f --- /dev/null +++ b/examples/sensors/stub.h @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#define SENSORS_EXAMPLE_MAIN(NAME) int main(int argc, char **argv) \ +{\ + QGuiApplication app(argc,argv);\ + QQuickView view;\ + view.setSource(QUrl::fromLocalFile(#NAME ".qml"));\ + view.show();\ + return app.exec();\ +} -- cgit v1.2.3