diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2012-09-19 19:19:46 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2012-11-13 20:13:24 +0100 |
commit | 05b99e39f4c9e3249d22410d1c70eafb7b8c0170 (patch) | |
tree | 0ead578ee1113121494a710b59c4f46376d2803a /tests/auto/qsensorgestures/plugins/test/qtestrecognizer.h | |
parent | d8de6ec84d0d4d0a0a48a44590dde2797fe7cc09 (diff) |
add qml sensorgesture element backported from qtt5
also add sensorgesture auto tests. need to add a tool that creates
the moc data from real device.
Change-Id: I6d68f9e889c4c69a916d048505da7dc348c64e11
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'tests/auto/qsensorgestures/plugins/test/qtestrecognizer.h')
-rw-r--r-- | tests/auto/qsensorgestures/plugins/test/qtestrecognizer.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/auto/qsensorgestures/plugins/test/qtestrecognizer.h b/tests/auto/qsensorgestures/plugins/test/qtestrecognizer.h new file mode 100644 index 0000000000..3cc2148699 --- /dev/null +++ b/tests/auto/qsensorgestures/plugins/test/qtestrecognizer.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QTESTRECOGNIZER_H +#define QTESTRECOGNIZER_H + +#include <qsensorgesturerecognizer.h> + +class QTestRecognizer : public QSensorGestureRecognizer +{ + Q_OBJECT + Q_PROPERTY(int thresholdTime READ thresholdTime WRITE setThresholdTime) + +public: + + QTestRecognizer(QObject *parent = 0); + ~QTestRecognizer(); + + void create(); + + QString id() const; + bool start(); + bool stop(); + bool isActive(); + + int thresholdTime() const; + void setThresholdTime(int msec); + +Q_SIGNALS: + void tested(); + +private: + int timerTimeout; + QTimer *timer; + bool active; + +public slots: + void timeout(); +}; + +#endif // QTESTRECOGNIZER_H |