summaryrefslogtreecommitdiffstats
path: root/src/input/frontend
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2015-12-16 10:58:36 +0100
committerKevin Ottens <kevin.ottens@kdab.com>2015-12-17 00:06:41 +0000
commit0be8ddf4012cea9e9f4b8918270f494b2c3597a3 (patch)
treeff8ecb358b49a553193b6fc8541e234a9a6d76f0 /src/input/frontend
parent6b3a1019ff6ac944415b7b90f986f9068f5ea628 (diff)
QInputDeviceIntegration can register backend types
No need to make registerBackendType() public on QInputAspect anymore, it's properly exposed to the QInputDeviceIntegration sub classes only. Change-Id: Ica44e0d37f9e6eecb099d87b0420a7b8bbc6ab59 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input/frontend')
-rw-r--r--src/input/frontend/qinputaspect.h4
-rw-r--r--src/input/frontend/qinputdeviceintegration.cpp8
-rw-r--r--src/input/frontend/qinputdeviceintegration.h14
3 files changed, 24 insertions, 2 deletions
diff --git a/src/input/frontend/qinputaspect.h b/src/input/frontend/qinputaspect.h
index d0348cc7d..7a5b298af 100644
--- a/src/input/frontend/qinputaspect.h
+++ b/src/input/frontend/qinputaspect.h
@@ -50,6 +50,7 @@ namespace Qt3DInput {
class QAbstractPhysicalDevice;
class QInputAspectPrivate;
+class QInputDeviceIntegration;
class QT3DINPUTSHARED_EXPORT QInputAspect : public Qt3DCore::QAbstractAspect
{
@@ -63,8 +64,6 @@ public:
QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) Q_DECL_OVERRIDE;
- using Qt3DCore::QAbstractAspect::registerBackendType;
-
public Q_SLOTS:
void setCamera(Qt3DCore::QCamera *camera);
@@ -75,6 +74,7 @@ private:
void loadInputDevicePlugins();
Q_DECLARE_PRIVATE(QInputAspect)
+ friend class QInputDeviceIntegration;
};
} // namespace Qt3DInput
diff --git a/src/input/frontend/qinputdeviceintegration.cpp b/src/input/frontend/qinputdeviceintegration.cpp
index b2f0989b9..412b724f9 100644
--- a/src/input/frontend/qinputdeviceintegration.cpp
+++ b/src/input/frontend/qinputdeviceintegration.cpp
@@ -37,6 +37,8 @@
#include "qinputdeviceintegration.h"
#include "qinputdeviceintegration_p.h"
+#include <Qt3DInput/QInputAspect>
+
QT_BEGIN_NAMESPACE
namespace Qt3DInput {
@@ -57,6 +59,12 @@ QInputDeviceIntegration::QInputDeviceIntegration(QInputDeviceIntegrationPrivate
{
}
+void QInputDeviceIntegration::registerBackendType(const QMetaObject &metaObject, const Qt3DCore::QBackendNodeFunctorPtr &functor)
+{
+ Q_D(QInputDeviceIntegration);
+ d->m_aspect->registerBackendType(metaObject, functor);
+}
+
void QInputDeviceIntegration::initialize(QInputAspect *aspect)
{
Q_D(QInputDeviceIntegration);
diff --git a/src/input/frontend/qinputdeviceintegration.h b/src/input/frontend/qinputdeviceintegration.h
index bf0d20e0d..5907ed867 100644
--- a/src/input/frontend/qinputdeviceintegration.h
+++ b/src/input/frontend/qinputdeviceintegration.h
@@ -46,6 +46,12 @@
QT_BEGIN_NAMESPACE
+namespace Qt3DCore {
+class QBackendNodeFunctor;
+typedef QSharedPointer<QBackendNodeFunctor> QBackendNodeFunctorPtr;
+}
+
+
namespace Qt3DInput {
class QInputAspect;
@@ -59,6 +65,14 @@ protected:
explicit QInputDeviceIntegration(QObject *parent = 0);
explicit QInputDeviceIntegration(QInputDeviceIntegrationPrivate &dd, QObject *parent = 0);
+ template<class Frontend>
+ void registerBackendType(const Qt3DCore::QBackendNodeFunctorPtr &functor)
+ {
+ registerBackendType(Frontend::staticMetaObject, functor);
+ }
+
+ void registerBackendType(const QMetaObject &metaObject, const Qt3DCore::QBackendNodeFunctorPtr &functor);
+
public:
void initialize(Qt3DInput::QInputAspect *aspect);