From a355c3a54cdc1c8bfd2129307c7824dd7012bd11 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Jul 2012 19:08:42 +0200 Subject: use centralized qml plugin project handling Change-Id: I6afbc938a3db79f3a27b2b83d72e111e5d03ea9c Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- src/imports/sensors2/plugin.qmltypes | 83 -------------------------------- src/imports/sensors2/plugins.qmltypes | 83 ++++++++++++++++++++++++++++++++ src/imports/sensors2/qmldir | 2 +- src/imports/sensors2/qsensors2import.pri | 31 ------------ src/imports/sensors2/sensors2.pro | 18 ++----- 5 files changed, 87 insertions(+), 130 deletions(-) delete mode 100644 src/imports/sensors2/plugin.qmltypes create mode 100644 src/imports/sensors2/plugins.qmltypes delete mode 100644 src/imports/sensors2/qsensors2import.pri (limited to 'src/imports/sensors2') diff --git a/src/imports/sensors2/plugin.qmltypes b/src/imports/sensors2/plugin.qmltypes deleted file mode 100644 index 590bf263..00000000 --- a/src/imports/sensors2/plugin.qmltypes +++ /dev/null @@ -1,83 +0,0 @@ -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/plugins.qmltypes b/src/imports/sensors2/plugins.qmltypes new file mode 100644 index 00000000..590bf263 --- /dev/null +++ b/src/imports/sensors2/plugins.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 81220bb4..d2a2be1f 100644 --- a/src/imports/sensors2/qmldir +++ b/src/imports/sensors2/qmldir @@ -1,2 +1,2 @@ plugin declarative_qtsensors5 -typeinfo plugin.qmltypes +typeinfo plugins.qmltypes diff --git a/src/imports/sensors2/qsensors2import.pri b/src/imports/sensors2/qsensors2import.pri deleted file mode 100644 index f8be980b..00000000 --- a/src/imports/sensors2/qsensors2import.pri +++ /dev/null @@ -1,31 +0,0 @@ -load(qt_module) - -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!") -} - -QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir -copy2build.input = QMLDIRFILE -copy2build.output = $$QT.sensors.imports/$$TARGETPATH/qmldir -!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS -copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} -copy2build.name = COPY ${QMAKE_FILE_IN} -copy2build.CONFIG += no_link -# `clean' should leave the build in a runnable state, which means it shouldn't delete qmldir -copy2build.CONFIG += no_clean -QMAKE_EXTRA_COMPILERS += copy2build - -TARGET = $$qtLibraryTarget($$TARGET) -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols - -load(qt_targets) - -wince*:LIBS += $$QMAKE_LIBS_GUI diff --git a/src/imports/sensors2/sensors2.pro b/src/imports/sensors2/sensors2.pro index fb6be47e..be5060e1 100644 --- a/src/imports/sensors2/sensors2.pro +++ b/src/imports/sensors2/sensors2.pro @@ -1,10 +1,5 @@ +CXX_MODULE = sensors 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) QT += qml sensors @@ -21,14 +16,7 @@ HEADERS += qsensor2ambientlight.h \ qsensor2gesture.h \ qsensor2common.h -DESTDIR = $$QT.sensors.imports/$$TARGETPATH -target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH - -qmldir.files += $$PWD/qmldir $$PWD/plugin.qmltypes -qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH - -INSTALLS += target qmldir +load(qml_plugin) OTHER_FILES += \ - plugin.json qmldir plugin.qmltypes - + plugin.json -- cgit v1.2.3