diff options
Diffstat (limited to 'src/imports/sensors2')
-rw-r--r-- | src/imports/sensors2/plugin.qmltypes | 83 | ||||
-rw-r--r-- | src/imports/sensors2/qmldir | 1 | ||||
-rw-r--r-- | src/imports/sensors2/sensors2.pro | 8 |
3 files changed, 90 insertions, 2 deletions
diff --git a/src/imports/sensors2/plugin.qmltypes b/src/imports/sensors2/plugin.qmltypes new file mode 100644 index 00000000..590bf263 --- /dev/null +++ b/src/imports/sensors2/plugin.qmltypes @@ -0,0 +1,83 @@ +import QtQuick.tooling 1.1 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. + +Module { + Component { + name: "QSensor2AmbientLight" + prototype: "qsensor2common" + exports: ["AmbientLightSensor 5.0"] + Enum { + name: "LightLevel" + values: { + "Unknown": 0, + "Dark": 1, + "Twilight": 2, + "Light": 3, + "Bright": 4, + "Sunny": 5 + } + } + Property { name: "lightLevel"; type: "LightLevel"; isReadonly: true } + } + Component { + name: "QSensor2Gesture" + prototype: "QObject" + exports: ["SensorGesture 5.0"] + Property { name: "availableGestures"; type: "QStringList"; isReadonly: true } + Property { name: "gestures"; type: "QStringList" } + Property { name: "validGestures"; type: "QStringList"; isReadonly: true } + Property { name: "invalidGestures"; type: "QStringList"; isReadonly: true } + Property { name: "enabled"; type: "bool" } + Signal { + name: "detected" + Parameter { name: "gesture"; type: "string" } + } + } + Component { + name: "QSensor2Proximity" + prototype: "qsensor2common" + exports: ["ProximitySensor 5.0"] + Property { name: "near"; type: "bool"; isReadonly: true } + } + Component { + name: "QSensor2Tilt" + prototype: "qsensor2common" + exports: ["TiltSensor 5.0"] + Enum { + name: "Unit" + values: { + "Radians": 0, + "Degrees": 1 + } + } + Enum { + name: "Speed" + values: { + "Slow": 0, + "Medium": 1, + "Fast": 2 + } + } + Property { name: "yRotation"; type: "qreal"; isReadonly: true } + Property { name: "xRotation"; type: "qreal"; isReadonly: true } + Property { name: "unit"; type: "Unit" } + Property { name: "speed"; type: "Speed" } + Property { name: "accuracy"; type: "qreal" } + Property { name: "settings"; type: "QByteArray" } + Signal { + name: "tiltChanged" + Parameter { name: "deltaX"; type: "qreal" } + Parameter { name: "deltaY"; type: "qreal" } + } + Method { name: "calibrate" } + } + Component { + name: "qsensor2common" + prototype: "QObject" + exports: ["Sensor 5.0"] + Property { name: "enabled"; type: "bool" } + Property { name: "alwaysOn"; type: "bool" } + } +} diff --git a/src/imports/sensors2/qmldir b/src/imports/sensors2/qmldir index 14c82f3b..81220bb4 100644 --- a/src/imports/sensors2/qmldir +++ b/src/imports/sensors2/qmldir @@ -1 +1,2 @@ plugin declarative_qtsensors5 +typeinfo plugin.qmltypes diff --git a/src/imports/sensors2/sensors2.pro b/src/imports/sensors2/sensors2.pro index 91c0bc0b..6779878c 100644 --- a/src/imports/sensors2/sensors2.pro +++ b/src/imports/sensors2/sensors2.pro @@ -1,5 +1,8 @@ TARGET = declarative_qtsensors5 TARGETPATH = QtSensors +IMPORT_NAME = $$TARGETPATH +IMPORT_NAME~=s,/,.,g +IMPORT_VERSION = 5.0 # Doesn't matter, as long as it's a valid version?! include(qsensors2import.pri) @@ -21,7 +24,7 @@ HEADERS += qsensor2ambientlight.h \ DESTDIR = $$QT.sensors.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH -qmldir.files += $$PWD/qmldir +qmldir.files += $$PWD/qmldir $$PWD/plugin.qmltypes qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH INSTALLS += target qmldir @@ -40,4 +43,5 @@ symbian { } OTHER_FILES += \ - plugin.json + plugin.json qmldir plugin.qmltypes + |