diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2011-10-07 16:35:46 +1000 |
---|---|---|
committer | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2011-10-10 09:25:31 +1000 |
commit | 10103b5649a8e0a0450f6de14635f0f07f52485d (patch) | |
tree | aea235cc94b15c3a2a17f327f5526451aa9fa8ab /examples | |
parent | a53bcc52d0092b523781e8e731de3e476dc4d4b0 (diff) | |
download | qtsensors-10103b5649a8e0a0450f6de14635f0f07f52485d.tar.gz |
Grue Sensor installation and device testing.
Some installation things needed to be tweaked.
Appearance on devices needed to be updated.
Change-Id: I62ab94212ff1ee8b3778f4492e60b33b29d68927
Reviewed-on: http://codereview.qt-project.org/6225
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sensors/grue/import/import.pro | 13 | ||||
-rw-r--r-- | examples/sensors/grue/lib/lib.pro | 5 | ||||
-rw-r--r-- | examples/sensors/grue/plugin/plugin.pro | 5 | ||||
-rw-r--r-- | examples/sensors/grue/qml_app/icon.png | bin | 0 -> 8145 bytes | |||
-rw-r--r-- | examples/sensors/grue/qml_app/info.json | 12 | ||||
-rw-r--r-- | examples/sensors/grue/qml_app/main.qml | 18 | ||||
-rw-r--r-- | examples/sensors/sensors.pro | 4 |
7 files changed, 43 insertions, 14 deletions
diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro index fc163b6..7a31d3e 100644 --- a/examples/sensors/grue/import/import.pro +++ b/examples/sensors/grue/import/import.pro @@ -5,10 +5,8 @@ include(qsensorsimport.pri) QT = declarative sensors -DESTDIR = $$QT.sensors.imports/$$TARGETPATH - INCLUDEPATH += $$PWD/../lib -LIBS += -L$$OUT_PWD/../lib -lgruesensor +LIBS += -L$$PWD/../lib -lgruesensor SOURCES = main.cpp @@ -17,3 +15,12 @@ symbian { TARGET.CAPABILITY = ALL -TCB } +!isEmpty(EXAMPLES_PREFIX):DESTPATH=$$EXAMPLES_PREFIX/grue/imports/Grue +else:DESTPATH=$$[QT_INSTALL_IMPORTS]/Grue + +target.path=$$DESTPATH +INSTALLS += target + +qmldir.files=$$PWD/qmldir +qmldir.path=$$DESTPATH +INSTALLS += qmldir diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro index 80bf136..1cce4da 100644 --- a/examples/sensors/grue/lib/lib.pro +++ b/examples/sensors/grue/lib/lib.pro @@ -8,10 +8,11 @@ HEADERS += gruesensor.h\ SOURCES += gruesensor.cpp\ -DESTDIR=$$QT.sensors.libs - 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 fed8460..9ff080f 100644 --- a/examples/sensors/grue/plugin/plugin.pro +++ b/examples/sensors/grue/plugin/plugin.pro @@ -6,7 +6,7 @@ PLUGIN_TYPE = sensors QT = core sensors INCLUDEPATH += $$PWD/../lib -LIBS += -L$$QT.sensors.libs -lgruesensor +LIBS += -L$$PWD/../lib -lgruesensor HEADERS += gruesensorimpl.h\ @@ -18,3 +18,6 @@ symbian { TARGET.CAPABILITY = ALL -TCB } +target.path=$$[QT_INSTALL_PLUGINS]/sensors +INSTALLS += target + diff --git a/examples/sensors/grue/qml_app/icon.png b/examples/sensors/grue/qml_app/icon.png Binary files differnew file mode 100644 index 0000000..e75e500 --- /dev/null +++ b/examples/sensors/grue/qml_app/icon.png diff --git a/examples/sensors/grue/qml_app/info.json b/examples/sensors/grue/qml_app/info.json new file mode 100644 index 0000000..6fba442 --- /dev/null +++ b/examples/sensors/grue/qml_app/info.json @@ -0,0 +1,12 @@ +{ + "info-version": "1.0", + "dict": { + "DisplayName": "Grue Sensor", + "Identifier": "6777c7a0-782e-432a-9598-322335ebd441", + "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/main.qml b/examples/sensors/grue/qml_app/main.qml index 278bf72..b50f0ca 100644 --- a/examples/sensors/grue/qml_app/main.qml +++ b/examples/sensors/grue/qml_app/main.qml @@ -39,11 +39,13 @@ ****************************************************************************/ import QtQuick 2.0 +import QtMobility.sensors 1.3 import Grue 1.0 Item { - width: 200 - height: 300 + width: 240 + height: 330 + y: 30 GrueSensor { id: sensor @@ -51,17 +53,20 @@ Item { property int lastPercent: 0 onReadingChanged: { var percent = Math.floor(reading.chanceOfBeingEaten * 100); + var thetext = ""; if (percent == 0) { - text.text = "It is light. You are safe from Grues."; + thetext = "It is light. You are safe from Grues."; } else if (lastPercent == 0) { - text.text = "It is dark. You are likely to be eaten by a Grue."; + thetext = "It is dark. You are likely to be eaten by a Grue."; } if (percent == 100) { - text.text += "You have been eaten by a Grue!"; + thetext += " You have been eaten by a Grue!"; sensor.active = false; } else if (percent) { - text.text += "Your chance of being eaten by a Grue: "+percent+" percent."; + thetext += " Your chance of being eaten by a Grue: "+percent+" percent."; } + text.font.pixelSize = 30; + text.text = "<p>" + thetext + "</p>"; lastPercent = percent; } } @@ -71,5 +76,6 @@ Item { anchors.fill: parent text: "I can't tell if you're going to be eaten by a Grue or not. You're on your own!" wrapMode: Text.WordWrap + font.pixelSize: 50 } } diff --git a/examples/sensors/sensors.pro b/examples/sensors/sensors.pro index e7ecf2c..6389a01 100644 --- a/examples/sensors/sensors.pro +++ b/examples/sensors/sensors.pro @@ -2,8 +2,8 @@ TEMPLATE = subdirs SUBDIRS += \ accel\ - cubehouse\ grue contains(QT_CONFIG,widgets):SUBDIRS += \ - sensor_explorer + sensor_explorer \ + cubehouse |