diff options
Diffstat (limited to 'examples/sensors/qmlsensorgestures/plugin')
6 files changed, 0 insertions, 410 deletions
diff --git a/examples/sensors/qmlsensorgestures/plugin/CMakeLists.txt b/examples/sensors/qmlsensorgestures/plugin/CMakeLists.txt deleted file mode 100644 index 10bd98d6..00000000 --- a/examples/sensors/qmlsensorgestures/plugin/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(qtsensorgestures_counterplugin LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}") - -find_package(Qt6 COMPONENTS Core Gui Sensors) - -qt_add_plugin(qtsensorgestures_counterplugin) - -target_sources(qtsensorgestures_counterplugin PRIVATE - qcountergestureplugin.cpp qcountergestureplugin.h - qcounterrecognizer.cpp qcounterrecognizer.h -) - -set_target_properties(qtsensorgestures_counterplugin PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) - -target_link_libraries(qtsensorgestures_counterplugin PUBLIC - Qt::Core - Qt::Gui - Qt::Sensors -) - -install(TARGETS qtsensorgestures_counterplugin - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/sensors/qmlsensorgestures/plugin/plugin.pro b/examples/sensors/qmlsensorgestures/plugin/plugin.pro deleted file mode 100644 index bb519c8d..00000000 --- a/examples/sensors/qmlsensorgestures/plugin/plugin.pro +++ /dev/null @@ -1,30 +0,0 @@ -QT += sensors -TARGET = qtsensorgestures_counterplugin - -QTDIR_build { -# This is only for the Qt build. Do not use externally. We mean it. -PLUGIN_TYPE = sensorgestures -PLUGIN_CLASS_NAME = QCounterGesturePlugin -PLUGIN_EXTENDS = - -load(qt_plugin) -CONFIG += install_ok -} else { - -TEMPLATE = lib -CONFIG += plugin - -target.path += $$[QT_INSTALL_PLUGINS]/sensorgestures -INSTALLS += target - -} - -HEADERS += \ - qcountergestureplugin.h \ - qcounterrecognizer.h -SOURCES += \ - qcountergestureplugin.cpp \ - qcounterrecognizer.cpp - -OTHER_FILES += \ - plugin.json - diff --git a/examples/sensors/qmlsensorgestures/plugin/qcountergestureplugin.cpp b/examples/sensors/qmlsensorgestures/plugin/qcountergestureplugin.cpp deleted file mode 100644 index eeeb354f..00000000 --- a/examples/sensors/qmlsensorgestures/plugin/qcountergestureplugin.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, 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 The Qt Company Ltd 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$ -** -****************************************************************************/ - -#include <QtPlugin> -#include <QStringList> -#include <QObject> - -#include "qcountergestureplugin.h" -#include <qsensorgestureplugininterface.h> -#include <qsensorgesturemanager.h> -#include "qcounterrecognizer.h" - - -QCounterGesturePlugin::QCounterGesturePlugin() -{ -} - -QCounterGesturePlugin::~QCounterGesturePlugin() -{ -} - -QStringList QCounterGesturePlugin::supportedIds() const -{ - QStringList list; - list << "QtSensors.SecondCounter"; - return list; -} - - -QList <QSensorGestureRecognizer *> QCounterGesturePlugin::createRecognizers() -{ - QList <QSensorGestureRecognizer *> recognizers; - - QSensorGestureRecognizer *sRec = new QCounterGestureRecognizer(this); - recognizers.append(sRec); - - return recognizers; -} diff --git a/examples/sensors/qmlsensorgestures/plugin/qcountergestureplugin.h b/examples/sensors/qmlsensorgestures/plugin/qcountergestureplugin.h deleted file mode 100644 index 1b756328..00000000 --- a/examples/sensors/qmlsensorgestures/plugin/qcountergestureplugin.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, 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 The Qt Company Ltd 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$ -** -****************************************************************************/ - -#ifndef QCOUNTERGESTUREPLUGIN_H -#define QCOUNTERGESTUREPLUGIN_H - -#include <QObject> -#include <QStringList> - -#include <qsensorgestureplugininterface.h> - -class QCounterGesturePlugin : public QObject, public QSensorGesturePluginInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.QSensorGesturePluginInterface") - Q_INTERFACES(QSensorGesturePluginInterface) - -public: - explicit QCounterGesturePlugin(); - ~QCounterGesturePlugin(); - - QList<QSensorGestureRecognizer *> createRecognizers() override; - - QStringList gestureSignals() const; - QStringList supportedIds() const override; - QString name() const override { return "CounterGestures"; } -}; - -#endif // QCOUNTERGESTUREPLUGIN_H diff --git a/examples/sensors/qmlsensorgestures/plugin/qcounterrecognizer.cpp b/examples/sensors/qmlsensorgestures/plugin/qcounterrecognizer.cpp deleted file mode 100644 index 11ffbb94..00000000 --- a/examples/sensors/qmlsensorgestures/plugin/qcounterrecognizer.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, 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 The Qt Company Ltd 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$ -** -****************************************************************************/ - -#include <QDebug> -#include <QTimer> - -#include "qcounterrecognizer.h" - -QCounterGestureRecognizer::QCounterGestureRecognizer(QObject *parent) - : QSensorGestureRecognizer(parent) -{ -} - -QCounterGestureRecognizer::~QCounterGestureRecognizer() -{ - -} - -void QCounterGestureRecognizer::create() -{ - connect(&_timer,SIGNAL(timeout()),this,SLOT(timeout())); - _timer.setInterval(1000); -} - -bool QCounterGestureRecognizer::start() -{ - Q_EMIT detected(id()); - _timer.start(); - return _timer.isActive(); -} - -bool QCounterGestureRecognizer::stop() -{ - _timer.stop(); - return true; -} - - -bool QCounterGestureRecognizer::isActive() -{ - return _timer.isActive(); -} - -QString QCounterGestureRecognizer::id() const -{ - return QString("QtSensors.SecondCounter"); -} - -void QCounterGestureRecognizer::timeout() -{ - Q_EMIT detected(id()); -} diff --git a/examples/sensors/qmlsensorgestures/plugin/qcounterrecognizer.h b/examples/sensors/qmlsensorgestures/plugin/qcounterrecognizer.h deleted file mode 100644 index 4a0212ab..00000000 --- a/examples/sensors/qmlsensorgestures/plugin/qcounterrecognizer.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtSensors module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, 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 The Qt Company Ltd 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$ -** -****************************************************************************/ - -#ifndef QCOUNTERGESTURERECOGNIZER_H -#define QCOUNTERGESTURERECOGNIZER_H - -#include <QDebug> -#include <QtCore/QTimer> -#include <qsensorgesturerecognizer.h> - -class QCounterGestureRecognizer : public QSensorGestureRecognizer -{ - Q_OBJECT -public: - - QCounterGestureRecognizer(QObject *parent = 0); - ~QCounterGestureRecognizer(); - - void create() override; - - QString id() const override; - bool start() override; - bool stop() override; - bool isActive() override; - -private slots: - void timeout(); - -private: - QTimer _timer; -}; - -#endif // QCOUNTERGESTURERECOGNIZER_H |