From 0be8ddf4012cea9e9f4b8918270f494b2c3597a3 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 16 Dec 2015 10:58:36 +0100 Subject: 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 --- src/input/frontend/qinputaspect.h | 4 ++-- src/input/frontend/qinputdeviceintegration.cpp | 8 ++++++++ src/input/frontend/qinputdeviceintegration.h | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src/input/frontend') 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 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 + 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 QBackendNodeFunctorPtr; +} + + namespace Qt3DInput { class QInputAspect; @@ -59,6 +65,14 @@ protected: explicit QInputDeviceIntegration(QObject *parent = 0); explicit QInputDeviceIntegration(QInputDeviceIntegrationPrivate &dd, QObject *parent = 0); + template + 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); -- cgit v1.2.3