From 527740c721ee37472146a7302eae3ece58779e93 Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Fri, 24 Feb 2012 13:27:57 +1000 Subject: Update the examples. Use .pro files, no .qmlproject files. Remove unused settings.json and notions.json files. Install to EXAMPLES_PREFIX when it is defined. Dest paths match info.json identifiers. No execute bit on non-executable files. Change-Id: Ib09320bd976b8aec7512531ce11ed92f05912dde Reviewed-by: Wolfgang Beck --- examples/sensors/accelbubble/accelbubble.pro | 13 ++ .../sensors/accelbubble/accelbubble.qmlproject | 18 -- examples/sensors/accelbubble/icon.png | Bin 3706 -> 2034 bytes examples/sensors/accelbubble/info.json | 2 +- examples/sensors/cubehouse/cubehouse.pro | 17 ++ examples/sensors/cubehouse/cubehouse.qmlproject | 18 -- examples/sensors/cubehouse/info.json | 2 +- examples/sensors/grue/grue.pro | 2 +- examples/sensors/grue/import/import.pro | 14 +- examples/sensors/grue/import/qsensorsimport.pri | 27 --- examples/sensors/grue/lib/lib.pro | 5 - examples/sensors/grue/plugin/plugin.pro | 5 - examples/sensors/grue/qml_app/info.json | 20 +-- examples/sensors/grue/qml_app/qml_app.pro | 12 ++ examples/sensors/grue/qml_app/qml_app.qmlproject | 20 --- examples/sensors/maze/icon.png | Bin examples/sensors/maze/maze.pro | 18 +- examples/sensors/maze/notions.json | 5 - examples/sensors/maze/qml.pro | 20 --- examples/sensors/maze/settings.json | 7 - examples/sensors/qmlqtsensors/icon.png | Bin examples/sensors/qmlqtsensors/notions.json | 5 - examples/sensors/qmlqtsensors/qml.pro | 16 -- examples/sensors/qmlqtsensors/qmlqtsensors.pro | 13 +- examples/sensors/qmlqtsensors/settings.json | 7 - .../sensors/qmlsensorgestures/plugin/plugin.pro | 9 - .../sensors/qmlsensorgestures/qml_app/icon.png | Bin .../sensors/qmlsensorgestures/qml_app/info.json | 2 +- .../sensors/qmlsensorgestures/qml_app/qml_app.pro | 16 ++ .../qmlsensorgestures/qml_app/qml_app.qmlproject | 18 -- .../qmlsensorgestures/qmlsensorgestures.pro | 2 +- examples/sensors/sensor_explorer/PropertyList.qml | 130 -------------- examples/sensors/sensor_explorer/SensorList.qml | 149 ---------------- .../components/ApplicationWindow.qml | 51 ------ .../sensors/sensor_explorer/components/Button.qml | 75 -------- .../sensor_explorer/components/TextField.qml | 109 ------------ .../images/button_background_disabled.png | Bin 579 -> 0 bytes .../components/images/button_background_normal.png | Bin 901 -> 0 bytes .../images/button_background_pressed.png | Bin 334 -> 0 bytes .../images/textfield_background_disabled.png | Bin 936 -> 0 bytes .../images/textfield_background_normal.png | Bin 767 -> 0 bytes examples/sensors/sensor_explorer/icon.png | Bin 2205 -> 0 bytes .../sensor_explorer/images/listitem_select.png | Bin 156 -> 0 bytes examples/sensors/sensor_explorer/import/import.pro | 14 +- .../sensor_explorer/import/qsensorsimport.pri | 27 --- examples/sensors/sensor_explorer/info.json | 15 -- examples/sensors/sensor_explorer/main.qml | 196 --------------------- examples/sensors/sensor_explorer/notions.json | 5 - examples/sensors/sensor_explorer/qml.pro | 19 -- .../sensor_explorer/qml_app/PropertyList.qml | 130 ++++++++++++++ .../sensors/sensor_explorer/qml_app/SensorList.qml | 149 ++++++++++++++++ .../qml_app/components/ApplicationWindow.qml | 51 ++++++ .../sensor_explorer/qml_app/components/Button.qml | 75 ++++++++ .../qml_app/components/TextField.qml | 109 ++++++++++++ .../images/button_background_disabled.png | Bin 0 -> 579 bytes .../components/images/button_background_normal.png | Bin 0 -> 901 bytes .../images/button_background_pressed.png | Bin 0 -> 334 bytes .../images/textfield_background_disabled.png | Bin 0 -> 936 bytes .../images/textfield_background_normal.png | Bin 0 -> 767 bytes examples/sensors/sensor_explorer/qml_app/icon.png | Bin 0 -> 2205 bytes .../qml_app/images/listitem_select.png | Bin 0 -> 156 bytes examples/sensors/sensor_explorer/qml_app/info.json | 15 ++ examples/sensors/sensor_explorer/qml_app/main.qml | 196 +++++++++++++++++++++ .../sensors/sensor_explorer/qml_app/qml_app.pro | 16 ++ .../sensors/sensor_explorer/sensor_explorer.pro | 3 +- examples/sensors/sensor_explorer/settings.json | 7 - examples/sensors/sensorgestures/sensorgestures.pro | 12 +- examples/sensors/sensors.pro | 8 +- examples/sensors/shakeit/audio/loopy2a_mono.wav | Bin examples/sensors/shakeit/notions.json | 5 - examples/sensors/shakeit/qml.pro | 17 -- examples/sensors/shakeit/settings.json | 7 - examples/sensors/shakeit/shakeit.pro | 15 +- 73 files changed, 872 insertions(+), 1046 deletions(-) create mode 100644 examples/sensors/accelbubble/accelbubble.pro delete mode 100644 examples/sensors/accelbubble/accelbubble.qmlproject create mode 100644 examples/sensors/cubehouse/cubehouse.pro delete mode 100644 examples/sensors/cubehouse/cubehouse.qmlproject delete mode 100644 examples/sensors/grue/import/qsensorsimport.pri create mode 100644 examples/sensors/grue/qml_app/qml_app.pro delete mode 100644 examples/sensors/grue/qml_app/qml_app.qmlproject mode change 100755 => 100644 examples/sensors/maze/icon.png delete mode 100644 examples/sensors/maze/notions.json delete mode 100644 examples/sensors/maze/qml.pro delete mode 100644 examples/sensors/maze/settings.json mode change 100755 => 100644 examples/sensors/qmlqtsensors/icon.png delete mode 100644 examples/sensors/qmlqtsensors/notions.json delete mode 100644 examples/sensors/qmlqtsensors/qml.pro delete mode 100644 examples/sensors/qmlqtsensors/settings.json mode change 100755 => 100644 examples/sensors/qmlsensorgestures/qml_app/icon.png create mode 100644 examples/sensors/qmlsensorgestures/qml_app/qml_app.pro delete mode 100644 examples/sensors/qmlsensorgestures/qml_app/qml_app.qmlproject delete mode 100644 examples/sensors/sensor_explorer/PropertyList.qml delete mode 100644 examples/sensors/sensor_explorer/SensorList.qml delete mode 100644 examples/sensors/sensor_explorer/components/ApplicationWindow.qml delete mode 100644 examples/sensors/sensor_explorer/components/Button.qml delete mode 100644 examples/sensors/sensor_explorer/components/TextField.qml delete mode 100644 examples/sensors/sensor_explorer/components/images/button_background_disabled.png delete mode 100644 examples/sensors/sensor_explorer/components/images/button_background_normal.png delete mode 100644 examples/sensors/sensor_explorer/components/images/button_background_pressed.png delete mode 100644 examples/sensors/sensor_explorer/components/images/textfield_background_disabled.png delete mode 100644 examples/sensors/sensor_explorer/components/images/textfield_background_normal.png delete mode 100755 examples/sensors/sensor_explorer/icon.png delete mode 100644 examples/sensors/sensor_explorer/images/listitem_select.png delete mode 100644 examples/sensors/sensor_explorer/import/qsensorsimport.pri delete mode 100644 examples/sensors/sensor_explorer/info.json delete mode 100644 examples/sensors/sensor_explorer/main.qml delete mode 100644 examples/sensors/sensor_explorer/notions.json delete mode 100644 examples/sensors/sensor_explorer/qml.pro create mode 100644 examples/sensors/sensor_explorer/qml_app/PropertyList.qml create mode 100644 examples/sensors/sensor_explorer/qml_app/SensorList.qml create mode 100644 examples/sensors/sensor_explorer/qml_app/components/ApplicationWindow.qml create mode 100644 examples/sensors/sensor_explorer/qml_app/components/Button.qml create mode 100644 examples/sensors/sensor_explorer/qml_app/components/TextField.qml create mode 100644 examples/sensors/sensor_explorer/qml_app/components/images/button_background_disabled.png create mode 100644 examples/sensors/sensor_explorer/qml_app/components/images/button_background_normal.png create mode 100644 examples/sensors/sensor_explorer/qml_app/components/images/button_background_pressed.png create mode 100644 examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_disabled.png create mode 100644 examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_normal.png create mode 100644 examples/sensors/sensor_explorer/qml_app/icon.png create mode 100644 examples/sensors/sensor_explorer/qml_app/images/listitem_select.png create mode 100644 examples/sensors/sensor_explorer/qml_app/info.json create mode 100644 examples/sensors/sensor_explorer/qml_app/main.qml create mode 100644 examples/sensors/sensor_explorer/qml_app/qml_app.pro delete mode 100644 examples/sensors/sensor_explorer/settings.json mode change 100755 => 100644 examples/sensors/shakeit/audio/loopy2a_mono.wav delete mode 100644 examples/sensors/shakeit/notions.json delete mode 100644 examples/sensors/shakeit/qml.pro delete mode 100644 examples/sensors/shakeit/settings.json (limited to 'examples') diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro new file mode 100644 index 00000000..8d7e1769 --- /dev/null +++ b/examples/sensors/accelbubble/accelbubble.pro @@ -0,0 +1,13 @@ +TEMPLATE = aux + +app.files = \ + info.json \ + main.qml \ + icon.png \ + images + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.accelbubble + INSTALLS = app +} + diff --git a/examples/sensors/accelbubble/accelbubble.qmlproject b/examples/sensors/accelbubble/accelbubble.qmlproject deleted file mode 100644 index 4d32f758..00000000 --- a/examples/sensors/accelbubble/accelbubble.qmlproject +++ /dev/null @@ -1,18 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ "../exampleplugin" ] -} diff --git a/examples/sensors/accelbubble/icon.png b/examples/sensors/accelbubble/icon.png index 9127d43a..d74f1111 100644 Binary files a/examples/sensors/accelbubble/icon.png and b/examples/sensors/accelbubble/icon.png differ diff --git a/examples/sensors/accelbubble/info.json b/examples/sensors/accelbubble/info.json index 36799885..9a2ed709 100644 --- a/examples/sensors/accelbubble/info.json +++ b/examples/sensors/accelbubble/info.json @@ -7,7 +7,7 @@ "Subcategory": "utility", "MainQML": "main.qml", "Version": "1.0", - "Identifier": "com.nokia.mt.accelbubble.demo", + "Identifier": "com.nokia.mt.accelbubble", "Summary": "QtSensors Accel Bubble", "Author": "Qt" } diff --git a/examples/sensors/cubehouse/cubehouse.pro b/examples/sensors/cubehouse/cubehouse.pro new file mode 100644 index 00000000..c7847f3d --- /dev/null +++ b/examples/sensors/cubehouse/cubehouse.pro @@ -0,0 +1,17 @@ +TEMPLATE = aux + +app.files = \ + Cube.qml \ + Cubehouse.qml \ + Room.qml \ + Table.qml \ + icon.png \ + images \ + info.json \ + mesh + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.cubehouse + INSTALLS = app +} + diff --git a/examples/sensors/cubehouse/cubehouse.qmlproject b/examples/sensors/cubehouse/cubehouse.qmlproject deleted file mode 100644 index 3147dfe4..00000000 --- a/examples/sensors/cubehouse/cubehouse.qmlproject +++ /dev/null @@ -1,18 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "Cubehouse.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "./images" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ "../exampleplugin" ] -} diff --git a/examples/sensors/cubehouse/info.json b/examples/sensors/cubehouse/info.json index effbfb06..39e39a8b 100644 --- a/examples/sensors/cubehouse/info.json +++ b/examples/sensors/cubehouse/info.json @@ -7,7 +7,7 @@ "Subcategory": "utility", "MainQML": "Cubehouse.qml", "Version": "1.0", - "Identifier": "com.nokia.mt.cubehouse.demo", + "Identifier": "com.nokia.mt.cubehouse", "Summary": "Cubehouse using Accelerometer", "Author": "Qt" } diff --git a/examples/sensors/grue/grue.pro b/examples/sensors/grue/grue.pro index 5af352bc..0405286d 100644 --- a/examples/sensors/grue/grue.pro +++ b/examples/sensors/grue/grue.pro @@ -1,7 +1,7 @@ TEMPLATE = subdirs SUBDIRS += lib plugin console_app -SUBDIRS += import #qml_app +SUBDIRS += import qml_app plugin.depends = lib import.depends = lib diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro index 0bb108f7..98277ddc 100644 --- a/examples/sensors/grue/import/import.pro +++ b/examples/sensors/grue/import/import.pro @@ -1,7 +1,8 @@ -TARGET = declarative_grue -TARGETPATH = Grue +TEMPLATE = lib +CONFIG += plugin -include(qsensorsimport.pri) +TARGET = $$qtLibraryTarget(declarative_grue) +TARGETPATH = Grue QT = core gui declarative sensors @@ -10,12 +11,7 @@ LIBS += -L$$OUT_PWD/../lib -lgruesensor SOURCES = main.cpp -symbian { - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.CAPABILITY = ALL -TCB -} - -!isEmpty(EXAMPLES_PREFIX):DESTPATH=$$EXAMPLES_PREFIX/grue/imports/Grue +!isEmpty(EXAMPLES_PREFIX):DESTPATH=$$EXAMPLES_PREFIX/com.nokia.mt.grue/imports/Grue else:DESTPATH=$$[QT_INSTALL_IMPORTS]/Grue target.path=$$DESTPATH diff --git a/examples/sensors/grue/import/qsensorsimport.pri b/examples/sensors/grue/import/qsensorsimport.pri deleted file mode 100644 index b8af2b7b..00000000 --- a/examples/sensors/grue/import/qsensorsimport.pri +++ /dev/null @@ -1,27 +0,0 @@ -load(qt_module) - -symbian:load(qt_plugin) -TEMPLATE = lib -CONFIG += qt plugin - -win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release - -isEmpty(TARGETPATH) { - error("qimportbase.pri: You must provide a TARGETPATH!") -} -isEmpty(TARGET) { - error("qimportbase.pri: You must provide a TARGET!") -} - -TARGET = $$qtLibraryTarget($$TARGET) -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols - -load(qt_targets) - -wince*:LIBS += $$QMAKE_LIBS_GUI - -symbian: { - TARGET.EPOCALLOWDLLDATA=1 - TARGET.CAPABILITY = All -Tcb - load(armcc_warnings) -} diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro index 8ff9b319..7e087baa 100644 --- a/examples/sensors/grue/lib/lib.pro +++ b/examples/sensors/grue/lib/lib.pro @@ -12,11 +12,6 @@ HEADERS += gruesensor.h\ SOURCES += gruesensor.cpp\ -symbian { - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.CAPABILITY = ALL -TCB -} - target.path=$$[QT_INSTALL_LIBS] INSTALLS += target diff --git a/examples/sensors/grue/plugin/plugin.pro b/examples/sensors/grue/plugin/plugin.pro index d325e001..90d7a01a 100644 --- a/examples/sensors/grue/plugin/plugin.pro +++ b/examples/sensors/grue/plugin/plugin.pro @@ -13,11 +13,6 @@ HEADERS += gruesensorimpl.h\ SOURCES += gruesensorimpl.cpp\ main.cpp\ -symbian { - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.CAPABILITY = ALL -TCB -} - target.path=$$[QT_INSTALL_PLUGINS]/sensors INSTALLS += target diff --git a/examples/sensors/grue/qml_app/info.json b/examples/sensors/grue/qml_app/info.json index e60fa3c2..2e14fc79 100644 --- a/examples/sensors/grue/qml_app/info.json +++ b/examples/sensors/grue/qml_app/info.json @@ -1,12 +1,12 @@ { - "info-version": "1.0", - "dict": { - "DisplayName": "Grue Sensor", - "Identifier": "com.nokia.mt.grue.demo", - "Runtime": "qml", - "MainQML": "main.qml", - "Version": "1.0.0", - "Category": "application", - "Summary": "The Grue sensor identifies your chance of being eaten by a Grue." - } + "info-version": "1.0", + "dict": { + "DisplayName": "Grue Sensor", + "Identifier": "com.nokia.mt.grue", + "Runtime": "qml", + "MainQML": "main.qml", + "Version": "1.0.0", + "Category": "application", + "Summary": "The Grue sensor identifies your chance of being eaten by a Grue." + } } diff --git a/examples/sensors/grue/qml_app/qml_app.pro b/examples/sensors/grue/qml_app/qml_app.pro new file mode 100644 index 00000000..47c6c140 --- /dev/null +++ b/examples/sensors/grue/qml_app/qml_app.pro @@ -0,0 +1,12 @@ +TEMPLATE = aux + +app.files = \ + icon.png \ + info.json \ + main.qml + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.grue + INSTALLS = app +} + diff --git a/examples/sensors/grue/qml_app/qml_app.qmlproject b/examples/sensors/grue/qml_app/qml_app.qmlproject deleted file mode 100644 index 2218c43d..00000000 --- a/examples/sensors/grue/qml_app/qml_app.qmlproject +++ /dev/null @@ -1,20 +0,0 @@ -/* File generated by Qt Creator, version 2.2.0 */ - -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ "../exampleplugin" ] -} diff --git a/examples/sensors/maze/icon.png b/examples/sensors/maze/icon.png old mode 100755 new mode 100644 diff --git a/examples/sensors/maze/maze.pro b/examples/sensors/maze/maze.pro index a15e39ef..7239eede 100644 --- a/examples/sensors/maze/maze.pro +++ b/examples/sensors/maze/maze.pro @@ -1,4 +1,18 @@ -TEMPLATE = subdirs +TEMPLATE = aux -SUBDIRS = qml.pro +app.files = \ + Congratulation.qml \ + Maze.qml \ + components \ + images \ + lib.js \ + LabyrinthSquare.qml \ + Mouse.qml \ + icon.png \ + info.json + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.maze + INSTALLS = app +} diff --git a/examples/sensors/maze/notions.json b/examples/sensors/maze/notions.json deleted file mode 100644 index 95d05191..00000000 --- a/examples/sensors/maze/notions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "notion-file-version": 1, - "capabilities": [ - ] -} diff --git a/examples/sensors/maze/qml.pro b/examples/sensors/maze/qml.pro deleted file mode 100644 index 2e6dbc23..00000000 --- a/examples/sensors/maze/qml.pro +++ /dev/null @@ -1,20 +0,0 @@ -TEMPLATE = aux - -app.files = \ - info.json \ - notions.json \ - settings.json \ - Congratulation.qml \ - LabyrinthSquare.qml \ - lib.js \ - Maze.qml \ - Mouse.qml \ - icon.png \ - components \ - images - -!isEmpty(EXAMPLES_PREFIX) { - TARGET_DIR = $$EXAMPLES_PREFIX/com.nokia.mt.maze - app.path = $$TARGET_DIR - INSTALLS += app -} diff --git a/examples/sensors/maze/settings.json b/examples/sensors/maze/settings.json deleted file mode 100644 index 5300076a..00000000 --- a/examples/sensors/maze/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "1.0.0", - "identifier": "com.nokia.mt.maze", - "label": "Labyrinth game using TiltSensor", - "settings": [ - ] -} diff --git a/examples/sensors/qmlqtsensors/icon.png b/examples/sensors/qmlqtsensors/icon.png old mode 100755 new mode 100644 diff --git a/examples/sensors/qmlqtsensors/notions.json b/examples/sensors/qmlqtsensors/notions.json deleted file mode 100644 index 95d05191..00000000 --- a/examples/sensors/qmlqtsensors/notions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "notion-file-version": 1, - "capabilities": [ - ] -} diff --git a/examples/sensors/qmlqtsensors/qml.pro b/examples/sensors/qmlqtsensors/qml.pro deleted file mode 100644 index 6838887e..00000000 --- a/examples/sensors/qmlqtsensors/qml.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE = aux - -app.files = \ - info.json \ - notions.json \ - settings.json \ - main.qml \ - icon.png \ - components - -!isEmpty(EXAMPLES_PREFIX) { - TARGET_DIR = $$EXAMPLES_PREFIX/com.nokia.mt.qmlqtsensors - app.path = $$TARGET_DIR - INSTALLS = app -} - diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.pro b/examples/sensors/qmlqtsensors/qmlqtsensors.pro index a15e39ef..84f38f64 100644 --- a/examples/sensors/qmlqtsensors/qmlqtsensors.pro +++ b/examples/sensors/qmlqtsensors/qmlqtsensors.pro @@ -1,4 +1,13 @@ -TEMPLATE = subdirs +TEMPLATE = aux -SUBDIRS = qml.pro +app.files = \ + info.json \ + main.qml \ + icon.png \ + components + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.qmlqtsensors + INSTALLS = app +} diff --git a/examples/sensors/qmlqtsensors/settings.json b/examples/sensors/qmlqtsensors/settings.json deleted file mode 100644 index c0d28762..00000000 --- a/examples/sensors/qmlqtsensors/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "1.0.0", - "identifier": "com.nokia.mt.qmlqtsensors", - "label": "QML Qt Sensors demo", - "settings": [ - ] -} diff --git a/examples/sensors/qmlsensorgestures/plugin/plugin.pro b/examples/sensors/qmlsensorgestures/plugin/plugin.pro index ab250884..0e9cb1aa 100644 --- a/examples/sensors/qmlsensorgestures/plugin/plugin.pro +++ b/examples/sensors/qmlsensorgestures/plugin/plugin.pro @@ -6,7 +6,6 @@ TARGET = qtsensorgestures_counterplugin QT += sensors DESTDIR = $$QT.sensors.plugins/sensorgestures -# Input HEADERS += \ qcountergestureplugin.h \ qcounterrecognizer.h @@ -17,11 +16,3 @@ SOURCES += \ target.path += $$[QT_INSTALL_PLUGINS]/sensorgestures INSTALLS += target - - - - - - - - diff --git a/examples/sensors/qmlsensorgestures/qml_app/icon.png b/examples/sensors/qmlsensorgestures/qml_app/icon.png old mode 100755 new mode 100644 diff --git a/examples/sensors/qmlsensorgestures/qml_app/info.json b/examples/sensors/qmlsensorgestures/qml_app/info.json index 39a62190..063caaa0 100644 --- a/examples/sensors/qmlsensorgestures/qml_app/info.json +++ b/examples/sensors/qmlsensorgestures/qml_app/info.json @@ -7,7 +7,7 @@ "Subcategory": "utility", "MainQML": "Gesture.qml", "Version": "1.0", - "Identifier": "com.nokia.mt.qmlsensorsgesture.demo", + "Identifier": "com.nokia.mt.qmlsensorsgesture", "Summary": "QML Sensors Gesture demo", "Author": "Qt" } diff --git a/examples/sensors/qmlsensorgestures/qml_app/qml_app.pro b/examples/sensors/qmlsensorgestures/qml_app/qml_app.pro new file mode 100644 index 00000000..f7741f46 --- /dev/null +++ b/examples/sensors/qmlsensorgestures/qml_app/qml_app.pro @@ -0,0 +1,16 @@ +TEMPLATE = aux + +app.files = \ + Button.qml \ + GestureList.qml \ + GesturesView.qml \ + info.json \ + Gesture.qml \ + GestureView.qml \ + icon.png + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.qmlsensorgestures + INSTALLS = app +} + diff --git a/examples/sensors/qmlsensorgestures/qml_app/qml_app.qmlproject b/examples/sensors/qmlsensorgestures/qml_app/qml_app.qmlproject deleted file mode 100644 index 90245a62..00000000 --- a/examples/sensors/qmlsensorgestures/qml_app/qml_app.qmlproject +++ /dev/null @@ -1,18 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "Gesture.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ "../exampleplugin" ] -} diff --git a/examples/sensors/qmlsensorgestures/qmlsensorgestures.pro b/examples/sensors/qmlsensorgestures/qmlsensorgestures.pro index 46b8228d..01677c19 100644 --- a/examples/sensors/qmlsensorgestures/qmlsensorgestures.pro +++ b/examples/sensors/qmlsensorgestures/qmlsensorgestures.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs SUBDIRS += plugin -SUBDIRS += #qml_app +SUBDIRS += qml_app diff --git a/examples/sensors/sensor_explorer/PropertyList.qml b/examples/sensors/sensor_explorer/PropertyList.qml deleted file mode 100644 index ba956fba..00000000 --- a/examples/sensors/sensor_explorer/PropertyList.qml +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 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$ -** -****************************************************************************/ - -//Import the declarative plugins -import QtQuick 2.0 -import Explorer 1.0 - -Rectangle { - id: controlrect - anchors.margins: 5 - color: "transparent" - - property PropertyInfo selectedItem: null; - signal selectedItemChanged(); - property alias listmodel: itemList.model - - onListmodelChanged: { - itemList.currentIndex = -1; - selectedItem = null; - selectedItemChanged(); - } - - Rectangle { - id: itemListRect - anchors.fill: parent - color: "transparent" - - ListView { - id: itemList - anchors.fill: itemListRect - anchors.leftMargin: 5 - anchors.rightMargin: 5 - focus: true - currentIndex: -1 - delegate: itemListDelegate - clip: true - - Rectangle { - id: scrollbar - anchors.right: itemList.right - y: itemList.visibleArea.yPosition * itemList.height - width: 2 - height: itemList.visibleArea.heightRatio * itemList.height - color: "black" - } - } - - Component { - id: itemListDelegate - - Rectangle { - width: itemList.width - height: itemNameText.font.pixelSize + 3 - color: "transparent" - - Image { - id: backgroundImage - anchors.fill: parent - source: "images/listitem_select.png" - visible: itemList.currentIndex === index - } - - Text { - id: itemNameText - text: model.modelData.name - font.pixelSize: 15 - color: (itemList.currentIndex === index ? "#1c94ff" : "black") - } - - Text { - id: itemValueText - anchors.left: parent.left - anchors.right: parent.right - anchors.rightMargin: 5 - font.pixelSize: 15 - horizontalAlignment: Text.AlignRight - text: model.modelData.value - color: (itemList.currentIndex === index ? "#1c94ff" : "black") - } - - MouseArea { - anchors.fill: parent - - onClicked: { - itemList.currentIndex = index; - selectedItem = model.modelData; - selectedItemChanged(); - } - } - } - } - } -} diff --git a/examples/sensors/sensor_explorer/SensorList.qml b/examples/sensors/sensor_explorer/SensorList.qml deleted file mode 100644 index f95572b3..00000000 --- a/examples/sensors/sensor_explorer/SensorList.qml +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 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$ -** -****************************************************************************/ - -//Import the declarative plugins -import QtQuick 2.0 -import Explorer 1.0 - -Rectangle { - id: controlrect - anchors.margins: 5 - color: "transparent" - - property SensorItem selectedItem: null; - signal selectedItemChanged(); - property alias title: labelTitle.text - property alias listmodel: itemList.model - - onListmodelChanged: { - itemList.currentIndex = -1; - selectedItem = null; - selectedItemChanged(); - } - - Text { - id: labelTitle - anchors.top: controlrect.top - anchors.left: controlrect.left - anchors.right: controlrect.right - horizontalAlignment: Text.AlignHCenter - font.pixelSize: 30 - font.bold: true - text: "" - } - - Rectangle { - id: titleLine - anchors.top: labelTitle.bottom - anchors.left: controlrect.left - anchors.right: controlrect.right - height: 1 - border.width: 1 - border.color: "#999999" - } - - Rectangle { - id: itemListRect - anchors.top: titleLine.bottom - anchors.left: controlrect.left - anchors.right: controlrect.right - anchors.bottom: controlrect.bottom - color: "transparent" - - ListView { - id: itemList - anchors.fill: itemListRect - anchors.leftMargin: 5 - anchors.rightMargin: 5 - focus: true - currentIndex: -1 - delegate: itemListDelegate - clip: true - - Rectangle { - id: scrollbar - anchors.right: itemList.right - y: itemList.visibleArea.yPosition * itemList.height - width: 2 - height: itemList.visibleArea.heightRatio * itemList.height - color: "black" - } - } - - Component { - id: itemListDelegate - - Rectangle { - width: itemList.width - height: 30 - color: "transparent" - - Image { - id: backgroundImage - anchors.fill: parent - source: "images/listitem_select.png" - visible: itemList.currentIndex === index - } - - Text { - id: itemText - height: 30 - anchors.top: parent.top - anchors.left: parent.left - anchors.leftMargin: 5 - text: model.modelData.id - color: (itemList.currentIndex === index ? "#1c94ff" : "black") - verticalAlignment: Text.AlignVCenter - font.pixelSize: 15 - } - - MouseArea { - anchors.fill: parent - - onClicked: { - itemList.currentIndex = index; - selectedItem = model.modelData; - selectedItemChanged(); - } - } - } - } - } -} diff --git a/examples/sensors/sensor_explorer/components/ApplicationWindow.qml b/examples/sensors/sensor_explorer/components/ApplicationWindow.qml deleted file mode 100644 index cab5e94c..00000000 --- a/examples/sensors/sensor_explorer/components/ApplicationWindow.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -//Import the declarative plugins -import QtQuick 2.0 - -Rectangle { - id: appWnd - x: 0 - y: 0 - width: 320 - height: 480 - color: "#ececec" -} diff --git a/examples/sensors/sensor_explorer/components/Button.qml b/examples/sensors/sensor_explorer/components/Button.qml deleted file mode 100644 index 537a8bce..00000000 --- a/examples/sensors/sensor_explorer/components/Button.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 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$ -** -****************************************************************************/ - -//Import the declarative plugins -import QtQuick 2.0 - -//Implementation of the Button control. -Item { - id: button - width: 30 - height: 100 - property alias text: innerText.text - signal clicked - - Image { - id: backgroundImage - anchors.fill: parent - source: (button.enabled ? "images/button_background_normal.png" : "images/button_background_disabled.png") - } - - Text { - id: innerText - anchors.centerIn: parent - color: "white" - font.bold: true - } - - //Mouse area to react on click events - MouseArea { - anchors.fill: button - onClicked: { button.clicked();} - onPressed: { - backgroundImage.source = "images/button_background_pressed.png" } - onReleased: { - backgroundImage.source = (button.enabled ? "images/button_background_normal.png" : "images/button_background_disabled.png") - } - } -} diff --git a/examples/sensors/sensor_explorer/components/TextField.qml b/examples/sensors/sensor_explorer/components/TextField.qml deleted file mode 100644 index c1feaf21..00000000 --- a/examples/sensors/sensor_explorer/components/TextField.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -//Import the declarative plugins -import QtQuick 2.0 - -Item { - id: textInputFrame - property alias text: textInput.text - signal accepted - - resources: [ - Component{ - id: cursorA - Rectangle { - id: cursor_rect - width: 2 - height: 20 - color: "#1c94ff" - visible: textInput.cursorVisible - - PropertyAnimation on opacity { - easing.type: Easing.OutSine - loops: Animation.Infinite - from: 0 - to: 1.0 - duration: 750 - } - } - } - ] - - Image { - id: backgroundImage - anchors.fill: parent - source: (textInputFrame.enabled ? "images/textfield_background_normal.png" : "images/textfield_background_disabled.png") - } - - TextInput { - id: textInput - anchors.fill: parent - anchors.topMargin: 5 - anchors.leftMargin: 5 - anchors.rightMargin: 5 - activeFocusOnPress: false - - cursorDelegate: cursorA - - onEnabledChanged: { - textInput.focus = false; - } - - onAccepted: { - textInputFrame.accepted(); - } - - MouseArea { - anchors.fill: parent - - onClicked: { - if (!textInput.activeFocus) { - textInput.forceActiveFocus() - textInput.openSoftwareInputPanel(); - } else { - textInput.focus = false; - } - } - - onPressAndHold: textInput.closeSoftwareInputPanel(); - } - } -} diff --git a/examples/sensors/sensor_explorer/components/images/button_background_disabled.png b/examples/sensors/sensor_explorer/components/images/button_background_disabled.png deleted file mode 100644 index 62a00b9a..00000000 Binary files a/examples/sensors/sensor_explorer/components/images/button_background_disabled.png and /dev/null differ diff --git a/examples/sensors/sensor_explorer/components/images/button_background_normal.png b/examples/sensors/sensor_explorer/components/images/button_background_normal.png deleted file mode 100644 index 1fecad5b..00000000 Binary files a/examples/sensors/sensor_explorer/components/images/button_background_normal.png and /dev/null differ diff --git a/examples/sensors/sensor_explorer/components/images/button_background_pressed.png b/examples/sensors/sensor_explorer/components/images/button_background_pressed.png deleted file mode 100644 index 149529e1..00000000 Binary files a/examples/sensors/sensor_explorer/components/images/button_background_pressed.png and /dev/null differ diff --git a/examples/sensors/sensor_explorer/components/images/textfield_background_disabled.png b/examples/sensors/sensor_explorer/components/images/textfield_background_disabled.png deleted file mode 100644 index 98bc601f..00000000 Binary files a/examples/sensors/sensor_explorer/components/images/textfield_background_disabled.png and /dev/null differ diff --git a/examples/sensors/sensor_explorer/components/images/textfield_background_normal.png b/examples/sensors/sensor_explorer/components/images/textfield_background_normal.png deleted file mode 100644 index b90b50cd..00000000 Binary files a/examples/sensors/sensor_explorer/components/images/textfield_background_normal.png and /dev/null differ diff --git a/examples/sensors/sensor_explorer/icon.png b/examples/sensors/sensor_explorer/icon.png deleted file mode 100755 index c48b6095..00000000 Binary files a/examples/sensors/sensor_explorer/icon.png and /dev/null differ diff --git a/examples/sensors/sensor_explorer/images/listitem_select.png b/examples/sensors/sensor_explorer/images/listitem_select.png deleted file mode 100644 index def234f1..00000000 Binary files a/examples/sensors/sensor_explorer/images/listitem_select.png and /dev/null differ diff --git a/examples/sensors/sensor_explorer/import/import.pro b/examples/sensors/sensor_explorer/import/import.pro index 7baec429..ec78653e 100644 --- a/examples/sensors/sensor_explorer/import/import.pro +++ b/examples/sensors/sensor_explorer/import/import.pro @@ -1,19 +1,15 @@ -TARGET = declarative_explorer -TARGETPATH = Explorer +TEMPLATE = lib +CONFIG += plugin -include(qsensorsimport.pri) +TARGET = $$qtLibraryTarget(declarative_explorer) +TARGETPATH = Explorer QT += declarative sensors SOURCES = main.cpp explorer.cpp sensoritem.cpp propertyinfo.cpp HEADERS = explorer.h sensoritem.h propertyinfo.h -symbian { - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.CAPABILITY = ALL -TCB -} - -!isEmpty(EXAMPLES_PREFIX):DESTPATH=$$EXAMPLES_PREFIX/sensor_explorer/imports/Explorer +!isEmpty(EXAMPLES_PREFIX):DESTPATH=$$EXAMPLES_PREFIX/com.nokia.mt.sensor_explorer/imports/Explorer else:DESTPATH=$$[QT_INSTALL_IMPORTS]/Explorer target.path=$$DESTPATH diff --git a/examples/sensors/sensor_explorer/import/qsensorsimport.pri b/examples/sensors/sensor_explorer/import/qsensorsimport.pri deleted file mode 100644 index b8af2b7b..00000000 --- a/examples/sensors/sensor_explorer/import/qsensorsimport.pri +++ /dev/null @@ -1,27 +0,0 @@ -load(qt_module) - -symbian:load(qt_plugin) -TEMPLATE = lib -CONFIG += qt plugin - -win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release - -isEmpty(TARGETPATH) { - error("qimportbase.pri: You must provide a TARGETPATH!") -} -isEmpty(TARGET) { - error("qimportbase.pri: You must provide a TARGET!") -} - -TARGET = $$qtLibraryTarget($$TARGET) -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols - -load(qt_targets) - -wince*:LIBS += $$QMAKE_LIBS_GUI - -symbian: { - TARGET.EPOCALLOWDLLDATA=1 - TARGET.CAPABILITY = All -Tcb - load(armcc_warnings) -} diff --git a/examples/sensors/sensor_explorer/info.json b/examples/sensors/sensor_explorer/info.json deleted file mode 100644 index 95b56fe5..00000000 --- a/examples/sensors/sensor_explorer/info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "info-version": "1.0", - "dict": { - "Category": "application", - "Runtime": "qml", - "DisplayName": "Sensors Explorer", - "Subcategory": "utility", - "MainQML": "main.qml", - "Version": "1.0.0", - "Identifier": "com.nokia.mt.sensorexplorer", - "Summary": "QML Sensors Explorer demo", - "Author": "Qt" - } -} - diff --git a/examples/sensors/sensor_explorer/main.qml b/examples/sensors/sensor_explorer/main.qml deleted file mode 100644 index 88641604..00000000 --- a/examples/sensors/sensor_explorer/main.qml +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 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$ -** -****************************************************************************/ - -//Import the declarative plugins -import QtQuick 2.0 -import "components" - -//! [0] -import Explorer 1.0 -//! [0] - -ApplicationWindow { - id: mainWnd - -//! [1] - SensorExplorer { - id: explorer - } -//! [1] - - SensorList { - id: sensorList - anchors.top: parent.top - anchors.topMargin: 20 - anchors.left: parent.left - anchors.right: parent.right - height: 170 - title: "sensor explorer" - -//! [2] - listmodel: explorer.availableSensors -//! [2] - - onSelectedItemChanged: { - explorer.selectedSensorItem = sensorList.selectedItem; - startstopButton.text=(explorer.selectedSensorItem !== null ? - (explorer.selectedSensorItem.start === true ? "Stop" : "Start") : "Start") - if (sensorList.selectedItem !== null) - -//! [3] - propertyList.listmodel = sensorList.selectedItem.properties; -//! [3] - } - } - - Rectangle { - id: listSplitLine - anchors.top: sensorList.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 5 - anchors.rightMargin: 5 - height: 1 - border.width: 1 - border.color: "#999999" - } - - PropertyList { - id: propertyList - anchors.top: listSplitLine.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: listPropertyEndLine.top - anchors.bottomMargin: 5 - - onSelectedItemChanged: { - textfield.enabled = (propertyList.selectedItem === null ? - false : propertyList.selectedItem.isWriteable); - } - } - - Rectangle { - id: listPropertyEndLine - anchors.bottom: startstopButton.top - anchors.bottomMargin: 5 - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 5 - anchors.rightMargin: 5 - height: 1 - border.width: 1 - border.color: "#999999" - } - - - Button { - id: startstopButton - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.margins: 5 - text: (explorer.selectedSensorItem !== null ? - (explorer.selectedSensorItem.start === true ? "Stop" : "Start") : "Start") - enabled: true - height: 30 - width: 80 - - onClicked: { - if (explorer.selectedSensorItem !== null) { -//! [5] - if (text === "Start") { - explorer.selectedSensorItem.start = true; - text = "Stop"; - } - else { - explorer.selectedSensorItem.start = false; - text = "Start"; - } -//! [5] - } - - textfield.text = ""; - } - } - - TextField { - id: textfield - anchors.top: parent.bottom - anchors.topMargin: -35 - anchors.left: startstopButton.right - anchors.right: parent.right - anchors.margins: 5 - height: 30 - enabled: false - - onEnabledChanged: { - if (!textfield.enabled) { - textfield.closeSoftwareInputPanel(); - textfield.anchors.top= parent.bottom; - textfield.anchors.topMargin= -35; - textfield.text = ""; - } - } - - onFocusChanged: { - if (textfield.focus) { - textfield.anchors.top= sensorList.bottom - textfield.anchors.topMargin= -15 - } - else { - textfield.closeSoftwareInputPanel(); - textfield.anchors.top= parent.bottom; - textfield.anchors.topMargin= -35; - } - } - - onAccepted: { - - if (explorer.selectedSensorItem !== null - && propertyList.selectedItem !== null) { -//! [4] - explorer.selectedSensorItem.changePropertyValue(propertyList.selectedItem, textfield.text); -//! [4] - propertyList.focus=true; - } - textfield.text = ""; - } - } -} - diff --git a/examples/sensors/sensor_explorer/notions.json b/examples/sensors/sensor_explorer/notions.json deleted file mode 100644 index 95d05191..00000000 --- a/examples/sensors/sensor_explorer/notions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "notion-file-version": 1, - "capabilities": [ - ] -} diff --git a/examples/sensors/sensor_explorer/qml.pro b/examples/sensors/sensor_explorer/qml.pro deleted file mode 100644 index 71022cd5..00000000 --- a/examples/sensors/sensor_explorer/qml.pro +++ /dev/null @@ -1,19 +0,0 @@ -TEMPLATE = aux - -app.files = \ - info.json \ - notions.json \ - settings.json \ - main.qml \ - PropertyList.qml \ - SensorList.qml \ - icon.png \ - components \ - images - -!isEmpty(EXAMPLES_PREFIX) { - TARGET_DIR = $$EXAMPLES_PREFIX/com.nokia.mt.sensorexplorer - app.path = $$TARGET_DIR - INSTALLS = app -} - diff --git a/examples/sensors/sensor_explorer/qml_app/PropertyList.qml b/examples/sensors/sensor_explorer/qml_app/PropertyList.qml new file mode 100644 index 00000000..ba956fba --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/PropertyList.qml @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2011 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$ +** +****************************************************************************/ + +//Import the declarative plugins +import QtQuick 2.0 +import Explorer 1.0 + +Rectangle { + id: controlrect + anchors.margins: 5 + color: "transparent" + + property PropertyInfo selectedItem: null; + signal selectedItemChanged(); + property alias listmodel: itemList.model + + onListmodelChanged: { + itemList.currentIndex = -1; + selectedItem = null; + selectedItemChanged(); + } + + Rectangle { + id: itemListRect + anchors.fill: parent + color: "transparent" + + ListView { + id: itemList + anchors.fill: itemListRect + anchors.leftMargin: 5 + anchors.rightMargin: 5 + focus: true + currentIndex: -1 + delegate: itemListDelegate + clip: true + + Rectangle { + id: scrollbar + anchors.right: itemList.right + y: itemList.visibleArea.yPosition * itemList.height + width: 2 + height: itemList.visibleArea.heightRatio * itemList.height + color: "black" + } + } + + Component { + id: itemListDelegate + + Rectangle { + width: itemList.width + height: itemNameText.font.pixelSize + 3 + color: "transparent" + + Image { + id: backgroundImage + anchors.fill: parent + source: "images/listitem_select.png" + visible: itemList.currentIndex === index + } + + Text { + id: itemNameText + text: model.modelData.name + font.pixelSize: 15 + color: (itemList.currentIndex === index ? "#1c94ff" : "black") + } + + Text { + id: itemValueText + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: 5 + font.pixelSize: 15 + horizontalAlignment: Text.AlignRight + text: model.modelData.value + color: (itemList.currentIndex === index ? "#1c94ff" : "black") + } + + MouseArea { + anchors.fill: parent + + onClicked: { + itemList.currentIndex = index; + selectedItem = model.modelData; + selectedItemChanged(); + } + } + } + } + } +} diff --git a/examples/sensors/sensor_explorer/qml_app/SensorList.qml b/examples/sensors/sensor_explorer/qml_app/SensorList.qml new file mode 100644 index 00000000..f95572b3 --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/SensorList.qml @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2011 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$ +** +****************************************************************************/ + +//Import the declarative plugins +import QtQuick 2.0 +import Explorer 1.0 + +Rectangle { + id: controlrect + anchors.margins: 5 + color: "transparent" + + property SensorItem selectedItem: null; + signal selectedItemChanged(); + property alias title: labelTitle.text + property alias listmodel: itemList.model + + onListmodelChanged: { + itemList.currentIndex = -1; + selectedItem = null; + selectedItemChanged(); + } + + Text { + id: labelTitle + anchors.top: controlrect.top + anchors.left: controlrect.left + anchors.right: controlrect.right + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 30 + font.bold: true + text: "" + } + + Rectangle { + id: titleLine + anchors.top: labelTitle.bottom + anchors.left: controlrect.left + anchors.right: controlrect.right + height: 1 + border.width: 1 + border.color: "#999999" + } + + Rectangle { + id: itemListRect + anchors.top: titleLine.bottom + anchors.left: controlrect.left + anchors.right: controlrect.right + anchors.bottom: controlrect.bottom + color: "transparent" + + ListView { + id: itemList + anchors.fill: itemListRect + anchors.leftMargin: 5 + anchors.rightMargin: 5 + focus: true + currentIndex: -1 + delegate: itemListDelegate + clip: true + + Rectangle { + id: scrollbar + anchors.right: itemList.right + y: itemList.visibleArea.yPosition * itemList.height + width: 2 + height: itemList.visibleArea.heightRatio * itemList.height + color: "black" + } + } + + Component { + id: itemListDelegate + + Rectangle { + width: itemList.width + height: 30 + color: "transparent" + + Image { + id: backgroundImage + anchors.fill: parent + source: "images/listitem_select.png" + visible: itemList.currentIndex === index + } + + Text { + id: itemText + height: 30 + anchors.top: parent.top + anchors.left: parent.left + anchors.leftMargin: 5 + text: model.modelData.id + color: (itemList.currentIndex === index ? "#1c94ff" : "black") + verticalAlignment: Text.AlignVCenter + font.pixelSize: 15 + } + + MouseArea { + anchors.fill: parent + + onClicked: { + itemList.currentIndex = index; + selectedItem = model.modelData; + selectedItemChanged(); + } + } + } + } + } +} diff --git a/examples/sensors/sensor_explorer/qml_app/components/ApplicationWindow.qml b/examples/sensors/sensor_explorer/qml_app/components/ApplicationWindow.qml new file mode 100644 index 00000000..cab5e94c --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/components/ApplicationWindow.qml @@ -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$ +** +****************************************************************************/ + +//Import the declarative plugins +import QtQuick 2.0 + +Rectangle { + id: appWnd + x: 0 + y: 0 + width: 320 + height: 480 + color: "#ececec" +} diff --git a/examples/sensors/sensor_explorer/qml_app/components/Button.qml b/examples/sensors/sensor_explorer/qml_app/components/Button.qml new file mode 100644 index 00000000..537a8bce --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/components/Button.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2011 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$ +** +****************************************************************************/ + +//Import the declarative plugins +import QtQuick 2.0 + +//Implementation of the Button control. +Item { + id: button + width: 30 + height: 100 + property alias text: innerText.text + signal clicked + + Image { + id: backgroundImage + anchors.fill: parent + source: (button.enabled ? "images/button_background_normal.png" : "images/button_background_disabled.png") + } + + Text { + id: innerText + anchors.centerIn: parent + color: "white" + font.bold: true + } + + //Mouse area to react on click events + MouseArea { + anchors.fill: button + onClicked: { button.clicked();} + onPressed: { + backgroundImage.source = "images/button_background_pressed.png" } + onReleased: { + backgroundImage.source = (button.enabled ? "images/button_background_normal.png" : "images/button_background_disabled.png") + } + } +} diff --git a/examples/sensors/sensor_explorer/qml_app/components/TextField.qml b/examples/sensors/sensor_explorer/qml_app/components/TextField.qml new file mode 100644 index 00000000..c1feaf21 --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/components/TextField.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +//Import the declarative plugins +import QtQuick 2.0 + +Item { + id: textInputFrame + property alias text: textInput.text + signal accepted + + resources: [ + Component{ + id: cursorA + Rectangle { + id: cursor_rect + width: 2 + height: 20 + color: "#1c94ff" + visible: textInput.cursorVisible + + PropertyAnimation on opacity { + easing.type: Easing.OutSine + loops: Animation.Infinite + from: 0 + to: 1.0 + duration: 750 + } + } + } + ] + + Image { + id: backgroundImage + anchors.fill: parent + source: (textInputFrame.enabled ? "images/textfield_background_normal.png" : "images/textfield_background_disabled.png") + } + + TextInput { + id: textInput + anchors.fill: parent + anchors.topMargin: 5 + anchors.leftMargin: 5 + anchors.rightMargin: 5 + activeFocusOnPress: false + + cursorDelegate: cursorA + + onEnabledChanged: { + textInput.focus = false; + } + + onAccepted: { + textInputFrame.accepted(); + } + + MouseArea { + anchors.fill: parent + + onClicked: { + if (!textInput.activeFocus) { + textInput.forceActiveFocus() + textInput.openSoftwareInputPanel(); + } else { + textInput.focus = false; + } + } + + onPressAndHold: textInput.closeSoftwareInputPanel(); + } + } +} diff --git a/examples/sensors/sensor_explorer/qml_app/components/images/button_background_disabled.png b/examples/sensors/sensor_explorer/qml_app/components/images/button_background_disabled.png new file mode 100644 index 00000000..62a00b9a Binary files /dev/null and b/examples/sensors/sensor_explorer/qml_app/components/images/button_background_disabled.png differ diff --git a/examples/sensors/sensor_explorer/qml_app/components/images/button_background_normal.png b/examples/sensors/sensor_explorer/qml_app/components/images/button_background_normal.png new file mode 100644 index 00000000..1fecad5b Binary files /dev/null and b/examples/sensors/sensor_explorer/qml_app/components/images/button_background_normal.png differ diff --git a/examples/sensors/sensor_explorer/qml_app/components/images/button_background_pressed.png b/examples/sensors/sensor_explorer/qml_app/components/images/button_background_pressed.png new file mode 100644 index 00000000..149529e1 Binary files /dev/null and b/examples/sensors/sensor_explorer/qml_app/components/images/button_background_pressed.png differ diff --git a/examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_disabled.png b/examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_disabled.png new file mode 100644 index 00000000..98bc601f Binary files /dev/null and b/examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_disabled.png differ diff --git a/examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_normal.png b/examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_normal.png new file mode 100644 index 00000000..b90b50cd Binary files /dev/null and b/examples/sensors/sensor_explorer/qml_app/components/images/textfield_background_normal.png differ diff --git a/examples/sensors/sensor_explorer/qml_app/icon.png b/examples/sensors/sensor_explorer/qml_app/icon.png new file mode 100644 index 00000000..c48b6095 Binary files /dev/null and b/examples/sensors/sensor_explorer/qml_app/icon.png differ diff --git a/examples/sensors/sensor_explorer/qml_app/images/listitem_select.png b/examples/sensors/sensor_explorer/qml_app/images/listitem_select.png new file mode 100644 index 00000000..def234f1 Binary files /dev/null and b/examples/sensors/sensor_explorer/qml_app/images/listitem_select.png differ diff --git a/examples/sensors/sensor_explorer/qml_app/info.json b/examples/sensors/sensor_explorer/qml_app/info.json new file mode 100644 index 00000000..ce7e0c37 --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/info.json @@ -0,0 +1,15 @@ +{ + "info-version": "1.0", + "dict": { + "Category": "application", + "Runtime": "qml", + "DisplayName": "Sensors Explorer", + "Subcategory": "utility", + "MainQML": "main.qml", + "Version": "1.0.0", + "Identifier": "com.nokia.mt.sensor_explorer", + "Summary": "QML Sensors Explorer demo", + "Author": "Qt" + } +} + diff --git a/examples/sensors/sensor_explorer/qml_app/main.qml b/examples/sensors/sensor_explorer/qml_app/main.qml new file mode 100644 index 00000000..88641604 --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/main.qml @@ -0,0 +1,196 @@ +/**************************************************************************** +** +** Copyright (C) 2011 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$ +** +****************************************************************************/ + +//Import the declarative plugins +import QtQuick 2.0 +import "components" + +//! [0] +import Explorer 1.0 +//! [0] + +ApplicationWindow { + id: mainWnd + +//! [1] + SensorExplorer { + id: explorer + } +//! [1] + + SensorList { + id: sensorList + anchors.top: parent.top + anchors.topMargin: 20 + anchors.left: parent.left + anchors.right: parent.right + height: 170 + title: "sensor explorer" + +//! [2] + listmodel: explorer.availableSensors +//! [2] + + onSelectedItemChanged: { + explorer.selectedSensorItem = sensorList.selectedItem; + startstopButton.text=(explorer.selectedSensorItem !== null ? + (explorer.selectedSensorItem.start === true ? "Stop" : "Start") : "Start") + if (sensorList.selectedItem !== null) + +//! [3] + propertyList.listmodel = sensorList.selectedItem.properties; +//! [3] + } + } + + Rectangle { + id: listSplitLine + anchors.top: sensorList.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 5 + anchors.rightMargin: 5 + height: 1 + border.width: 1 + border.color: "#999999" + } + + PropertyList { + id: propertyList + anchors.top: listSplitLine.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: listPropertyEndLine.top + anchors.bottomMargin: 5 + + onSelectedItemChanged: { + textfield.enabled = (propertyList.selectedItem === null ? + false : propertyList.selectedItem.isWriteable); + } + } + + Rectangle { + id: listPropertyEndLine + anchors.bottom: startstopButton.top + anchors.bottomMargin: 5 + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 5 + anchors.rightMargin: 5 + height: 1 + border.width: 1 + border.color: "#999999" + } + + + Button { + id: startstopButton + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.margins: 5 + text: (explorer.selectedSensorItem !== null ? + (explorer.selectedSensorItem.start === true ? "Stop" : "Start") : "Start") + enabled: true + height: 30 + width: 80 + + onClicked: { + if (explorer.selectedSensorItem !== null) { +//! [5] + if (text === "Start") { + explorer.selectedSensorItem.start = true; + text = "Stop"; + } + else { + explorer.selectedSensorItem.start = false; + text = "Start"; + } +//! [5] + } + + textfield.text = ""; + } + } + + TextField { + id: textfield + anchors.top: parent.bottom + anchors.topMargin: -35 + anchors.left: startstopButton.right + anchors.right: parent.right + anchors.margins: 5 + height: 30 + enabled: false + + onEnabledChanged: { + if (!textfield.enabled) { + textfield.closeSoftwareInputPanel(); + textfield.anchors.top= parent.bottom; + textfield.anchors.topMargin= -35; + textfield.text = ""; + } + } + + onFocusChanged: { + if (textfield.focus) { + textfield.anchors.top= sensorList.bottom + textfield.anchors.topMargin= -15 + } + else { + textfield.closeSoftwareInputPanel(); + textfield.anchors.top= parent.bottom; + textfield.anchors.topMargin= -35; + } + } + + onAccepted: { + + if (explorer.selectedSensorItem !== null + && propertyList.selectedItem !== null) { +//! [4] + explorer.selectedSensorItem.changePropertyValue(propertyList.selectedItem, textfield.text); +//! [4] + propertyList.focus=true; + } + textfield.text = ""; + } + } +} + diff --git a/examples/sensors/sensor_explorer/qml_app/qml_app.pro b/examples/sensors/sensor_explorer/qml_app/qml_app.pro new file mode 100644 index 00000000..2eb78cea --- /dev/null +++ b/examples/sensors/sensor_explorer/qml_app/qml_app.pro @@ -0,0 +1,16 @@ +TEMPLATE = aux + +app.files = \ + PropertyList.qml \ + components \ + images \ + info.json \ + SensorList.qml \ + icon.png \ + main.qml + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.sensor_explorer + INSTALLS = app +} + diff --git a/examples/sensors/sensor_explorer/sensor_explorer.pro b/examples/sensors/sensor_explorer/sensor_explorer.pro index 85ba45ef..759e9307 100644 --- a/examples/sensors/sensor_explorer/sensor_explorer.pro +++ b/examples/sensors/sensor_explorer/sensor_explorer.pro @@ -1,6 +1,5 @@ TEMPLATE = subdirs -CONFIG += ordered SUBDIRS = \ import \ - qml.pro + qml_app diff --git a/examples/sensors/sensor_explorer/settings.json b/examples/sensors/sensor_explorer/settings.json deleted file mode 100644 index a7db3876..00000000 --- a/examples/sensors/sensor_explorer/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "1.0.0", - "identifier": "com.nokia.mt.sensorexplorer", - "label": "QML Sensor Explorer demo", - "settings": [ - ] -} diff --git a/examples/sensors/sensorgestures/sensorgestures.pro b/examples/sensors/sensorgestures/sensorgestures.pro index 82306a9e..295db944 100644 --- a/examples/sensors/sensorgestures/sensorgestures.pro +++ b/examples/sensors/sensorgestures/sensorgestures.pro @@ -1,13 +1,6 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2011-08-10T11:04:07 -# -#------------------------------------------------- - -QT += core gui sensors widgets - -TARGET = gesture TEMPLATE = app +TARGET = gesture +QT += core gui sensors widgets SOURCES += main.cpp\ mainwindow.cpp @@ -16,6 +9,5 @@ HEADERS += mainwindow.h FORMS += mainwindow.ui - OTHER_FILES += \ gesture.png diff --git a/examples/sensors/sensors.pro b/examples/sensors/sensors.pro index 8f1d41b1..807203f2 100644 --- a/examples/sensors/sensors.pro +++ b/examples/sensors/sensors.pro @@ -2,13 +2,15 @@ TEMPLATE = subdirs SUBDIRS += \ accel \ + accelbubble \ + cubehouse \ grue \ - qmlsensorgestures \ - sensor_explorer \ maze \ qmlqtsensors \ + qmlsensorgestures \ + sensor_explorer \ shakeit -!isEmpty(QT.widgets.name): SUBDIRS += \ +!isEmpty(QT.widgets.name):SUBDIRS += \ sensorgestures diff --git a/examples/sensors/shakeit/audio/loopy2a_mono.wav b/examples/sensors/shakeit/audio/loopy2a_mono.wav old mode 100755 new mode 100644 diff --git a/examples/sensors/shakeit/notions.json b/examples/sensors/shakeit/notions.json deleted file mode 100644 index 95d05191..00000000 --- a/examples/sensors/shakeit/notions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "notion-file-version": 1, - "capabilities": [ - ] -} diff --git a/examples/sensors/shakeit/qml.pro b/examples/sensors/shakeit/qml.pro deleted file mode 100644 index 30348d1a..00000000 --- a/examples/sensors/shakeit/qml.pro +++ /dev/null @@ -1,17 +0,0 @@ -TEMPLATE = aux - -app.files = \ - info.json \ - notions.json \ - settings.json \ - shakeit.qml \ - icon.png \ - audio \ - images - -!isEmpty(EXAMPLES_PREFIX) { - TARGET_DIR = $$EXAMPLES_PREFIX/com.nokia.mt.shakeit - app.path = $$TARGET_DIR - INSTALLS = app -} - diff --git a/examples/sensors/shakeit/settings.json b/examples/sensors/shakeit/settings.json deleted file mode 100644 index 31fc2fb3..00000000 --- a/examples/sensors/shakeit/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "1.0.0", - "identifier": "com.nokia.mt.shakeit", - "label": "ShakeIt demonstrates the Qt5 QtSensor Gestures API", - "settings": [ - ] -} diff --git a/examples/sensors/shakeit/shakeit.pro b/examples/sensors/shakeit/shakeit.pro index 6dc685b9..65660e3e 100644 --- a/examples/sensors/shakeit/shakeit.pro +++ b/examples/sensors/shakeit/shakeit.pro @@ -1,3 +1,14 @@ -TEMPLATE = subdirs +TEMPLATE = aux + +app.files = \ + info.json \ + shakeit.qml \ + icon.png \ + audio \ + images + +!isEmpty(EXAMPLES_PREFIX) { + app.path = $$EXAMPLES_PREFIX/com.nokia.mt.shakeit + INSTALLS = app +} -SUBDIRS = qml.pro -- cgit v1.2.3