diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-20 16:44:45 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-20 16:44:46 +0100 |
commit | fd3e100b9d3c75181454593e57508039d4ecdab5 (patch) | |
tree | 4c018ba5d578f7dd9a69a3c9be48dd5c11d43e36 | |
parent | 9e51dc1175a696eba275d9bec6fc60148a942db6 (diff) | |
parent | 400ad25d72b8b2d9a10057953a88d7d64b9bc0a9 (diff) | |
download | qtsensors-fd3e100b9d3c75181454593e57508039d4ecdab5.tar.gz |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ic6de4c970ff0cb3d5d1b8b6eff4ee020ba485d99
83 files changed, 428 insertions, 871 deletions
diff --git a/examples/sensors/sensor_explorer/PropertyList.qml b/examples/sensors/sensor_explorer/PropertyList.qml deleted file mode 100644 index 639acf1..0000000 --- a/examples/sensors/sensor_explorer/PropertyList.qml +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia Plc 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; - property alias listmodel: itemList.model - - onListmodelChanged: { - itemList.currentIndex = -1; - selectedItem = null; - } - - 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: "content/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; - } - } - } - } - } -} diff --git a/examples/sensors/sensor_explorer/SensorList.qml b/examples/sensors/sensor_explorer/SensorList.qml deleted file mode 100644 index 9152e42..0000000 --- a/examples/sensors/sensor_explorer/SensorList.qml +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia Plc 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; - property alias title: labelTitle.text - property alias listmodel: itemList.model - - onListmodelChanged: { - itemList.currentIndex = -1; - selectedItem = null; - } - - 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: "content/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; - } - } - } - } - } -} diff --git a/examples/sensors/sensor_explorer/components/ApplicationWindow.qml b/examples/sensors/sensor_explorer/components/ApplicationWindow.qml deleted file mode 100644 index 06654e4..0000000 --- a/examples/sensors/sensor_explorer/components/ApplicationWindow.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia Plc 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 7c1d498..0000000 --- a/examples/sensors/sensor_explorer/components/Button.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia Plc 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 43cf953..0000000 --- a/examples/sensors/sensor_explorer/components/TextField.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia Plc 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 Binary files differdeleted file mode 100644 index 62a00b9..0000000 --- a/examples/sensors/sensor_explorer/components/images/button_background_disabled.png +++ /dev/null diff --git a/examples/sensors/sensor_explorer/components/images/button_background_normal.png b/examples/sensors/sensor_explorer/components/images/button_background_normal.png Binary files differdeleted file mode 100644 index 1fecad5..0000000 --- a/examples/sensors/sensor_explorer/components/images/button_background_normal.png +++ /dev/null diff --git a/examples/sensors/sensor_explorer/components/images/button_background_pressed.png b/examples/sensors/sensor_explorer/components/images/button_background_pressed.png Binary files differdeleted file mode 100644 index 149529e..0000000 --- a/examples/sensors/sensor_explorer/components/images/button_background_pressed.png +++ /dev/null diff --git a/examples/sensors/sensor_explorer/components/images/textfield_background_disabled.png b/examples/sensors/sensor_explorer/components/images/textfield_background_disabled.png Binary files differdeleted file mode 100644 index 98bc601..0000000 --- a/examples/sensors/sensor_explorer/components/images/textfield_background_disabled.png +++ /dev/null diff --git a/examples/sensors/sensor_explorer/components/images/textfield_background_normal.png b/examples/sensors/sensor_explorer/components/images/textfield_background_normal.png Binary files differdeleted file mode 100644 index b90b50c..0000000 --- a/examples/sensors/sensor_explorer/components/images/textfield_background_normal.png +++ /dev/null diff --git a/examples/sensors/sensor_explorer/content/listitem_select.png b/examples/sensors/sensor_explorer/content/listitem_select.png Binary files differdeleted file mode 100644 index def234f..0000000 --- a/examples/sensors/sensor_explorer/content/listitem_select.png +++ /dev/null diff --git a/examples/sensors/sensor_explorer/doc/images/qtsensors-examples-explorer.png b/examples/sensors/sensor_explorer/doc/images/qtsensors-examples-explorer.png Binary files differnew file mode 100644 index 0000000..0976b9f --- /dev/null +++ b/examples/sensors/sensor_explorer/doc/images/qtsensors-examples-explorer.png diff --git a/examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc b/examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc index be04215..b40bf39 100644 --- a/examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc +++ b/examples/sensors/sensor_explorer/doc/src/sensor_explorer.qdoc @@ -27,30 +27,45 @@ /*! \example sensor_explorer - \title Qt Sensors - Explorer QML example + \title Qt Sensors - Explorer QML Example \ingroup qtsensors-examples + \brief Demonstrates how to read the meta-data of available sensors. - \section2 Sensor Explorer in QML - \brief The Sensor Explorer example demonstrates how to read the meta-data of available sensors. - + \image qtsensors-examples-explorer.png This example is divided into two parts: \list - \li A \l{Sensor Explorer QML Import}{C++ plug-in} that provides QML alternatives for QSensorExplorer, QPropertyInfo and the QSensorItem classes. - \li A QML Application that uses the QML alternatives to read the sensors meta-data and present it. + \li A \l{Sensor Explorer QML Import}{C++ plugin} that provides QML + alternatives for \c QSensorExplorer, \c QPropertyInfo and + \c QSensorItem C++ classes. + \li A \l{Sensor Explorer QML Application}{QML Application} that uses + the QML types to read the sensor meta-data and present it. \endlist - - This is a pure QML application that can be run from Qt Creator or directly using the - \c qmlscene binary. You should install the other C++ plug-in before trying to run - this example, otherwise it will not find its dependencies. + This example is built as an executable with C++ code that runs the QML, + but it can also be launched directly using the \c qmlscene tool. You + should build the top-level \e sensor_explorer project before trying to + run this example or it will not be able to find its dependencies. \code - qmlscene main.qml + qmlscene -I . sensor_explorer.qml \endcode - To write a QML application that will use the Explorer QML type you need to do the following steps: + Above, the -I . parameter adds the current directory as a module import + path to locate the Explorer QML module. + + \section1 Sensor Explorer QML Import + + The Sensor Explorer QML import defines the \e Explorer QML module, + exporting \c QSensorExplorer, \c QPropertyInfo and \c QSensorItem C++ + classes as QML types. The source code is available in the + \c sensor_explorer/import subdirectory. + + \section1 Sensor Explorer QML Application + + To write a QML application that will use the QML types exposed by the + Explorer module, following steps are needed: Import the Explorer 1.0 declarative plugin: @@ -60,32 +75,30 @@ \snippet sensor_explorer/sensor_explorer.qml 1 - You can retrieve a list of all available sensors using the SensorExplorer: + You can retrieve a list of all available sensors using + \c SensorExplorer.availableSensors: \snippet sensor_explorer/sensor_explorer.qml 2 - To retrieve the properties of a SensorItem use: + The example uses the returned list as a model to populate a view of + available sensors. + + To retrieve the properties of a sensor, use \c SensorItem.properties: \snippet sensor_explorer/sensor_explorer.qml 3 - Changing a property value can be done like: + The property list is used as a model for another view that displays the + property names and values. + + It is possible to edit the values of certain sensor properties. Selecting + a writable property value will open an editor. \c SensorExplorer QML + type allows you to pass a new value for a sensor property value as + follows: \snippet sensor_explorer/sensor_explorer.qml 4 - Starting and stopping a sensor can be done like: + Starting and stopping a sensor can be done by setting the + \c SensorItem.start property: \snippet sensor_explorer/sensor_explorer.qml 5 */ - -/*! - \example sensor_explorer/import - \title Sensor Explorer QML Import - - \section2 Sensor Explorer Declarative Plugin - \brief The Sensor Explorer QML import exports the QSensorExplorer, QPropertyInfo and the QSensorItem class as a QML type. - - This example creates the \e {Explorer 1.0} import. - - \sa {Qt Sensors - Explorer QML example} -*/ - diff --git a/examples/sensors/sensor_explorer/import/import.pro b/examples/sensors/sensor_explorer/import/import.pro index 85f471c..196c373 100644 --- a/examples/sensors/sensor_explorer/import/import.pro +++ b/examples/sensors/sensor_explorer/import/import.pro @@ -2,21 +2,39 @@ TEMPLATE = lib CONFIG += plugin TARGET = $$qtLibraryTarget(declarative_explorer) -TARGETPATH = Explorer +DESTDIR = ../Explorer QT += qml sensors -SOURCES = main.cpp explorer.cpp sensoritem.cpp propertyinfo.cpp -HEADERS = explorer.h sensoritem.h propertyinfo.h +SOURCES = \ + main.cpp \ + explorer.cpp \ + sensoritem.cpp \ + propertyinfo.cpp -DESTPATH=$$[QT_INSTALL_EXAMPLES]/qtsensors/sensor_explorer/Explorer +HEADERS = \ + explorer.h \ + sensoritem.h \ + propertyinfo.h -target.path=$$DESTPATH -INSTALLS += target +DESTPATH=$$[QT_INSTALL_EXAMPLES]/sensors/sensor_explorer/Explorer +target.path=$$DESTPATH qmldir.files=$$PWD/qmldir qmldir.path=$$DESTPATH -INSTALLS += qmldir +INSTALLS += target qmldir OTHER_FILES += \ plugin.json qmldir + +copyfile = $$PWD/qmldir +copydest = $$DESTDIR + +# On Windows, use backslashes as directory separators +win32: { + copyfile ~= s,/,\\,g + copydest ~= s,/,\\,g +} + +# Copy the qmldir file to the same folder as the plugin binary +QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$copyfile) $$quote($$copydest) $$escape_expand(\\n\\t) diff --git a/examples/sensors/sensor_explorer/import/main.cpp b/examples/sensors/sensor_explorer/import/main.cpp index f040fa1..36025e0 100644 --- a/examples/sensors/sensor_explorer/import/main.cpp +++ b/examples/sensors/sensor_explorer/import/main.cpp @@ -52,9 +52,8 @@ class SensorExplorerDeclarativeModule : public QQmlExtensionPlugin public: virtual void registerTypes(const char *uri) { - qDebug() << "SensorExplorerDeclarativeModule::registerTypes(const char *uri)"; - Q_ASSERT(QLatin1String(uri) == QLatin1String("Explorer")); + // @uri Explorer qmlRegisterType<QSensorExplorer>(uri, 1, 0, "SensorExplorer"); qmlRegisterType<QSensorItem>(uri, 1, 0, "SensorItem"); qmlRegisterType<QPropertyInfo>(uri, 1, 0, "PropertyInfo"); diff --git a/examples/sensors/sensor_explorer/main.cpp b/examples/sensors/sensor_explorer/main.cpp index 34f5ba3..066f559 100644 --- a/examples/sensors/sensor_explorer/main.cpp +++ b/examples/sensors/sensor_explorer/main.cpp @@ -38,5 +38,27 @@ ** ****************************************************************************/ -#include "../stub.h" -SENSORS_EXAMPLE_MAIN(sensor_explorer) +#include <QtQml> +#include <QtQuick/QQuickWindow> + +#ifndef QT_NO_WIDGETS +#include <QtWidgets/QApplication> +#define Application QApplication +#else +#include <QtGui/QGuiApplication> +#define Application QGuiApplication +#endif + +int main(int argc, char *argv[]) +{ + Application app(argc, argv); + QQmlApplicationEngine engine(QUrl("qrc:///sensor_explorer.qml")); + QObject *topLevel = engine.rootObjects().value(0); + QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel); + if (!window) { + qWarning("Error: Your root item has to be a Window."); + return -1; + } + window->show(); + return app.exec(); +} diff --git a/examples/sensors/sensor_explorer/qml.pro b/examples/sensors/sensor_explorer/qml.pro index e9fe0bf..e018830 100644 --- a/examples/sensors/sensor_explorer/qml.pro +++ b/examples/sensors/sensor_explorer/qml.pro @@ -1,16 +1,18 @@ TEMPLATE = app TARGET = sensor_explorer -QT += quick +QT += qml quick + +qtHaveModule(widgets) { + QT += widgets +} SOURCES = main.cpp app.files = \ - $$files(*.qml) \ - icon.png \ - components \ - content + sensor_explorer.qml \ + icon.png -target.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/sensor_explorer -app.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/sensor_explorer +target.path = $$[QT_INSTALL_EXAMPLES]/sensors/sensor_explorer +app.path = $$[QT_INSTALL_EXAMPLES]/sensors/sensor_explorer INSTALLS += target app RESOURCES += \ diff --git a/examples/sensors/sensor_explorer/qml.qrc b/examples/sensors/sensor_explorer/qml.qrc index 3f11f3e..df6160a 100644 --- a/examples/sensors/sensor_explorer/qml.qrc +++ b/examples/sensors/sensor_explorer/qml.qrc @@ -1,16 +1,5 @@ <RCC> <qresource prefix="/"> - <file>PropertyList.qml</file> - <file>SensorList.qml</file> <file>sensor_explorer.qml</file> - <file>components/ApplicationWindow.qml</file> - <file>components/TextField.qml</file> - <file>components/Button.qml</file> - <file>components/images/button_background_disabled.png</file> - <file>components/images/textfield_background_normal.png</file> - <file>components/images/textfield_background_disabled.png</file> - <file>components/images/button_background_pressed.png</file> - <file>components/images/button_background_normal.png</file> - <file>content/listitem_select.png</file> </qresource> </RCC> diff --git a/examples/sensors/sensor_explorer/sensor_explorer.qml b/examples/sensors/sensor_explorer/sensor_explorer.qml index d396d98..d7f8b8e 100644 --- a/examples/sensors/sensor_explorer/sensor_explorer.qml +++ b/examples/sensors/sensor_explorer/sensor_explorer.qml @@ -38,159 +38,177 @@ ** ****************************************************************************/ -//Import the declarative plugins -import QtQuick 2.0 -import "components" +import QtQuick 2.1 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.0 //! [0] import Explorer 1.0 //! [0] -ApplicationWindow { - id: mainWnd +Window { + id: window + width: 320 + height: 480 + minimumWidth: 320 + minimumHeight: 480 -//! [1] + //! [1] SensorExplorer { id: explorer } -//! [1] - - SensorList { - id: sensorList - anchors.top: parent.top - anchors.topMargin: 0 - 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] - } - } + //! [1] + + Column { + anchors.fill: parent + anchors.margins: 8 + spacing: 8 + + GroupBox { + title: qsTr("Available Sensors") + width: parent.width + height: window.height * 0.4 + + TableView { + id: sensorList + anchors.fill: parent + //! [2] + model: explorer.availableSensors + //! [2] + + TableViewColumn { role: "id"; title: qsTr("ID"); width: sensorList.width * 0.7 } + TableViewColumn { role: "start"; title: qsTr("Running"); width: sensorList.width * 0.3 - 5 } + + onClicked: { + explorer.selectedSensorItem = explorer.availableSensors[row] + //! [3] + propertyList.model = explorer.selectedSensorItem.properties + //! [3] + button.update() + } + } - 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" - } + Button { + id: button + anchors.margins: 4 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: sensorList.bottom + text: qsTr("Start") + enabled: explorer.selectedSensorItem !== null + + function update() { + text = (explorer.selectedSensorItem !== null ? + (explorer.selectedSensorItem.start === true ? + qsTr("Stop") : qsTr("Start")) : qsTr("Start")) + } + + onClicked: { + if (explorer.selectedSensorItem !== null) { + //! [5] + if (text === "Start") { + explorer.selectedSensorItem.start = true; + text = "Stop"; + } + else { + explorer.selectedSensorItem.start = false; + text = "Start"; + } + //! [5] + } + } + } - 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" - } + GroupBox { + title: qsTr("Properties") + width: parent.width + height: window.height * 0.55 + enabled: explorer.selectedSensorItem != null - 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] - } + TableView { + id: propertyList + property PropertyInfo selectedItem: null - textfield.text = ""; - } - } + anchors.fill: parent + TableViewColumn { role: "name"; title: qsTr("Name"); width: propertyList.width * 0.5 } + TableViewColumn { role: "value"; title: qsTr("Value"); width: propertyList.width * 0.5 - 5 } - 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 = ""; - } - } + onClicked: { + selectedItem = model[row] + } - 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; - } - } + itemDelegate: { + if (selectedItem && selectedItem.isWriteable) + return editableDelegate; + return readOnlyDelegate; + } - onAccepted: { + Component { + id: readOnlyDelegate + Item { + Text { + width: parent.width + anchors.margins: 4 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + elide: styleData.elideMode + text: styleData.value + color: propertyList.model[styleData.row].isWriteable ? + styleData.textColor : Qt.lighter(styleData.textColor) + } + } + } - if (explorer.selectedSensorItem !== null - && propertyList.selectedItem !== null) { -//! [4] - explorer.selectedSensorItem.changePropertyValue(propertyList.selectedItem, textfield.text); -//! [4] - propertyList.focus=true; + Component { + id: editableDelegate + Item { + Text { + width: parent.width + anchors.margins: 4 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + elide: styleData.elideMode + text: styleData.value + color: styleData.textColor + visible: !styleData.selected || styleData.column === 0 + } + Loader { // Initialize text editor lazily to improve performance + id: loaderEditor + anchors.margins: 4 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + Connections { + target: loaderEditor.item + onAccepted: { + //! [4] + explorer.selectedSensorItem.changePropertyValue(propertyList.selectedItem, loaderEditor.item.text); + //! [4] + } + } + + // Load the editor for selected 'Value' cell + sourceComponent: (styleData.selected && styleData.column === 1) ? editor : null + + Component { + id: editor + TextInput { + id: textinput + color: styleData.textColor + text: styleData.value + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + onClicked: textinput.forceActiveFocus() + } + } + } + } + } + } } - textfield.text = ""; } } } - diff --git a/src/plugins/sensorgestures/qtsensors/qcoversensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qcoversensorgesturerecognizer.h index 8df8e65..5df98cc 100644 --- a/src/plugins/sensorgestures/qtsensors/qcoversensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qcoversensorgesturerecognizer.h @@ -57,12 +57,12 @@ public: explicit QCoverSensorGestureRecognizer(QObject *parent = 0); ~QCoverSensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void cover(); diff --git a/src/plugins/sensorgestures/qtsensors/qdoubletapsensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qdoubletapsensorgesturerecognizer.h index a4e74cc..e1e660b 100644 --- a/src/plugins/sensorgestures/qtsensors/qdoubletapsensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qdoubletapsensorgesturerecognizer.h @@ -58,11 +58,12 @@ public: explicit QDoubleTapSensorGestureRecognizer(QObject *parent = 0); ~QDoubleTapSensorGestureRecognizer(); - void create(); - QString id() const; - bool start(); - bool stop(); - bool isActive(); + void create() Q_DECL_OVERRIDE; + + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void doubletap(); diff --git a/src/plugins/sensorgestures/qtsensors/qfreefallsensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qfreefallsensorgesturerecognizer.h index 094d0c6..9f72582 100644 --- a/src/plugins/sensorgestures/qtsensors/qfreefallsensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qfreefallsensorgesturerecognizer.h @@ -57,12 +57,12 @@ public: explicit QFreefallSensorGestureRecognizer(QObject *parent = 0); ~QFreefallSensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void freefall(); diff --git a/src/plugins/sensorgestures/qtsensors/qhoversensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qhoversensorgesturerecognizer.h index cb9d81a..d8dc009 100644 --- a/src/plugins/sensorgestures/qtsensors/qhoversensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qhoversensorgesturerecognizer.h @@ -57,11 +57,12 @@ public: explicit QHoverSensorGestureRecognizer(QObject *parent = 0); ~QHoverSensorGestureRecognizer(); - void create(); - QString id() const; - bool start(); - bool stop(); - bool isActive(); + void create() Q_DECL_OVERRIDE; + + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void hover(); diff --git a/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.h index 2fd249f..37f6605 100644 --- a/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.h @@ -55,12 +55,12 @@ public: explicit QPickupSensorGestureRecognizer(QObject *parent = 0); ~QPickupSensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void pickup(); diff --git a/src/plugins/sensorgestures/qtsensors/qshake2recognizer.h b/src/plugins/sensorgestures/qtsensors/qshake2recognizer.h index 232d2ad..647b713 100644 --- a/src/plugins/sensorgestures/qtsensors/qshake2recognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qshake2recognizer.h @@ -73,12 +73,12 @@ public: QShake2SensorGestureRecognizer(QObject *parent = 0); ~QShake2SensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; int timerTimeout; diff --git a/src/plugins/sensorgestures/qtsensors/qslamgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qslamgesturerecognizer.h index 4945033..5dba87a 100644 --- a/src/plugins/sensorgestures/qtsensors/qslamgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qslamgesturerecognizer.h @@ -56,12 +56,12 @@ public: explicit QSlamSensorGestureRecognizer(QObject *parent = 0); ~QSlamSensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void slam(); diff --git a/src/plugins/sensorgestures/qtsensors/qtsensorgestureplugin.h b/src/plugins/sensorgestures/qtsensors/qtsensorgestureplugin.h index 848a4f0..34455ac 100644 --- a/src/plugins/sensorgestures/qtsensors/qtsensorgestureplugin.h +++ b/src/plugins/sensorgestures/qtsensors/qtsensorgestureplugin.h @@ -58,11 +58,11 @@ class QtSensorGesturePlugin : public QObject, public QSensorGesturePluginInterfa public: explicit QtSensorGesturePlugin(); ~QtSensorGesturePlugin(); - QList <QSensorGestureRecognizer *> createRecognizers(); + QList <QSensorGestureRecognizer *> createRecognizers() Q_DECL_OVERRIDE; QStringList gestureSignals() const; - QStringList supportedIds() const; - QString name() const { return "QtSensorGestures"; } + QStringList supportedIds() const Q_DECL_OVERRIDE; + QString name() const Q_DECL_OVERRIDE { return "QtSensorGestures"; } }; diff --git a/src/plugins/sensorgestures/qtsensors/qturnoversensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qturnoversensorgesturerecognizer.h index 3319ac5..1729f3e 100644 --- a/src/plugins/sensorgestures/qtsensors/qturnoversensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qturnoversensorgesturerecognizer.h @@ -53,11 +53,13 @@ class QTurnoverSensorGestureRecognizer : public QSensorGestureRecognizer public: explicit QTurnoverSensorGestureRecognizer(QObject *parent = 0); ~QTurnoverSensorGestureRecognizer(); - void create(); - QString id() const; - bool start(); - bool stop(); - bool isActive(); + + void create() Q_DECL_OVERRIDE; + + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void turnover(); diff --git a/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.h index a4b9ceb..5db192a 100644 --- a/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.h @@ -63,12 +63,12 @@ public: explicit QTwistSensorGestureRecognizer(QObject *parent = 0); ~QTwistSensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void twistLeft(); diff --git a/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.h b/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.h index e3ad7a0..a8aef52 100644 --- a/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.h +++ b/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.h @@ -56,12 +56,12 @@ public: explicit QWhipSensorGestureRecognizer(QObject *parent = 0); ~QWhipSensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; Q_SIGNALS: void whip(); diff --git a/src/plugins/sensorgestures/shake/qshakerecognizer.h b/src/plugins/sensorgestures/shake/qshakerecognizer.h index f34a377..e7478b6 100644 --- a/src/plugins/sensorgestures/shake/qshakerecognizer.h +++ b/src/plugins/sensorgestures/shake/qshakerecognizer.h @@ -66,12 +66,12 @@ public: QShakeSensorGestureRecognizer(QObject *parent = 0); ~QShakeSensorGestureRecognizer(); - void create(); + void create() Q_DECL_OVERRIDE; - QString id() const; - bool start(); - bool stop(); - bool isActive(); + QString id() const Q_DECL_OVERRIDE; + bool start() Q_DECL_OVERRIDE; + bool stop() Q_DECL_OVERRIDE; + bool isActive() Q_DECL_OVERRIDE; QTimer *timer; int timerTimeout; diff --git a/src/plugins/sensorgestures/shake/qshakesensorgestureplugin.h b/src/plugins/sensorgestures/shake/qshakesensorgestureplugin.h index ea69dd0..939b2a9 100644 --- a/src/plugins/sensorgestures/shake/qshakesensorgestureplugin.h +++ b/src/plugins/sensorgestures/shake/qshakesensorgestureplugin.h @@ -57,11 +57,11 @@ public: explicit QShakeSensorGesturePlugin(); ~QShakeSensorGesturePlugin(); - QList <QSensorGestureRecognizer *> createRecognizers(); + QList <QSensorGestureRecognizer *> createRecognizers() Q_DECL_OVERRIDE; QStringList gestureSignals() const; - QStringList supportedIds() const; - QString name() const { return "ShakeGestures"; } + QStringList supportedIds() const Q_DECL_OVERRIDE; + QString name() const Q_DECL_OVERRIDE { return "ShakeGestures"; } }; #endif // QSHAKESENSORGESTUREPLUGIN_H diff --git a/src/plugins/sensors/android/src/androidaccelerometer.h b/src/plugins/sensors/android/src/androidaccelerometer.h index 6c95fdb..3136301 100644 --- a/src/plugins/sensors/android/src/androidaccelerometer.h +++ b/src/plugins/sensors/android/src/androidaccelerometer.h @@ -51,8 +51,8 @@ public: AndroidAccelerometer(AndroidSensors::AndroidSensorType type, QSensor *sensor); private: - virtual void onAccuracyChanged(jint accuracy); - virtual void onSensorChanged(jlong timestamp, const jfloat *values, uint size); + void onAccuracyChanged(jint accuracy) Q_DECL_OVERRIDE; + void onSensorChanged(jlong timestamp, const jfloat *values, uint size) Q_DECL_OVERRIDE; }; diff --git a/src/plugins/sensors/android/src/androidcommonsensor.h b/src/plugins/sensors/android/src/androidcommonsensor.h index 40f118e..396f410 100644 --- a/src/plugins/sensors/android/src/androidcommonsensor.h +++ b/src/plugins/sensors/android/src/androidcommonsensor.h @@ -63,13 +63,13 @@ public: if (m_isStarted) stop(); } - virtual void start() + void start() Q_DECL_OVERRIDE { if (AndroidSensors::registerListener(m_type, this, sensor()->dataRate())) m_isStarted = true; } - virtual void stop() + void stop() Q_DECL_OVERRIDE { if (m_isStarted) { m_isStarted = false; diff --git a/src/plugins/sensors/android/src/androidgyroscope.h b/src/plugins/sensors/android/src/androidgyroscope.h index 3b633b7..15e1ebb 100644 --- a/src/plugins/sensors/android/src/androidgyroscope.h +++ b/src/plugins/sensors/android/src/androidgyroscope.h @@ -50,8 +50,8 @@ class AndroidGyroscope : public AndroidCommonSensor<QGyroscopeReading> public: AndroidGyroscope(AndroidSensors::AndroidSensorType type, QSensor *sensor); private: - virtual void onAccuracyChanged(jint accuracy); - virtual void onSensorChanged(jlong timestamp, const jfloat *values, uint size); + void onAccuracyChanged(jint accuracy) Q_DECL_OVERRIDE; + void onSensorChanged(jlong timestamp, const jfloat *values, uint size) Q_DECL_OVERRIDE; }; #endif // ANDROIDGYROSCOPE_H diff --git a/src/plugins/sensors/android/src/androidlight.h b/src/plugins/sensors/android/src/androidlight.h index fdea3ed..5cf4428 100644 --- a/src/plugins/sensors/android/src/androidlight.h +++ b/src/plugins/sensors/android/src/androidlight.h @@ -50,8 +50,8 @@ class AndroidLight : public AndroidCommonSensor<QLightReading> public: AndroidLight(AndroidSensors::AndroidSensorType type, QSensor *sensor); private: - virtual void onAccuracyChanged(jint accuracy); - virtual void onSensorChanged(jlong timestamp, const jfloat *values, uint size); + void onAccuracyChanged(jint accuracy) Q_DECL_OVERRIDE; + void onSensorChanged(jlong timestamp, const jfloat *values, uint size) Q_DECL_OVERRIDE; }; #endif // ANDROIDLIGHT_H diff --git a/src/plugins/sensors/android/src/androidmagnetometer.h b/src/plugins/sensors/android/src/androidmagnetometer.h index 57d9f36..3f1a59c 100644 --- a/src/plugins/sensors/android/src/androidmagnetometer.h +++ b/src/plugins/sensors/android/src/androidmagnetometer.h @@ -50,8 +50,8 @@ class AndroidMagnetometer : public AndroidCommonSensor<QMagnetometerReading> public: AndroidMagnetometer(AndroidSensors::AndroidSensorType type, QSensor *sensor); private: - virtual void onAccuracyChanged(jint accuracy); - virtual void onSensorChanged(jlong timestamp, const jfloat *values, uint size); + void onAccuracyChanged(jint accuracy) Q_DECL_OVERRIDE; + void onSensorChanged(jlong timestamp, const jfloat *values, uint size) Q_DECL_OVERRIDE; }; #endif // ANDROIDMAGNETOMETER_H diff --git a/src/plugins/sensors/android/src/androidproximity.h b/src/plugins/sensors/android/src/androidproximity.h index 1911798..b036d89 100644 --- a/src/plugins/sensors/android/src/androidproximity.h +++ b/src/plugins/sensors/android/src/androidproximity.h @@ -51,8 +51,8 @@ class AndroidProximity : public AndroidCommonSensor<QProximityReading> public: AndroidProximity(AndroidSensors::AndroidSensorType type, QSensor *sensor); private: - virtual void onAccuracyChanged(jint accuracy); - virtual void onSensorChanged(jlong timestamp, const jfloat *values, uint size); + void onAccuracyChanged(jint accuracy) Q_DECL_OVERRIDE; + void onSensorChanged(jlong timestamp, const jfloat *values, uint size) Q_DECL_OVERRIDE; qreal m_maximumRange; }; diff --git a/src/plugins/sensors/android/src/androidrotation.h b/src/plugins/sensors/android/src/androidrotation.h index cd2c4d6..63a8e0f 100644 --- a/src/plugins/sensors/android/src/androidrotation.h +++ b/src/plugins/sensors/android/src/androidrotation.h @@ -49,8 +49,8 @@ class AndroidRotation : public AndroidCommonSensor<QRotationReading> public: AndroidRotation(AndroidSensors::AndroidSensorType type, QSensor *sensor); private: - virtual void onAccuracyChanged(jint accuracy); - virtual void onSensorChanged(jlong timestamp, const jfloat *values, uint size); + void onAccuracyChanged(jint accuracy) Q_DECL_OVERRIDE; + void onSensorChanged(jlong timestamp, const jfloat *values, uint size) Q_DECL_OVERRIDE; }; #endif // ANDROIDROTATION_H diff --git a/src/plugins/sensors/android/src/androidtemperature.h b/src/plugins/sensors/android/src/androidtemperature.h index 667169c..6725093 100644 --- a/src/plugins/sensors/android/src/androidtemperature.h +++ b/src/plugins/sensors/android/src/androidtemperature.h @@ -51,8 +51,8 @@ class AndroidTemperature : public AndroidCommonSensor<QAmbientTemperatureReading public: AndroidTemperature(AndroidSensors::AndroidSensorType type, QSensor *sensor); private: - virtual void onAccuracyChanged(jint accuracy); - virtual void onSensorChanged(jlong timestamp, const jfloat *values, uint size); + void onAccuracyChanged(jint accuracy) Q_DECL_OVERRIDE; + void onSensorChanged(jlong timestamp, const jfloat *values, uint size) Q_DECL_OVERRIDE; }; #endif // ANDROIDTEMPERATURE_H diff --git a/src/plugins/sensors/dummy/dummyaccelerometer.h b/src/plugins/sensors/dummy/dummyaccelerometer.h index a469e39..ae48dd0 100644 --- a/src/plugins/sensors/dummy/dummyaccelerometer.h +++ b/src/plugins/sensors/dummy/dummyaccelerometer.h @@ -52,7 +52,7 @@ public: dummyaccelerometer(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QAccelerometerReading m_reading; }; diff --git a/src/plugins/sensors/dummy/dummycommon.h b/src/plugins/sensors/dummy/dummycommon.h index a17bd9d..5816e89 100644 --- a/src/plugins/sensors/dummy/dummycommon.h +++ b/src/plugins/sensors/dummy/dummycommon.h @@ -50,10 +50,10 @@ class dummycommon : public QSensorBackend public: dummycommon(QSensor *sensor); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; virtual void poll() = 0; - void timerEvent(QTimerEvent * /*event*/); + void timerEvent(QTimerEvent * /*event*/) Q_DECL_OVERRIDE; protected: quint64 getTimestamp(); diff --git a/src/plugins/sensors/dummy/dummylightsensor.h b/src/plugins/sensors/dummy/dummylightsensor.h index edd95a3..7279ea2 100644 --- a/src/plugins/sensors/dummy/dummylightsensor.h +++ b/src/plugins/sensors/dummy/dummylightsensor.h @@ -52,7 +52,7 @@ public: dummylightsensor(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QAmbientLightReading m_reading; }; diff --git a/src/plugins/sensors/generic/genericalssensor.h b/src/plugins/sensors/generic/genericalssensor.h index 9665745..1ed6e76 100644 --- a/src/plugins/sensors/generic/genericalssensor.h +++ b/src/plugins/sensors/generic/genericalssensor.h @@ -53,10 +53,10 @@ public: genericalssensor(QSensor *sensor); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; - bool filter(QLightReading *reading); + bool filter(QLightReading *reading) Q_DECL_OVERRIDE; private: QAmbientLightReading m_reading; diff --git a/src/plugins/sensors/generic/genericorientationsensor.h b/src/plugins/sensors/generic/genericorientationsensor.h index c212c1b..d1e7d34 100644 --- a/src/plugins/sensors/generic/genericorientationsensor.h +++ b/src/plugins/sensors/generic/genericorientationsensor.h @@ -53,10 +53,10 @@ public: genericorientationsensor(QSensor *sensor); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; - bool filter(QAccelerometerReading *reading); + bool filter(QAccelerometerReading *reading) Q_DECL_OVERRIDE; private: QOrientationReading m_reading; diff --git a/src/plugins/sensors/generic/genericrotationsensor.h b/src/plugins/sensors/generic/genericrotationsensor.h index ffa48ea..693528f 100644 --- a/src/plugins/sensors/generic/genericrotationsensor.h +++ b/src/plugins/sensors/generic/genericrotationsensor.h @@ -54,10 +54,10 @@ public: genericrotationsensor(QSensor *sensor); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; private: QRotationReading m_reading; diff --git a/src/plugins/sensors/generic/generictiltsensor.h b/src/plugins/sensors/generic/generictiltsensor.h index 0f84ca6..f62c1f5 100644 --- a/src/plugins/sensors/generic/generictiltsensor.h +++ b/src/plugins/sensors/generic/generictiltsensor.h @@ -56,12 +56,12 @@ public: GenericTiltSensor(QSensor *sensor); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; void calibrate(); - bool filter(QAccelerometerReading *reading); + bool filter(QAccelerometerReading *reading) Q_DECL_OVERRIDE; bool isFeatureSupported(QSensor::Feature feature) const Q_DECL_OVERRIDE; diff --git a/src/plugins/sensors/ios/iosaccelerometer.h b/src/plugins/sensors/ios/iosaccelerometer.h index 1a6560b..ba6235f 100644 --- a/src/plugins/sensors/ios/iosaccelerometer.h +++ b/src/plugins/sensors/ios/iosaccelerometer.h @@ -55,10 +55,10 @@ public: static char const * const id; explicit IOSAccelerometer(QSensor *sensor); - void timerEvent(QTimerEvent *); + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; private: CMMotionManager *m_motionManager; diff --git a/src/plugins/sensors/ios/ioscompass.h b/src/plugins/sensors/ios/ioscompass.h index c33cf1f..849da9f 100644 --- a/src/plugins/sensors/ios/ioscompass.h +++ b/src/plugins/sensors/ios/ioscompass.h @@ -57,8 +57,8 @@ public: explicit IOSCompass(QSensor *sensor); ~IOSCompass(); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; void headingChanged(qreal heading, quint64 timestamp, qreal calibrationLevel); diff --git a/src/plugins/sensors/ios/iosgyroscope.h b/src/plugins/sensors/ios/iosgyroscope.h index 4f4c399..31f89e3 100644 --- a/src/plugins/sensors/ios/iosgyroscope.h +++ b/src/plugins/sensors/ios/iosgyroscope.h @@ -55,10 +55,10 @@ public: static char const * const id; explicit IOSGyroscope(QSensor *sensor); - void timerEvent(QTimerEvent *); + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; private: CMMotionManager *m_motionManager; diff --git a/src/plugins/sensors/ios/iosmagnetometer.h b/src/plugins/sensors/ios/iosmagnetometer.h index b0dc848..7f95faf 100644 --- a/src/plugins/sensors/ios/iosmagnetometer.h +++ b/src/plugins/sensors/ios/iosmagnetometer.h @@ -55,10 +55,10 @@ public: static char const * const id; explicit IOSMagnetometer(QSensor *sensor); - void timerEvent(QTimerEvent *); + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; void startMagnetometer(); void startDeviceMotion(); diff --git a/src/plugins/sensors/ios/iosproximitysensor.h b/src/plugins/sensors/ios/iosproximitysensor.h index 6788512..52da8d2 100644 --- a/src/plugins/sensors/ios/iosproximitysensor.h +++ b/src/plugins/sensors/ios/iosproximitysensor.h @@ -57,8 +57,8 @@ public: explicit IOSProximitySensor(QSensor *sensor); ~IOSProximitySensor(); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; void proximityChanged(bool close); static bool available(); diff --git a/src/plugins/sensors/linux/linuxsysaccelerometer.h b/src/plugins/sensors/linux/linuxsysaccelerometer.h index 8ffc28f..76dfe3b 100644 --- a/src/plugins/sensors/linux/linuxsysaccelerometer.h +++ b/src/plugins/sensors/linux/linuxsysaccelerometer.h @@ -55,10 +55,10 @@ public: LinuxSysAccelerometer(QSensor *sensor); ~LinuxSysAccelerometer(); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; void poll(); - void timerEvent(QTimerEvent * /*event*/); + void timerEvent(QTimerEvent * /*event*/) Q_DECL_OVERRIDE; private: QAccelerometerReading m_reading; diff --git a/src/plugins/sensors/sensorfw/sensorfwaccelerometer.h b/src/plugins/sensors/sensorfw/sensorfwaccelerometer.h index 25ef144..e0e84cc 100644 --- a/src/plugins/sensors/sensorfw/sensorfwaccelerometer.h +++ b/src/plugins/sensors/sensorfw/sensorfwaccelerometer.h @@ -57,10 +57,10 @@ public: static char const * const id; sensorfwaccelerometer(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual qreal correctionFactor() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + qreal correctionFactor() const Q_DECL_OVERRIDE; + virtual void init(); private: QAccelerometerReading m_reading; diff --git a/src/plugins/sensors/sensorfw/sensorfwals.h b/src/plugins/sensors/sensorfw/sensorfwals.h index f0b91a9..b3325f0 100644 --- a/src/plugins/sensors/sensorfw/sensorfwals.h +++ b/src/plugins/sensors/sensorfw/sensorfwals.h @@ -57,10 +57,10 @@ public: static char const * const id; Sensorfwals(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual void start(); - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + void start() Q_DECL_OVERRIDE; + virtual void init(); private: QAmbientLightReading m_reading; diff --git a/src/plugins/sensors/sensorfw/sensorfwcompass.h b/src/plugins/sensors/sensorfw/sensorfwcompass.h index 1bb7e6e..951435c 100644 --- a/src/plugins/sensors/sensorfw/sensorfwcompass.h +++ b/src/plugins/sensors/sensorfw/sensorfwcompass.h @@ -57,9 +57,9 @@ public: static char const * const id; SensorfwCompass(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + virtual void init(); private: QCompassReading m_reading; bool m_initDone; diff --git a/src/plugins/sensors/sensorfw/sensorfwgyroscope.h b/src/plugins/sensors/sensorfw/sensorfwgyroscope.h index 30b9579..f489bf6 100644 --- a/src/plugins/sensors/sensorfw/sensorfwgyroscope.h +++ b/src/plugins/sensors/sensorfw/sensorfwgyroscope.h @@ -59,10 +59,10 @@ public: static char const * const id; SensorfwGyroscope(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual qreal correctionFactor() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + qreal correctionFactor() const Q_DECL_OVERRIDE; + virtual void init(); private: QGyroscopeReading m_reading; diff --git a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.h b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.h index fce0234..642570d 100644 --- a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.h +++ b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.h @@ -56,9 +56,9 @@ public: SensorfwIrProximitySensor(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + virtual void init(); private: QIRProximityReading m_reading; bool m_initDone; diff --git a/src/plugins/sensors/sensorfw/sensorfwlightsensor.h b/src/plugins/sensors/sensorfw/sensorfwlightsensor.h index f9394c3..244f795 100644 --- a/src/plugins/sensors/sensorfw/sensorfwlightsensor.h +++ b/src/plugins/sensors/sensorfw/sensorfwlightsensor.h @@ -57,9 +57,9 @@ public: static char const * const id; SensorfwLightSensor(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + virtual void init(); private: QLightReading m_reading; bool m_initDone; diff --git a/src/plugins/sensors/sensorfw/sensorfwmagnetometer.h b/src/plugins/sensors/sensorfw/sensorfwmagnetometer.h index d86bd04..162fa06 100644 --- a/src/plugins/sensors/sensorfw/sensorfwmagnetometer.h +++ b/src/plugins/sensors/sensorfw/sensorfwmagnetometer.h @@ -58,11 +58,11 @@ public: static char const * const id; SensorfwMagnetometer(QSensor *sensor); protected: - virtual bool doConnect(); - virtual void start(); - virtual QString sensorName() const; - virtual qreal correctionFactor() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + void start() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + qreal correctionFactor() const Q_DECL_OVERRIDE; + virtual void init(); private: static const float NANO; diff --git a/src/plugins/sensors/sensorfw/sensorfworientationsensor.h b/src/plugins/sensors/sensorfw/sensorfworientationsensor.h index 139761a..9e55ff3 100644 --- a/src/plugins/sensors/sensorfw/sensorfworientationsensor.h +++ b/src/plugins/sensors/sensorfw/sensorfworientationsensor.h @@ -57,10 +57,10 @@ public: static char const * const id; SensorfwOrientationSensor(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual void start(); - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + void start() Q_DECL_OVERRIDE; + virtual void init(); private: QOrientationReading m_reading; static QOrientationReading::Orientation getOrientation(int orientation); diff --git a/src/plugins/sensors/sensorfw/sensorfwproximitysensor.h b/src/plugins/sensors/sensorfw/sensorfwproximitysensor.h index 6558447..caaa9b9 100644 --- a/src/plugins/sensors/sensorfw/sensorfwproximitysensor.h +++ b/src/plugins/sensors/sensorfw/sensorfwproximitysensor.h @@ -57,10 +57,10 @@ public: static char const * const id; SensorfwProximitySensor(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual void start(); - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + void start() Q_DECL_OVERRIDE; + virtual void init(); private: QProximityReading m_reading; diff --git a/src/plugins/sensors/sensorfw/sensorfwrotationsensor.h b/src/plugins/sensors/sensorfw/sensorfwrotationsensor.h index 1f237cf..dd41520 100644 --- a/src/plugins/sensors/sensorfw/sensorfwrotationsensor.h +++ b/src/plugins/sensors/sensorfw/sensorfwrotationsensor.h @@ -59,9 +59,9 @@ public: static char const * const id; SensorfwRotationSensor(QSensor *sensor); protected: - virtual bool doConnect(); - virtual QString sensorName() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + virtual void init(); private: QRotationReading m_reading; bool m_initDone; diff --git a/src/plugins/sensors/sensorfw/sensorfwsensorbase.h b/src/plugins/sensors/sensorfw/sensorfwsensorbase.h index 2fc8238..769a8cb 100644 --- a/src/plugins/sensors/sensorfw/sensorfwsensorbase.h +++ b/src/plugins/sensors/sensorfw/sensorfwsensorbase.h @@ -62,8 +62,8 @@ public: protected: virtual bool doConnect()=0; - virtual void start(); - virtual void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; static const float GRAVITY_EARTH; static const float GRAVITY_EARTH_THOUSANDTH; //for speed diff --git a/src/plugins/sensors/sensorfw/sensorfwtapsensor.h b/src/plugins/sensors/sensorfw/sensorfwtapsensor.h index c829876..4373385 100644 --- a/src/plugins/sensors/sensorfw/sensorfwtapsensor.h +++ b/src/plugins/sensors/sensorfw/sensorfwtapsensor.h @@ -57,10 +57,10 @@ public: static char const * const id; SensorfwTapSensor(QSensor *sensor); protected: - virtual bool doConnect(); - virtual void start(); - virtual QString sensorName() const; - virtual void init() Q_DECL_OVERRIDE; + bool doConnect() Q_DECL_OVERRIDE; + void start() Q_DECL_OVERRIDE; + QString sensorName() const Q_DECL_OVERRIDE; + virtual void init(); private: QTapReading m_reading; bool m_initDone; diff --git a/src/plugins/sensors/simulator/simulatoraccelerometer.h b/src/plugins/sensors/simulator/simulatoraccelerometer.h index 2658e9b..00aacb8 100644 --- a/src/plugins/sensors/simulator/simulatoraccelerometer.h +++ b/src/plugins/sensors/simulator/simulatoraccelerometer.h @@ -52,7 +52,7 @@ public: SimulatorAccelerometer(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QAccelerometerReading m_reading; }; diff --git a/src/plugins/sensors/simulator/simulatorambientlightsensor.h b/src/plugins/sensors/simulator/simulatorambientlightsensor.h index 3f4dca4..6154fdc 100644 --- a/src/plugins/sensors/simulator/simulatorambientlightsensor.h +++ b/src/plugins/sensors/simulator/simulatorambientlightsensor.h @@ -52,7 +52,7 @@ public: SimulatorAmbientLightSensor(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QAmbientLightReading m_reading; }; diff --git a/src/plugins/sensors/simulator/simulatorcommon.h b/src/plugins/sensors/simulator/simulatorcommon.h index 96ef69a..a1c1399 100644 --- a/src/plugins/sensors/simulator/simulatorcommon.h +++ b/src/plugins/sensors/simulator/simulatorcommon.h @@ -94,10 +94,10 @@ class SimulatorCommon : public QSensorBackend public: SimulatorCommon(QSensor *sensor); - void start(); - void stop(); + void start() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; virtual void poll() = 0; - void timerEvent(QTimerEvent * /*event*/); + void timerEvent(QTimerEvent * /*event*/) Q_DECL_OVERRIDE; private: int m_timerid; diff --git a/src/plugins/sensors/simulator/simulatorcompass.h b/src/plugins/sensors/simulator/simulatorcompass.h index 9dfea0c..d10ce98 100644 --- a/src/plugins/sensors/simulator/simulatorcompass.h +++ b/src/plugins/sensors/simulator/simulatorcompass.h @@ -52,7 +52,7 @@ public: SimulatorCompass(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QCompassReading m_reading; }; diff --git a/src/plugins/sensors/simulator/simulatorirproximitysensor.h b/src/plugins/sensors/simulator/simulatorirproximitysensor.h index 25af146..c810747 100644 --- a/src/plugins/sensors/simulator/simulatorirproximitysensor.h +++ b/src/plugins/sensors/simulator/simulatorirproximitysensor.h @@ -52,7 +52,7 @@ public: SimulatorIRProximitySensor(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QIRProximityReading m_reading; }; diff --git a/src/plugins/sensors/simulator/simulatorlightsensor.h b/src/plugins/sensors/simulator/simulatorlightsensor.h index e9cd359..68a5095 100644 --- a/src/plugins/sensors/simulator/simulatorlightsensor.h +++ b/src/plugins/sensors/simulator/simulatorlightsensor.h @@ -52,7 +52,7 @@ public: SimulatorLightSensor(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QLightReading m_reading; }; diff --git a/src/plugins/sensors/simulator/simulatormagnetometer.h b/src/plugins/sensors/simulator/simulatormagnetometer.h index d1188ed..9d8c3fb 100644 --- a/src/plugins/sensors/simulator/simulatormagnetometer.h +++ b/src/plugins/sensors/simulator/simulatormagnetometer.h @@ -52,7 +52,7 @@ public: SimulatorMagnetometer(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QMagnetometerReading m_reading; }; diff --git a/src/plugins/sensors/simulator/simulatorproximitysensor.h b/src/plugins/sensors/simulator/simulatorproximitysensor.h index a06e64d..d7a9e74 100644 --- a/src/plugins/sensors/simulator/simulatorproximitysensor.h +++ b/src/plugins/sensors/simulator/simulatorproximitysensor.h @@ -52,7 +52,7 @@ public: SimulatorProximitySensor(QSensor *sensor); - void poll(); + void poll() Q_DECL_OVERRIDE; private: QProximityReading m_reading; }; diff --git a/src/sensors/qcompass.h b/src/sensors/qcompass.h index 75b6869..5351062 100644 --- a/src/sensors/qcompass.h +++ b/src/sensors/qcompass.h @@ -67,7 +67,7 @@ class Q_SENSORS_EXPORT QCompassFilter : public QSensorFilter public: virtual bool filter(QCompassReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class Q_SENSORS_EXPORT QCompass : public QSensor diff --git a/src/sensors/qgyroscope.h b/src/sensors/qgyroscope.h index 31ed23b..95d751b 100644 --- a/src/sensors/qgyroscope.h +++ b/src/sensors/qgyroscope.h @@ -71,7 +71,7 @@ class Q_SENSORS_EXPORT QGyroscopeFilter : public QSensorFilter public: virtual bool filter(QGyroscopeReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class Q_SENSORS_EXPORT QGyroscope : public QSensor diff --git a/src/sensors/qirproximitysensor.h b/src/sensors/qirproximitysensor.h index c4ecba4..04ad191 100644 --- a/src/sensors/qirproximitysensor.h +++ b/src/sensors/qirproximitysensor.h @@ -63,7 +63,7 @@ class Q_SENSORS_EXPORT QIRProximityFilter : public QSensorFilter public: virtual bool filter(QIRProximityReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class Q_SENSORS_EXPORT QIRProximitySensor : public QSensor diff --git a/src/sensors/qlightsensor.h b/src/sensors/qlightsensor.h index 26240b4..f54b986 100644 --- a/src/sensors/qlightsensor.h +++ b/src/sensors/qlightsensor.h @@ -63,7 +63,7 @@ class Q_SENSORS_EXPORT QLightFilter : public QSensorFilter public: virtual bool filter(QLightReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class QLightSensorPrivate; diff --git a/src/sensors/qmagnetometer.h b/src/sensors/qmagnetometer.h index 9d754fc..6af8bfa 100644 --- a/src/sensors/qmagnetometer.h +++ b/src/sensors/qmagnetometer.h @@ -75,7 +75,7 @@ class Q_SENSORS_EXPORT QMagnetometerFilter : public QSensorFilter public: virtual bool filter(QMagnetometerReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class QMagnetometerPrivate; diff --git a/src/sensors/qorientationsensor.h b/src/sensors/qorientationsensor.h index a6fccb8..dccf6ca 100644 --- a/src/sensors/qorientationsensor.h +++ b/src/sensors/qorientationsensor.h @@ -74,7 +74,7 @@ class Q_SENSORS_EXPORT QOrientationFilter : public QSensorFilter public: virtual bool filter(QOrientationReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class Q_SENSORS_EXPORT QOrientationSensor : public QSensor diff --git a/src/sensors/qproximitysensor.h b/src/sensors/qproximitysensor.h index 162334f..1b974a7 100644 --- a/src/sensors/qproximitysensor.h +++ b/src/sensors/qproximitysensor.h @@ -63,7 +63,7 @@ class Q_SENSORS_EXPORT QProximityFilter : public QSensorFilter public: virtual bool filter(QProximityReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class Q_SENSORS_EXPORT QProximitySensor : public QSensor diff --git a/src/sensors/qrotationsensor.h b/src/sensors/qrotationsensor.h index e7d0e2e..e1fd94e 100644 --- a/src/sensors/qrotationsensor.h +++ b/src/sensors/qrotationsensor.h @@ -68,7 +68,7 @@ class Q_SENSORS_EXPORT QRotationFilter : public QSensorFilter public: virtual bool filter(QRotationReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class QRotationSensorPrivate; diff --git a/src/sensors/qtapsensor.h b/src/sensors/qtapsensor.h index 688781e..5170eeb 100644 --- a/src/sensors/qtapsensor.h +++ b/src/sensors/qtapsensor.h @@ -84,7 +84,7 @@ class Q_SENSORS_EXPORT QTapFilter : public QSensorFilter public: virtual bool filter(QTapReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class QTapSensorPrivate; diff --git a/src/sensors/qtiltsensor.h b/src/sensors/qtiltsensor.h index 4d7e4c7..64b7fff 100644 --- a/src/sensors/qtiltsensor.h +++ b/src/sensors/qtiltsensor.h @@ -69,7 +69,7 @@ class Q_SENSORS_EXPORT QTiltFilter : public QSensorFilter public: virtual bool filter(QTiltReading *reading) = 0; private: - bool filter(QSensorReading *reading); + bool filter(QSensorReading *reading) Q_DECL_OVERRIDE; }; class Q_SENSORS_EXPORT QTiltSensor : public QSensor |