diff options
author | Colin Ogilvie <colin.ogilvie@kdab.com> | 2016-01-12 15:48:03 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-01-16 15:52:34 +0000 |
commit | e218d2a65441a68f0818154552d3ddd66925b823 (patch) | |
tree | c62bb9c1c442fe9c02ae7b120b200365e141b585 /src | |
parent | 634ac2a3c1a7bae9eef6476c37cd68209c28ae4f (diff) |
Added initial parameters to input sequence and inputchord
Change-Id: Ib3128b7942c896a987b04d0e9fdddff9f295da93
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/input/frontend/qinputchord.cpp | 17 | ||||
-rw-r--r-- | src/input/frontend/qinputchord.h | 9 | ||||
-rw-r--r-- | src/input/frontend/qinputsequence.cpp | 53 | ||||
-rw-r--r-- | src/input/frontend/qinputsequence.h | 17 |
4 files changed, 96 insertions, 0 deletions
diff --git a/src/input/frontend/qinputchord.cpp b/src/input/frontend/qinputchord.cpp index c1f18414c..dea23dad1 100644 --- a/src/input/frontend/qinputchord.cpp +++ b/src/input/frontend/qinputchord.cpp @@ -47,8 +47,10 @@ class QInputChordPrivate : public Qt3DInput::QAbstractAggregateActionInputPrivat public: QInputChordPrivate() : Qt3DInput::QAbstractAggregateActionInputPrivate() + , m_tolerance(0) {} + int m_tolerance; }; QInputChord::QInputChord(Qt3DCore::QNode *parent) @@ -62,11 +64,26 @@ QInputChord::~QInputChord() QNode::cleanup(); } +int QInputChord::tolerance() const +{ + Q_D(const QInputChord); + return d->m_tolerance; +} +void QInputChord::setTolerance(int tolerance) +{ + Q_D(QInputChord); + if (d->m_tolerance != tolerance) { + d->m_tolerance = tolerance; + emit toleranceChanged(tolerance); + } +} void QInputChord::copy(const Qt3DCore::QNode *ref) { QAbstractAggregateActionInput::copy(ref); + const QInputChord *input = static_cast<const QInputChord *>(ref); + d_func()->m_tolerance = input->d_func()->m_tolerance; } } // Qt3DInput diff --git a/src/input/frontend/qinputchord.h b/src/input/frontend/qinputchord.h index ca537ba93..402b0b9fa 100644 --- a/src/input/frontend/qinputchord.h +++ b/src/input/frontend/qinputchord.h @@ -51,11 +51,20 @@ class QInputChordPrivate; class QT3DINPUTSHARED_EXPORT QInputChord : public Qt3DInput::QAbstractAggregateActionInput { Q_OBJECT + Q_PROPERTY(int tolerance READ tolerance WRITE setTolerance NOTIFY toleranceChanged) public: explicit QInputChord(Qt3DCore::QNode *parent = Q_NULLPTR); ~QInputChord(); + int tolerance() const; + +public Q_SLOTS: + void setTolerance(int tolerance); + +Q_SIGNALS: + void toleranceChanged(int tolerance); + protected: void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; diff --git a/src/input/frontend/qinputsequence.cpp b/src/input/frontend/qinputsequence.cpp index e99f9a123..0dd7723f2 100644 --- a/src/input/frontend/qinputsequence.cpp +++ b/src/input/frontend/qinputsequence.cpp @@ -48,8 +48,14 @@ class QInputSequencePrivate : public Qt3DInput::QAbstractAggregateActionInputPri public: QInputSequencePrivate() : Qt3DInput::QAbstractAggregateActionInputPrivate() + , m_timeout(0) + , m_interval(0) + , m_sequential(true) {} + int m_timeout; + int m_interval; + bool m_sequential; }; QInputSequence::QInputSequence(Qt3DCore::QNode *parent) @@ -63,11 +69,58 @@ QInputSequence::~QInputSequence() QNode::cleanup(); } +int QInputSequence::timeout() const +{ + Q_D(const QInputSequence); + return d->m_timeout; +} + +int QInputSequence::interval() const +{ + Q_D(const QInputSequence); + return d->m_interval; +} + +bool QInputSequence::sequential() const +{ + Q_D(const QInputSequence); + return d->m_sequential; +} +void QInputSequence::setTimeout(int timeout) +{ + Q_D(QInputSequence); + if (d->m_timeout != timeout) { + d->m_timeout = timeout; + emit timeoutChanged(timeout); + } +} + +void QInputSequence::setInterval(int interval) +{ + Q_D(QInputSequence); + if (d->m_interval != interval) { + d->m_interval = interval; + emit intervalChanged(interval); + } +} + +void QInputSequence::setSequential(bool sequential) +{ + Q_D(QInputSequence); + if (d->m_sequential != sequential) { + d->m_sequential = sequential; + emit sequentialChanged(sequential); + } +} void QInputSequence::copy(const Qt3DCore::QNode *ref) { QAbstractAggregateActionInput::copy(ref); + const QInputSequence *input = static_cast<const QInputSequence *>(ref); + d_func()->m_timeout = input->d_func()->m_timeout; + d_func()->m_interval = input->d_func()->m_interval; + d_func()->m_sequential = input->d_func()->m_sequential; } } // Qt3DInput diff --git a/src/input/frontend/qinputsequence.h b/src/input/frontend/qinputsequence.h index 3063c68e9..3d0101fa1 100644 --- a/src/input/frontend/qinputsequence.h +++ b/src/input/frontend/qinputsequence.h @@ -51,11 +51,28 @@ class QInputSequencePrivate; class QT3DINPUTSHARED_EXPORT QInputSequence : public Qt3DInput::QAbstractAggregateActionInput { Q_OBJECT + Q_PROPERTY(int timeout READ timeout WRITE setTimeout NOTIFY timeoutChanged) + Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged) + Q_PROPERTY(bool sequential READ sequential WRITE setSequential NOTIFY sequentialChanged) public: explicit QInputSequence(Qt3DCore::QNode *parent = Q_NULLPTR); ~QInputSequence(); + int timeout() const; + int interval() const; + bool sequential() const; + +public Q_SLOTS: + void setTimeout(int timeout); + void setInterval(int interval); + void setSequential(bool sequential); + +Q_SIGNALS: + void timeoutChanged(int timeout); + void intervalChanged(int interval); + void sequentialChanged(bool sequential); + protected: void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; |