summaryrefslogtreecommitdiffstats
path: root/src/input/frontend
diff options
context:
space:
mode:
authorColin Ogilvie <colin.ogilvie@kdab.com>2016-01-11 12:14:44 +0000
committerSean Harmer <sean.harmer@kdab.com>2016-01-12 18:38:12 +0000
commitda80f3ffc733e19968b582699d4e4657ce7601fc (patch)
tree016771d37e5c77e19c246ddcaabc178c0f1ae131 /src/input/frontend
parente97d8c471fe6bff4764cc903f074284466ae058e (diff)
Start at implementing QAbstractAction Input
Change-Id: I392dd326cb0bf1b8c12b72d8554a866156d43e76 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input/frontend')
-rw-r--r--src/input/frontend/frontend.pri6
-rw-r--r--src/input/frontend/qabstractactioninput.cpp54
-rw-r--r--src/input/frontend/qabstractactioninput.h60
-rw-r--r--src/input/frontend/qaction.cpp14
-rw-r--r--src/input/frontend/qaction.h8
-rw-r--r--src/input/frontend/qactioninput.cpp4
-rw-r--r--src/input/frontend/qactioninput.h5
7 files changed, 135 insertions, 16 deletions
diff --git a/src/input/frontend/frontend.pri b/src/input/frontend/frontend.pri
index 9d90c567f..4a6559a05 100644
--- a/src/input/frontend/frontend.pri
+++ b/src/input/frontend/frontend.pri
@@ -24,7 +24,8 @@ HEADERS += \
$$PWD/qaxissetting.h \
$$PWD/qabstractphysicaldevice_p.h \
$$PWD/qaxisactionhandler_p.h \
- $$PWD/qaxisactionhandler.h
+ $$PWD/qaxisactionhandler.h \
+ $$PWD/qabstractactioninput.h
SOURCES += \
$$PWD/qinputaspect.cpp \
@@ -44,6 +45,7 @@ SOURCES += \
$$PWD/qabstractphysicaldevice.cpp \
$$PWD/qinputdeviceintegrationfactory.cpp \
$$PWD/qaxissetting.cpp \
- $$PWD/qaxisactionhandler.cpp
+ $$PWD/qaxisactionhandler.cpp \
+ $$PWD/qabstractactioninput.cpp
INCLUDEPATH += $$PWD
diff --git a/src/input/frontend/qabstractactioninput.cpp b/src/input/frontend/qabstractactioninput.cpp
new file mode 100644
index 000000000..4933a8dda
--- /dev/null
+++ b/src/input/frontend/qabstractactioninput.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+****************************************************************************/
+
+#include "qabstractactioninput.h"
+#include <Qt3DCore/private/qnode_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DInput {
+
+QAbstractActionInput::QAbstractActionInput(Qt3DCore::QNodePrivate &dd, Qt3DCore::QNode *parent)
+ : Qt3DCore::QNode(dd, parent)
+{
+}
+
+QAbstractActionInput::~QAbstractActionInput()
+{
+}
+
+} // Qt3DInput
+
+QT_END_NAMESPACE
diff --git a/src/input/frontend/qabstractactioninput.h b/src/input/frontend/qabstractactioninput.h
new file mode 100644
index 000000000..6644820a8
--- /dev/null
+++ b/src/input/frontend/qabstractactioninput.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+****************************************************************************/
+
+#ifndef QT3DINPUT_QABSTRACTACTIONINPUT_H
+#define QT3DINPUT_QABSTRACTACTIONINPUT_H
+
+#include <Qt3DInput/qt3dinput_global.h>
+#include <Qt3DCore/qnode.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DInput {
+
+class QNodePrivate;
+
+class QT3DINPUTSHARED_EXPORT QAbstractActionInput : public Qt3DCore::QNode
+{
+ Q_OBJECT
+public:
+ explicit QAbstractActionInput(Qt3DCore::QNodePrivate &dd, Qt3DCore::QNode *parent = 0);
+ ~QAbstractActionInput();
+};
+
+} // Qt3DInput
+
+QT_END_NAMESPACE
+
+#endif // QT3DINPUT_QABSTRACTACTIONINPUT_H
diff --git a/src/input/frontend/qaction.cpp b/src/input/frontend/qaction.cpp
index e41917542..62b294357 100644
--- a/src/input/frontend/qaction.cpp
+++ b/src/input/frontend/qaction.cpp
@@ -37,7 +37,7 @@
#include "qaction.h"
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DCore/qscenepropertychange.h>
-#include <Qt3DInput/qactioninput.h>
+#include <Qt3DInput/qabstractactioninput.h>
QT_BEGIN_NAMESPACE
@@ -51,7 +51,7 @@ public:
{}
QString m_name;
- QVector<QActionInput *> m_inputs;
+ QVector<QAbstractActionInput *> m_inputs;
};
QAction::QAction(Qt3DCore::QNode *parent)
@@ -79,7 +79,7 @@ QString QAction::name() const
return d->m_name;
}
-void QAction::addInput(QActionInput *input)
+void QAction::addInput(QAbstractActionInput *input)
{
Q_D(QAction);
if (!d->m_inputs.contains(input)) {
@@ -97,7 +97,7 @@ void QAction::addInput(QActionInput *input)
}
}
-void QAction::removeInput(QActionInput *input)
+void QAction::removeInput(QAbstractActionInput *input)
{
Q_D(QAction);
if (d->m_inputs.contains(input)) {
@@ -113,7 +113,7 @@ void QAction::removeInput(QActionInput *input)
}
}
-QVector<QActionInput *> QAction::inputs() const
+QVector<QAbstractActionInput *> QAction::inputs() const
{
Q_D(const QAction);
return d->m_inputs;
@@ -124,8 +124,8 @@ void QAction::copy(const Qt3DCore::QNode *ref)
QNode::copy(ref);
const QAction *action = static_cast<const QAction *>(ref);
d_func()->m_name = action->d_func()->m_name;
- Q_FOREACH (QActionInput *input, action->inputs())
- d_func()->m_inputs.append(qobject_cast<QActionInput *>(QNode::clone(input)));
+ Q_FOREACH (QAbstractActionInput *input, action->inputs())
+ d_func()->m_inputs.append(qobject_cast<QAbstractActionInput *>(QNode::clone(input)));
}
} // Qt3DInput
diff --git a/src/input/frontend/qaction.h b/src/input/frontend/qaction.h
index 80c0a264d..0f70305bc 100644
--- a/src/input/frontend/qaction.h
+++ b/src/input/frontend/qaction.h
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DInput {
class QActionPrivate;
-class QActionInput;
+class QAbstractActionInput;
class QT3DINPUTSHARED_EXPORT QAction : public Qt3DCore::QNode
{
@@ -57,12 +57,12 @@ public:
QString name() const;
- void addInput(QActionInput *input);
- void removeInput(QActionInput *input);
- QVector<QActionInput *> inputs() const;
public Q_SLOTS:
void setName(const QString &name);
+ void addInput(QAbstractActionInput *input);
+ void removeInput(QAbstractActionInput *input);
+ QVector<QAbstractActionInput *> inputs() const;
Q_SIGNALS:
void nameChanged(const QString &name);
diff --git a/src/input/frontend/qactioninput.cpp b/src/input/frontend/qactioninput.cpp
index 252e858a4..08de69b82 100644
--- a/src/input/frontend/qactioninput.cpp
+++ b/src/input/frontend/qactioninput.cpp
@@ -36,6 +36,7 @@
#include "qactioninput.h"
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DInput/qabstractphysicaldevice.h>
+#include <Qt3DInput/QAbstractActionInput>
QT_BEGIN_NAMESPACE
@@ -54,8 +55,9 @@ public:
};
QActionInput::QActionInput(Qt3DCore::QNode *parent)
- : Qt3DCore::QNode(*new QActionInputPrivate(), parent)
+ : Qt3DInput::QAbstractActionInput(*new QActionInputPrivate(), parent)
{
+
}
QActionInput::~QActionInput()
diff --git a/src/input/frontend/qactioninput.h b/src/input/frontend/qactioninput.h
index 1b895832d..79a05540d 100644
--- a/src/input/frontend/qactioninput.h
+++ b/src/input/frontend/qactioninput.h
@@ -39,6 +39,7 @@
#include <Qt3DInput/qt3dinput_global.h>
#include <Qt3DCore/qnode.h>
+#include <Qt3DInput/qabstractactioninput.h>
QT_BEGIN_NAMESPACE
@@ -47,7 +48,7 @@ namespace Qt3DInput {
class QAbstractPhysicalDevice;
class QActionInputPrivate;
-class QT3DINPUTSHARED_EXPORT QActionInput : public Qt3DCore::QNode
+class QT3DINPUTSHARED_EXPORT QActionInput : public Qt3DInput::QAbstractActionInput
{
Q_OBJECT
Q_PROPERTY(Qt3DInput::QAbstractPhysicalDevice *sourceDevice READ sourceDevice WRITE setSourceDevice NOTIFY sourceDeviceChanged)
@@ -80,4 +81,4 @@ private:
QT_END_NAMESPACE
-#endif // QACTIONINPUT_H
+#endif // QT3DINPUT_QACTIONINPUT_H