diff options
author | Mike Krus <mike.krus@kdab.com> | 2015-12-08 17:18:38 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2015-12-10 20:09:06 +0000 |
commit | 2ea648f08a4b935002d20abfafebf81f7b44a1ee (patch) | |
tree | f4a4f394851054d51922f49f6689f41bf33ac44f /src/input | |
parent | 5bab5d2f9023ecda899a2eb5b074e1e91cfb8045 (diff) |
Rename Q3D*Event to Q*Event and handle namespace
Q3DMouseEvent, Q3DWheelEvent, Q3DKeyEvent
Also removed unused variables and fixed some formatting
Change-Id: Ie4c531f2084875fe4d8b6ac9bafd2b3c085dead4
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/input')
26 files changed, 196 insertions, 197 deletions
diff --git a/src/input/backend/cameracontroller.cpp b/src/input/backend/cameracontroller.cpp index 072a48ef6..7001a9020 100644 --- a/src/input/backend/cameracontroller.cpp +++ b/src/input/backend/cameracontroller.cpp @@ -162,7 +162,7 @@ void CameraController::update(double dt) } } -bool CameraController::keyPressEvent( QKeyEvent* e ) +bool CameraController::keyPressEvent( QT_PREPEND_NAMESPACE(QKeyEvent*) e ) { m_translateFast = e->modifiers().testFlag(Qt::AltModifier); m_viewCenterFixed = e->modifiers().testFlag(Qt::ShiftModifier); @@ -204,7 +204,7 @@ bool CameraController::keyPressEvent( QKeyEvent* e ) return true; } -bool CameraController::keyReleaseEvent( QKeyEvent* e ) +bool CameraController::keyReleaseEvent( QT_PREPEND_NAMESPACE(QKeyEvent*) e ) { switch ( e->key() ) { @@ -230,7 +230,7 @@ bool CameraController::keyReleaseEvent( QKeyEvent* e ) return true; } -void CameraController::mousePressEvent( QMouseEvent* e ) +void CameraController::mousePressEvent( QT_PREPEND_NAMESPACE(QMouseEvent*) e ) { if ( e->button() == Qt::LeftButton ) { @@ -244,7 +244,7 @@ void CameraController::mousePressEvent( QMouseEvent* e ) } } -void CameraController::mouseReleaseEvent( QMouseEvent* e ) +void CameraController::mouseReleaseEvent( QT_PREPEND_NAMESPACE(QMouseEvent*) e ) { if ( e->button() == Qt::LeftButton ) { @@ -256,7 +256,7 @@ void CameraController::mouseReleaseEvent( QMouseEvent* e ) } } -void CameraController::mouseMoveEvent( QMouseEvent* e ) +void CameraController::mouseMoveEvent( QT_PREPEND_NAMESPACE(QMouseEvent*) e ) { if (!m_camera ) return; @@ -337,18 +337,18 @@ bool CameraController::eventFilter(QObject *receiver, QEvent *event) { switch (event->type()) { case QEvent::MouseButtonPress: - mousePressEvent(static_cast<QMouseEvent*>(event)); + mousePressEvent(static_cast<QT_PREPEND_NAMESPACE(QMouseEvent*)>(event)); return true; case QEvent::MouseButtonRelease: - mouseReleaseEvent(static_cast<QMouseEvent*>(event)); + mouseReleaseEvent(static_cast<QT_PREPEND_NAMESPACE(QMouseEvent*)>(event)); return true; case QEvent::MouseMove: - mouseMoveEvent(static_cast<QMouseEvent*>(event)); + mouseMoveEvent(static_cast<QT_PREPEND_NAMESPACE(QMouseEvent*)>(event)); return true; case QEvent::KeyPress: - return keyPressEvent(static_cast<QKeyEvent*>(event)); + return keyPressEvent(static_cast<QT_PREPEND_NAMESPACE(QKeyEvent)*>(event)); case QEvent::KeyRelease: - return keyReleaseEvent(static_cast<QKeyEvent*>(event)); + return keyReleaseEvent(static_cast<QT_PREPEND_NAMESPACE(QKeyEvent)*>(event)); default: return QObject::eventFilter(receiver, event); } diff --git a/src/input/backend/inputhandler.cpp b/src/input/backend/inputhandler.cpp index 08ae3021d..147b9dea3 100644 --- a/src/input/backend/inputhandler.cpp +++ b/src/input/backend/inputhandler.cpp @@ -80,17 +80,17 @@ void InputHandler::registerEventFilters(QEventFilterService *service) } // Called by the keyboardEventFilter in the main thread -void InputHandler::appendKeyEvent(const QKeyEvent &event) +void InputHandler::appendKeyEvent(const QT_PREPEND_NAMESPACE(QKeyEvent) &event) { QMutexLocker lock(&m_mutex); m_pendingEvents.append(event); } // Called by QInputASpect::jobsToExecute (aspectThread) -QList<QKeyEvent> InputHandler::pendingKeyEvents() +QList<QT_PREPEND_NAMESPACE(QKeyEvent)> InputHandler::pendingKeyEvents() { QMutexLocker lock(&m_mutex); - QList<QKeyEvent> pendingEvents = m_pendingEvents; + QList<QT_PREPEND_NAMESPACE(QKeyEvent)> pendingEvents = m_pendingEvents; m_pendingEvents.clear(); return pendingEvents; } @@ -102,16 +102,16 @@ void InputHandler::clearPendingKeyEvents() m_pendingEvents.clear(); } -void InputHandler::appendMouseEvent(const QMouseEvent &event) +void InputHandler::appendMouseEvent(const QT_PREPEND_NAMESPACE(QMouseEvent) &event) { QMutexLocker lock(&m_mutex); m_pendingMouseEvents.append(event); } -QList<QMouseEvent> InputHandler::pendingMouseEvents() +QList<QT_PREPEND_NAMESPACE(QMouseEvent)> InputHandler::pendingMouseEvents() { QMutexLocker lock(&m_mutex); - QList<QMouseEvent> pendingEvents = m_pendingMouseEvents; + QList<QT_PREPEND_NAMESPACE(QMouseEvent)> pendingEvents = m_pendingMouseEvents; m_pendingMouseEvents.clear(); return pendingEvents; } @@ -148,7 +148,7 @@ QVector<Qt3DCore::QAspectJobPtr> InputHandler::keyboardJobs() { // One job for Keyboard focus change event per Keyboard Controller QVector<QAspectJobPtr> jobs; - const QList<QKeyEvent> events = pendingKeyEvents(); + const QList<QT_PREPEND_NAMESPACE(QKeyEvent)> events = pendingKeyEvents(); Q_FOREACH (const HKeyboardController cHandle, m_activeKeyboardControllers) { KeyboardController *controller = m_keyboardControllerManager->data(cHandle); @@ -178,7 +178,7 @@ QVector<Qt3DCore::QAspectJobPtr> InputHandler::keyboardJobs() QVector<Qt3DCore::QAspectJobPtr> InputHandler::mouseJobs() { QVector<QAspectJobPtr> jobs; - const QList<QMouseEvent> events = pendingMouseEvents(); + const QList<QT_PREPEND_NAMESPACE(QMouseEvent)> events = pendingMouseEvents(); Q_FOREACH (const HMouseController cHandle, m_activeMouseControllers) { MouseController *controller = m_mouseControllerManager->data(cHandle); diff --git a/src/input/backend/inputhandler_p.h b/src/input/backend/inputhandler_p.h index e81116d91..e08e916e7 100644 --- a/src/input/backend/inputhandler_p.h +++ b/src/input/backend/inputhandler_p.h @@ -99,8 +99,8 @@ public: inline ActionInputManager *actionInputManager() const { return m_actionInputManager; } inline LogicalDeviceManager *logicalDeviceManager() const { return m_logicalDeviceManager; } - void appendKeyEvent(const QKeyEvent &event); - QList<QKeyEvent> pendingKeyEvents(); + void appendKeyEvent(const QT_PREPEND_NAMESPACE(QKeyEvent) &event); + QList<QT_PREPEND_NAMESPACE(QKeyEvent)> pendingKeyEvents(); void clearPendingKeyEvents(); void appendMouseEvent(const QMouseEvent &event); @@ -128,7 +128,7 @@ private: QVector<HKeyboardController> m_activeKeyboardControllers; QVector<HMouseController> m_activeMouseControllers; KeyboardEventFilter *m_keyboardEventFilter; - QList<QKeyEvent> m_pendingEvents; + QList<QT_PREPEND_NAMESPACE(QKeyEvent)> m_pendingEvents; MouseEventFilter *m_mouseEventFilter; QList<QMouseEvent> m_pendingMouseEvents; mutable QMutex m_mutex; diff --git a/src/input/backend/keyboardcontroller.cpp b/src/input/backend/keyboardcontroller.cpp index 8e1ac57df..f397f4c53 100644 --- a/src/input/backend/keyboardcontroller.cpp +++ b/src/input/backend/keyboardcontroller.cpp @@ -435,10 +435,10 @@ void KeyboardController::setButtonValue(int key, bool value) } } -void KeyboardController::updateKeyEvents(const QList<QKeyEvent> &events) +void KeyboardController::updateKeyEvents(const QList<QT_PREPEND_NAMESPACE(QKeyEvent)> &events) { - Q_FOREACH (const QKeyEvent &e, events) - setButtonValue(e.key(), e.type() == QKeyEvent::KeyPress ? true : false); + Q_FOREACH (const QT_PREPEND_NAMESPACE(QKeyEvent) &e, events) + setButtonValue(e.key(), e.type() == QT_PREPEND_NAMESPACE(QKeyEvent)::KeyPress ? true : false); } diff --git a/src/input/backend/keyboardcontroller_p.h b/src/input/backend/keyboardcontroller_p.h index 6a5946560..3c914d98f 100644 --- a/src/input/backend/keyboardcontroller_p.h +++ b/src/input/backend/keyboardcontroller_p.h @@ -79,7 +79,7 @@ public: float axisValue(int axisIdentifier) const Q_DECL_OVERRIDE; bool isButtonPressed(int buttonIdentifier) const Q_DECL_OVERRIDE; - void updateKeyEvents(const QList<QKeyEvent> &events); + void updateKeyEvents(const QList<QT_PREPEND_NAMESPACE(QKeyEvent)> &events); inline Qt3DCore::QNodeId currentFocusItem() const { return m_currentFocusItem; } inline Qt3DCore::QNodeId lastKeyboardInputRequester() const { return m_lastRequester; } diff --git a/src/input/backend/keyboardeventfilter.cpp b/src/input/backend/keyboardeventfilter.cpp index 4027c98a8..5eb8990d8 100644 --- a/src/input/backend/keyboardeventfilter.cpp +++ b/src/input/backend/keyboardeventfilter.cpp @@ -62,7 +62,7 @@ bool KeyboardEventFilter::eventFilter(QObject *obj, QEvent *e) Q_UNUSED(obj); if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) { // Store event to be processed later on in an InputAspect job - m_inputHandler->appendKeyEvent(QKeyEvent(*static_cast<QKeyEvent *>(e))); + m_inputHandler->appendKeyEvent(QT_PREPEND_NAMESPACE(QKeyEvent)(*static_cast<QT_PREPEND_NAMESPACE(QKeyEvent) *>(e))); } return false; } diff --git a/src/input/backend/keyboardinput.cpp b/src/input/backend/keyboardinput.cpp index 730142282..4e77eccb5 100644 --- a/src/input/backend/keyboardinput.cpp +++ b/src/input/backend/keyboardinput.cpp @@ -92,7 +92,7 @@ void KeyboardInput::setFocus(bool focus) } } -void KeyboardInput::keyEvent(const Q3DKeyEventPtr &event) +void KeyboardInput::keyEvent(const QKeyEventPtr &event) { QBackendScenePropertyChangePtr e(new QBackendScenePropertyChange(NodeUpdated, peerUuid())); e->setTargetNode(peerUuid()); diff --git a/src/input/backend/keyboardinput_p.h b/src/input/backend/keyboardinput_p.h index 64eb4f759..92aef0ab8 100644 --- a/src/input/backend/keyboardinput_p.h +++ b/src/input/backend/keyboardinput_p.h @@ -50,14 +50,12 @@ #include <Qt3DCore/qbackendnode.h> #include <Qt3DCore/qnodeid.h> -#include <Qt3DInput/q3dkeyevent.h> +#include <Qt3DInput/qkeyevent.h> QT_BEGIN_NAMESPACE namespace Qt3DInput { -class Q3DKeyEvent; - namespace Input { class InputHandler; @@ -70,7 +68,7 @@ public: Qt3DCore::QNodeId keyboardController() const; void setInputHandler(InputHandler *handler); void setFocus(bool focus); - void keyEvent(const Q3DKeyEventPtr &event); + void keyEvent(const QKeyEventPtr &event); inline bool isEnabled() const { return m_enabled; } diff --git a/src/input/backend/keyeventdispatcherjob.cpp b/src/input/backend/keyeventdispatcherjob.cpp index ebfddc163..16d97b464 100644 --- a/src/input/backend/keyeventdispatcherjob.cpp +++ b/src/input/backend/keyeventdispatcherjob.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE namespace Qt3DInput { namespace Input { -KeyEventDispatcherJob::KeyEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QKeyEvent> &events) +KeyEventDispatcherJob::KeyEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QT_PREPEND_NAMESPACE(QKeyEvent)> &events) : QAspectJob() , m_inputHandler(Q_NULLPTR) , m_keyboardInput(input) @@ -61,9 +61,9 @@ void KeyEventDispatcherJob::run() { KeyboardInput *input = m_inputHandler->keyboardInputManager()->lookupResource(m_keyboardInput); if (input) - Q_FOREACH (const QKeyEvent &e, m_events) { + Q_FOREACH (const QT_PREPEND_NAMESPACE(QKeyEvent) &e, m_events) { // Send events to frontend - input->keyEvent(Q3DKeyEventPtr(new Q3DKeyEvent(e))); + input->keyEvent(QKeyEventPtr(new QKeyEvent(e))); } } diff --git a/src/input/backend/keyeventdispatcherjob_p.h b/src/input/backend/keyeventdispatcherjob_p.h index 1ced85881..4ce875723 100644 --- a/src/input/backend/keyeventdispatcherjob_p.h +++ b/src/input/backend/keyeventdispatcherjob_p.h @@ -62,14 +62,14 @@ class InputHandler; class KeyEventDispatcherJob : public Qt3DCore::QAspectJob { public: - explicit KeyEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QKeyEvent> &events); + explicit KeyEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QT_PREPEND_NAMESPACE(QKeyEvent)> &events); void setInputHandler(InputHandler *handler); void run() Q_DECL_OVERRIDE; private: InputHandler *m_inputHandler; const Qt3DCore::QNodeId m_keyboardInput; - const QList<QKeyEvent> m_events; + const QList<QT_PREPEND_NAMESPACE(QKeyEvent)> m_events; }; } // namespace Input diff --git a/src/input/backend/mousecontroller.cpp b/src/input/backend/mousecontroller.cpp index 2361246f4..0dcfab6a2 100644 --- a/src/input/backend/mousecontroller.cpp +++ b/src/input/backend/mousecontroller.cpp @@ -115,10 +115,10 @@ QVector<Qt3DCore::QNodeId> MouseController::mouseInputs() const return m_mouseInputs; } -void MouseController::updateMouseEvents(const QList<QMouseEvent> &events) +void MouseController::updateMouseEvents(const QList<QT_PREPEND_NAMESPACE(QMouseEvent)> &events) { if (!events.isEmpty()) { - Q_FOREACH (const QMouseEvent &e, events) { + Q_FOREACH (const QT_PREPEND_NAMESPACE(QMouseEvent) &e, events) { m_mouseState.leftPressed = e.buttons() & (Qt::LeftButton); m_mouseState.centerPressed = e.buttons() & (Qt::MiddleButton); m_mouseState.rightPressed = e.buttons() & (Qt::RightButton); diff --git a/src/input/backend/mousecontroller_p.h b/src/input/backend/mousecontroller_p.h index 77db72a72..35ecf7da2 100644 --- a/src/input/backend/mousecontroller_p.h +++ b/src/input/backend/mousecontroller_p.h @@ -75,7 +75,7 @@ public: QVector<Qt3DCore::QNodeId> mouseInputs() const; - void updateMouseEvents(const QList<QMouseEvent> &events); + void updateMouseEvents(const QList<QT_PREPEND_NAMESPACE(QMouseEvent)> &events); protected: void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE; diff --git a/src/input/backend/mouseeventdispatcherjob.cpp b/src/input/backend/mouseeventdispatcherjob.cpp index 2fe4ffb14..2c2fc1eec 100644 --- a/src/input/backend/mouseeventdispatcherjob.cpp +++ b/src/input/backend/mouseeventdispatcherjob.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE namespace Qt3DInput { namespace Input { -MouseEventDispatcherJob::MouseEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QMouseEvent> &events) +MouseEventDispatcherJob::MouseEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QT_PREPEND_NAMESPACE(QMouseEvent)> &events) : QAspectJob() , m_inputHandler(Q_NULLPTR) , m_mouseInput(input) @@ -61,9 +61,9 @@ void MouseEventDispatcherJob::run() { MouseInput *input = m_inputHandler->mouseInputManager()->lookupResource(m_mouseInput); if (input) { - Q_FOREACH (const QMouseEvent &e, m_events) { + Q_FOREACH (const QT_PREPEND_NAMESPACE(QMouseEvent) &e, m_events) { // Send events to frontend - input->mouseEvent(Q3DMouseEventPtr(new Q3DMouseEvent(e))); + input->mouseEvent(QMouseEventPtr(new QMouseEvent(e))); } } } diff --git a/src/input/backend/mouseeventdispatcherjob_p.h b/src/input/backend/mouseeventdispatcherjob_p.h index eb37dbc4d..576a6d2e7 100644 --- a/src/input/backend/mouseeventdispatcherjob_p.h +++ b/src/input/backend/mouseeventdispatcherjob_p.h @@ -62,14 +62,14 @@ class InputHandler; class MouseEventDispatcherJob : public Qt3DCore::QAspectJob { public: - explicit MouseEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QMouseEvent> &events); + explicit MouseEventDispatcherJob(const Qt3DCore::QNodeId &input, const QList<QT_PREPEND_NAMESPACE(QMouseEvent)> &events); void setInputHandler(InputHandler *handler); void run() Q_DECL_FINAL; private: InputHandler *m_inputHandler; const Qt3DCore::QNodeId m_mouseInput; - const QList<QMouseEvent> m_events; + const QList<QT_PREPEND_NAMESPACE(QMouseEvent)> m_events; }; } // namespace Input diff --git a/src/input/backend/mouseinput.cpp b/src/input/backend/mouseinput.cpp index 158e32d19..518519602 100644 --- a/src/input/backend/mouseinput.cpp +++ b/src/input/backend/mouseinput.cpp @@ -80,7 +80,7 @@ void MouseInput::setInputHandler(InputHandler *handler) m_inputHandler = handler; } -void MouseInput::mouseEvent(const Q3DMouseEventPtr &event) +void MouseInput::mouseEvent(const QMouseEventPtr &event) { QBackendScenePropertyChangePtr e(new QBackendScenePropertyChange(NodeUpdated, peerUuid())); e->setTargetNode(peerUuid()); @@ -89,7 +89,7 @@ void MouseInput::mouseEvent(const Q3DMouseEventPtr &event) notifyObservers(e); } -void MouseInput::wheelEvent(const Q3DWheelEventPtr &event) +void MouseInput::wheelEvent(const QWheelEventPtr &event) { QBackendScenePropertyChangePtr e(new QBackendScenePropertyChange(NodeUpdated, peerUuid())); e->setTargetNode(peerUuid()); diff --git a/src/input/backend/mouseinput_p.h b/src/input/backend/mouseinput_p.h index c1e4c02ac..cd03234f5 100644 --- a/src/input/backend/mouseinput_p.h +++ b/src/input/backend/mouseinput_p.h @@ -49,7 +49,7 @@ // #include <Qt3DCore/qbackendnode.h> -#include <Qt3DInput/q3dmouseevent.h> +#include <Qt3DInput/qmouseevent.h> QT_BEGIN_NAMESPACE @@ -67,8 +67,8 @@ public: void updateFromPeer(Qt3DCore::QNode *peer) Q_DECL_OVERRIDE; Qt3DCore::QNodeId mouseController() const; void setInputHandler(InputHandler *handler); - void mouseEvent(const Q3DMouseEventPtr &event); - void wheelEvent(const Q3DWheelEventPtr &event); + void mouseEvent(const QMouseEventPtr &event); + void wheelEvent(const QWheelEventPtr &event); inline bool isEnabled() const { return m_enabled; } diff --git a/src/input/frontend/frontend.pri b/src/input/frontend/frontend.pri index ee06b732b..bc28d3d6e 100644 --- a/src/input/frontend/frontend.pri +++ b/src/input/frontend/frontend.pri @@ -5,12 +5,12 @@ HEADERS += \ $$PWD/qkeyboardinput.h \ $$PWD/qkeyboardinput_p.h \ $$PWD/qinputaspect_p.h \ - $$PWD/q3dkeyevent.h \ + $$PWD/qkeyevent.h \ $$PWD/qmousecontroller.h \ $$PWD/qmouseinput.h \ $$PWD/qmouseinput_p.h \ $$PWD/qmousecontroller_p.h \ - $$PWD/q3dmouseevent.h \ + $$PWD/qmouseevent.h \ $$PWD/qinputdeviceplugin.h \ $$PWD/qactioninput.h \ $$PWD/qaction.h \ @@ -29,10 +29,10 @@ SOURCES += \ $$PWD/qinputaspect.cpp \ $$PWD/qkeyboardcontroller.cpp \ $$PWD/qkeyboardinput.cpp \ - $$PWD/q3dkeyevent.cpp \ + $$PWD/qkeyevent.cpp \ $$PWD/qmouseinput.cpp \ $$PWD/qmousecontroller.cpp \ - $$PWD/q3dmouseevent.cpp \ + $$PWD/qmouseevent.cpp \ $$PWD/qinputdeviceplugin.cpp \ $$PWD/qactioninput.cpp \ $$PWD/qaction.cpp \ diff --git a/src/input/frontend/qaction.cpp b/src/input/frontend/qaction.cpp index dcb26e8c5..e41917542 100644 --- a/src/input/frontend/qaction.cpp +++ b/src/input/frontend/qaction.cpp @@ -110,7 +110,8 @@ void QAction::removeInput(QActionInput *input) } d->m_inputs.removeOne(input); - }} + } +} QVector<QActionInput *> QAction::inputs() const { diff --git a/src/input/frontend/qkeyboardinput.cpp b/src/input/frontend/qkeyboardinput.cpp index 1d055410c..4f22ef41c 100644 --- a/src/input/frontend/qkeyboardinput.cpp +++ b/src/input/frontend/qkeyboardinput.cpp @@ -163,26 +163,26 @@ void QKeyboardInput::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) setFocus(e->value().toBool()); blockNotifications(block); } else if (e->propertyName() == QByteArrayLiteral("event")) { - Q3DKeyEventPtr ev = e->value().value<Q3DKeyEventPtr>(); + QKeyEventPtr ev = e->value().value<QKeyEventPtr>(); keyEvent(ev.data()); } } } -void QKeyboardInput::keyEvent(Q3DKeyEvent *event) +void QKeyboardInput::keyEvent(QKeyEvent *event) { if (event->type() == QEvent::KeyPress) { emit pressed(event); QByteArray keySignal = keyToSignal(event->key()); if (!keySignal.isEmpty()) { - keySignal += "(Qt3DInput::Q3DKeyEvent*)"; + keySignal += "(Qt3DInput::QKeyEvent*)"; // TO DO: Finding if the signal is connected to anything before doing the invocation // could be an improvement // That's what QQ2 does but since it accesses QML private classes to do so, that may not be // applicable in our case int idx = QKeyboardInput::staticMetaObject.indexOfSignal(keySignal); - metaObject()->method(idx).invoke(this, Qt::DirectConnection, Q_ARG(Q3DKeyEvent *, event)); + metaObject()->method(idx).invoke(this, Qt::DirectConnection, Q_ARG(QKeyEvent *, event)); } } else if (event->type() == QEvent::KeyRelease) { emit released(event); diff --git a/src/input/frontend/qkeyboardinput.h b/src/input/frontend/qkeyboardinput.h index 49e6af087..b7bc1a97d 100644 --- a/src/input/frontend/qkeyboardinput.h +++ b/src/input/frontend/qkeyboardinput.h @@ -38,7 +38,7 @@ #define QT3DINPUT_INPUT_QKEYBOARDINPUT_H #include <Qt3DInput/qt3dinput_global.h> -#include <Qt3DInput/q3dkeyevent.h> +#include <Qt3DInput/qkeyevent.h> #include <Qt3DCore/qcomponent.h> QT_BEGIN_NAMESPACE @@ -68,55 +68,55 @@ Q_SIGNALS: void controllerChanged(QKeyboardController *controller); void focusChanged(bool focus); - void digit0Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit1Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit2Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit3Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit4Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit5Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit6Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit7Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit8Pressed(Qt3DInput::Q3DKeyEvent *event); - void digit9Pressed(Qt3DInput::Q3DKeyEvent *event); - - void leftPressed(Qt3DInput::Q3DKeyEvent *event); - void rightPressed(Qt3DInput::Q3DKeyEvent *event); - void upPressed(Qt3DInput::Q3DKeyEvent *event); - void downPressed(Qt3DInput::Q3DKeyEvent *event); - void tabPressed(Qt3DInput::Q3DKeyEvent *event); - void backtabPressed(Qt3DInput::Q3DKeyEvent *event); - - void asteriskPressed(Qt3DInput::Q3DKeyEvent *event); - void numberSignPressed(Qt3DInput::Q3DKeyEvent *event); - void escapePressed(Qt3DInput::Q3DKeyEvent *event); - void returnPressed(Qt3DInput::Q3DKeyEvent *event); - void enterPressed(Qt3DInput::Q3DKeyEvent *event); - void deletePressed(Qt3DInput::Q3DKeyEvent *event); - void spacePressed(Qt3DInput::Q3DKeyEvent *event); - void backPressed(Qt3DInput::Q3DKeyEvent *event); - void cancelPressed(Qt3DInput::Q3DKeyEvent *event); - void selectPressed(Qt3DInput::Q3DKeyEvent *event); - void yesPressed(Qt3DInput::Q3DKeyEvent *event); - void noPressed(Qt3DInput::Q3DKeyEvent *event); - void context1Pressed(Qt3DInput::Q3DKeyEvent *event); - void context2Pressed(Qt3DInput::Q3DKeyEvent *event); - void context3Pressed(Qt3DInput::Q3DKeyEvent *event); - void context4Pressed(Qt3DInput::Q3DKeyEvent *event); - void callPressed(Qt3DInput::Q3DKeyEvent *event); - void hangupPressed(Qt3DInput::Q3DKeyEvent *event); - void flipPressed(Qt3DInput::Q3DKeyEvent *event); - void menuPressed(Qt3DInput::Q3DKeyEvent *event); - void volumeUpPressed(Qt3DInput::Q3DKeyEvent *event); - void volumeDownPressed(Qt3DInput::Q3DKeyEvent *event); - - void pressed(Qt3DInput::Q3DKeyEvent *event); - void released(Qt3DInput::Q3DKeyEvent *event); + void digit0Pressed(Qt3DInput::QKeyEvent *event); + void digit1Pressed(Qt3DInput::QKeyEvent *event); + void digit2Pressed(Qt3DInput::QKeyEvent *event); + void digit3Pressed(Qt3DInput::QKeyEvent *event); + void digit4Pressed(Qt3DInput::QKeyEvent *event); + void digit5Pressed(Qt3DInput::QKeyEvent *event); + void digit6Pressed(Qt3DInput::QKeyEvent *event); + void digit7Pressed(Qt3DInput::QKeyEvent *event); + void digit8Pressed(Qt3DInput::QKeyEvent *event); + void digit9Pressed(Qt3DInput::QKeyEvent *event); + + void leftPressed(Qt3DInput::QKeyEvent *event); + void rightPressed(Qt3DInput::QKeyEvent *event); + void upPressed(Qt3DInput::QKeyEvent *event); + void downPressed(Qt3DInput::QKeyEvent *event); + void tabPressed(Qt3DInput::QKeyEvent *event); + void backtabPressed(Qt3DInput::QKeyEvent *event); + + void asteriskPressed(Qt3DInput::QKeyEvent *event); + void numberSignPressed(Qt3DInput::QKeyEvent *event); + void escapePressed(Qt3DInput::QKeyEvent *event); + void returnPressed(Qt3DInput::QKeyEvent *event); + void enterPressed(Qt3DInput::QKeyEvent *event); + void deletePressed(Qt3DInput::QKeyEvent *event); + void spacePressed(Qt3DInput::QKeyEvent *event); + void backPressed(Qt3DInput::QKeyEvent *event); + void cancelPressed(Qt3DInput::QKeyEvent *event); + void selectPressed(Qt3DInput::QKeyEvent *event); + void yesPressed(Qt3DInput::QKeyEvent *event); + void noPressed(Qt3DInput::QKeyEvent *event); + void context1Pressed(Qt3DInput::QKeyEvent *event); + void context2Pressed(Qt3DInput::QKeyEvent *event); + void context3Pressed(Qt3DInput::QKeyEvent *event); + void context4Pressed(Qt3DInput::QKeyEvent *event); + void callPressed(Qt3DInput::QKeyEvent *event); + void hangupPressed(Qt3DInput::QKeyEvent *event); + void flipPressed(Qt3DInput::QKeyEvent *event); + void menuPressed(Qt3DInput::QKeyEvent *event); + void volumeUpPressed(Qt3DInput::QKeyEvent *event); + void volumeDownPressed(Qt3DInput::QKeyEvent *event); + + void pressed(Qt3DInput::QKeyEvent *event); + void released(Qt3DInput::QKeyEvent *event); protected: QKeyboardInput(QKeyboardInputPrivate &dd, QNode *parent = 0); void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; - void keyEvent(Q3DKeyEvent *event); + void keyEvent(QKeyEvent *event); private: Q_DECLARE_PRIVATE(QKeyboardInput) diff --git a/src/input/frontend/q3dkeyevent.cpp b/src/input/frontend/qkeyevent.cpp index 7c817967b..229bbd57d 100644 --- a/src/input/frontend/q3dkeyevent.cpp +++ b/src/input/frontend/qkeyevent.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "q3dkeyevent.h" +#include "qkeyevent.h" QT_BEGIN_NAMESPACE @@ -43,7 +43,7 @@ namespace Qt3DInput { //Qt6: Move this into a QtQmlGui module and merge it with QQuickKeyEvent /*! - \class Qt3DInput::Q3DKeyEvent + \class Qt3DInput::QKeyEvent \inmodule Qt3DInput \since 5.5 */ @@ -51,21 +51,21 @@ namespace Qt3DInput { /*! \qmltype KeyEvent \inqmlmodule Qt3D.Input - \instantiates Qt3DInput::Q3DKeyEvent + \instantiates Qt3DInput::QKeyEvent \since 5.5 The KeyEvent QML type cannot be directly created. Objects of this type are used as signal parameters in KeyboardInput. */ -Q3DKeyEvent::Q3DKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text, bool autorep, ushort count) +QKeyEvent::QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text, bool autorep, ushort count) : QObject() , m_event(type, key, modifiers, text, autorep, count) { m_event.setAccepted(false); } -Q3DKeyEvent::Q3DKeyEvent(const QKeyEvent &ke) +QKeyEvent::QKeyEvent(const QT_PREPEND_NAMESPACE(QKeyEvent) &ke) : QObject() , m_event(ke) { diff --git a/src/input/frontend/q3dkeyevent.h b/src/input/frontend/qkeyevent.h index e48071858..ee246e828 100644 --- a/src/input/frontend/q3dkeyevent.h +++ b/src/input/frontend/qkeyevent.h @@ -34,23 +34,23 @@ ** ****************************************************************************/ -#ifndef QT3DINPUT_Q3DKEYEVENT_H -#define QT3DINPUT_Q3DKEYEVENT_H +#ifndef QT3DINPUT_QKEYEVENT_H +#define QT3DINPUT_QKEYEVENT_H #include <QObject> -#include <QKeyEvent> +#include <QtGui/QKeyEvent> #include <Qt3DInput/qt3dinput_global.h> QT_BEGIN_NAMESPACE namespace Qt3DInput { -class Q3DKeyEventPrivate; -class Q3DKeyEvent; +class QKeyEventPrivate; +class QKeyEvent; -typedef QSharedPointer<Q3DKeyEvent> Q3DKeyEventPtr; +typedef QSharedPointer<QKeyEvent> QKeyEventPtr; -class QT3DINPUTSHARED_EXPORT Q3DKeyEvent : public QObject +class QT3DINPUTSHARED_EXPORT QKeyEvent : public QObject { Q_OBJECT Q_PROPERTY(int key READ key CONSTANT) @@ -62,8 +62,8 @@ class QT3DINPUTSHARED_EXPORT Q3DKeyEvent : public QObject Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) public: - Q3DKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text=QString(), bool autorep=false, ushort count=1); - Q3DKeyEvent(const QKeyEvent &ke); + QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text=QString(), bool autorep=false, ushort count=1); + QKeyEvent(const QT_PREPEND_NAMESPACE(QKeyEvent) &ke); inline int key() const { return m_event.key(); } inline QString text() const { return m_event.text(); } @@ -77,11 +77,11 @@ public: Q_INVOKABLE bool matches(QKeySequence::StandardKey key_) const { return m_event.matches(key_); } private: - QKeyEvent m_event; + QT_PREPEND_NAMESPACE(QKeyEvent) m_event; }; } // namespace Qt3DInput QT_END_NAMESPACE -#endif // QT3DINPUT_Q3DKEYEVENT_H +#endif // QT3DINPUT_QKEYEVENT_H diff --git a/src/input/frontend/q3dmouseevent.cpp b/src/input/frontend/qmouseevent.cpp index 8446a0a5a..41a12a08b 100644 --- a/src/input/frontend/q3dmouseevent.cpp +++ b/src/input/frontend/qmouseevent.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "q3dmouseevent.h" +#include "qmouseevent.h" QT_BEGIN_NAMESPACE @@ -48,10 +48,10 @@ namespace Qt3DInput { // These can always be added in follow up commits once the input API takes shape /*! - * \class Qt3DInput::Q3DMouseEvent + * \class Qt3DInput::QMouseEvent * \inmodule Qt3DInput * - * \brief The Qt3DCore::Q3DMouseEvent contains parameters that describe a mouse event. + * \brief The Qt3DCore::QMouseEvent contains parameters that describe a mouse event. * * Mouse events occur when a mouse button is pressed and the ray * traversing the view, originating from the mouse position intersects with one @@ -59,30 +59,30 @@ namespace Qt3DInput { * * \since 5.5 * - * \sa Q3DKeyEvent, Q3DWheelEvent, QMouseInput + * \sa QKeyEvent, QWheelEvent, QMouseInput * */ /*! - * \fn int Qt3DInput::Q3DMouseEvent::x() const + * \fn int Qt3DInput::QMouseEvent::x() const * * Returns the x position of the mouse event. */ /*! - * \fn int Qt3DInput::Q3DMouseEvent::y() const + * \fn int Qt3DInput::QMouseEvent::y() const * * Returns the y position of the mouse event. */ /*! - * \fn bool Qt3DInput::Q3DMouseEvent::isAccepted() const + * \fn bool Qt3DInput::QMouseEvent::isAccepted() const * * Returns whether the event was accepted. */ /*! - * \fn void Qt3DInput::Q3DMouseEvent::setAccepted(bool accepted) + * \fn void Qt3DInput::QMouseEvent::setAccepted(bool accepted) * * Sets the event as accepted if \a accepted is true. * @@ -91,40 +91,40 @@ namespace Qt3DInput { */ /*! - * \fn QEvent::Type Qt3DInput::Q3DMouseEvent::type() const + * \fn QEvent::Type Qt3DInput::QMouseEvent::type() const * * Returns the QEvent::Type of the event. */ /*! - * Constructs a new Q3DMouseEvent instance for the QMouseEvent \a e. + * Constructs a new QMouseEvent instance for the QMouseEvent \a e. */ -Q3DMouseEvent::Q3DMouseEvent(const QMouseEvent &e) +QMouseEvent::QMouseEvent(const QT_PREPEND_NAMESPACE(QMouseEvent) &e) : QObject() , m_event(e) { } -Q3DMouseEvent::~Q3DMouseEvent() +QMouseEvent::~QMouseEvent() { } /*! * Returns the mouse button of the mouse event. */ -Q3DMouseEvent::Buttons Q3DMouseEvent::button() const +QMouseEvent::Buttons QMouseEvent::button() const { switch (m_event.button()) { case Qt::MouseButton::LeftButton: - return Q3DMouseEvent::Buttons::LeftButton; + return QMouseEvent::Buttons::LeftButton; case Qt::MouseButton::RightButton: - return Q3DMouseEvent::Buttons::RightButton; + return QMouseEvent::Buttons::RightButton; case Qt::MouseButton::MiddleButton: - return Q3DMouseEvent::Buttons::MiddleButton; + return QMouseEvent::Buttons::MiddleButton; case Qt::MouseButton::BackButton: - return Q3DMouseEvent::Buttons::BackButton; + return QMouseEvent::Buttons::BackButton; default: - return Q3DMouseEvent::Buttons::NoButton; + return QMouseEvent::Buttons::NoButton; } } @@ -132,7 +132,7 @@ Q3DMouseEvent::Buttons Q3DMouseEvent::button() const * Returns a bitfield to be used to check for mouse buttons that may be * accompanying the mouse event. */ -int Q3DMouseEvent::buttons() const +int QMouseEvent::buttons() const { return m_event.buttons(); } @@ -140,53 +140,53 @@ int Q3DMouseEvent::buttons() const /*! * Returns the keyboard modifier that may be accompanying the mouse event. */ -Q3DMouseEvent::Modifiers Q3DMouseEvent::modifier() const +QMouseEvent::Modifiers QMouseEvent::modifier() const { switch (m_event.modifiers()) { case Qt::ShiftModifier: - return Q3DMouseEvent::Modifiers::ShiftModifier; + return QMouseEvent::Modifiers::ShiftModifier; case Qt::ControlModifier: - return Q3DMouseEvent::Modifiers::ControlModifier; + return QMouseEvent::Modifiers::ControlModifier; case Qt::AltModifier: - return Q3DMouseEvent::Modifiers::AltModifier; + return QMouseEvent::Modifiers::AltModifier; case Qt::MetaModifier: - return Q3DMouseEvent::Modifiers::MetaModifier; + return QMouseEvent::Modifiers::MetaModifier; case Qt::KeypadModifier: - return Q3DMouseEvent::Modifiers::KeypadModifier; + return QMouseEvent::Modifiers::KeypadModifier; default: - return Q3DMouseEvent::Modifiers::NoModifier; + return QMouseEvent::Modifiers::NoModifier; } } /*! - * \class Qt3DInput::Q3DWheelEvent + * \class Qt3DInput::QWheelEvent * \inmodule Qt3DInput * - * \brief The Q3DWheelEvent class contains parameters that describe a mouse wheel event. + * \brief The QWheelEvent class contains parameters that describe a mouse wheel event. * * Mouse wheel events occur when the mouse is rotated. * * \since 5.5 * - * \sa Q3DKeyEvent, Q3DMouseEvent, QMouseInput + * \sa QKeyEvent, QMouseEvent, QMouseInput * */ /*! - * \fn int Qt3DInput::Q3DWheelEvent::x() const + * \fn int Qt3DInput::QWheelEvent::x() const * * Returns the x position of the mouse event. */ /*! - * \fn int Qt3DInput::Q3DWheelEvent::y() const + * \fn int Qt3DInput::QWheelEvent::y() const * * Returns the x position of the mouse event. */ /*! - * \fn QPoint Qt3DInput::Q3DWheelEvent::angleDelta() const + * \fn QPoint Qt3DInput::QWheelEvent::angleDelta() const * * Returns the distance that the wheel is rotated, in eighths of a degree. A * positive value indicates that the wheel was rotated forward (away from the @@ -195,13 +195,13 @@ Q3DMouseEvent::Modifiers Q3DMouseEvent::modifier() const */ /*! - * \fn bool Qt3DInput::Q3DWheelEvent::isAccepted() const + * \fn bool Qt3DInput::QWheelEvent::isAccepted() const * * Returns whether the event was accepted. */ /*! - * \fn void Qt3DInput::Q3DWheelEvent::setAccepted(bool accepted) + * \fn void Qt3DInput::QWheelEvent::setAccepted(bool accepted) * * Sets the event as accepted if \a accepted is true. * @@ -210,21 +210,21 @@ Q3DMouseEvent::Modifiers Q3DMouseEvent::modifier() const */ /*! - * \fn QEvent::Type Qt3DInput::Q3DWheelEvent::type() const + * \fn QEvent::Type Qt3DInput::QWheelEvent::type() const * * Returns the QEvent::Type of the event. */ /*! - * Constructs a new Q3DWheelEvent instance from the QWheelEvent \a e. + * Constructs a new QWheelEvent instance from the QWheelEvent \a e. */ -Q3DWheelEvent::Q3DWheelEvent(const QWheelEvent &e) +QWheelEvent::QWheelEvent(const QT_PREPEND_NAMESPACE(QWheelEvent) &e) : QObject() , m_event(e) { } -Q3DWheelEvent::~Q3DWheelEvent() +QWheelEvent::~QWheelEvent() { } @@ -232,7 +232,7 @@ Q3DWheelEvent::~Q3DWheelEvent() * Returns a bitfield to be used to check for mouse buttons that may be * accompanying the wheel event. */ -int Q3DWheelEvent::buttons() const +int QWheelEvent::buttons() const { return m_event.buttons(); } @@ -240,21 +240,21 @@ int Q3DWheelEvent::buttons() const /*! * Returns the keyboard modifier that may be accompanying the wheel event. */ -Q3DWheelEvent::Modifiers Q3DWheelEvent::modifier() const +QWheelEvent::Modifiers QWheelEvent::modifier() const { switch (m_event.modifiers()) { case Qt::ShiftModifier: - return Q3DWheelEvent::Modifiers::ShiftModifier; + return QWheelEvent::Modifiers::ShiftModifier; case Qt::ControlModifier: - return Q3DWheelEvent::Modifiers::ControlModifier; + return QWheelEvent::Modifiers::ControlModifier; case Qt::AltModifier: - return Q3DWheelEvent::Modifiers::AltModifier; + return QWheelEvent::Modifiers::AltModifier; case Qt::MetaModifier: - return Q3DWheelEvent::Modifiers::MetaModifier; + return QWheelEvent::Modifiers::MetaModifier; case Qt::KeypadModifier: - return Q3DWheelEvent::Modifiers::KeypadModifier; + return QWheelEvent::Modifiers::KeypadModifier; default: - return Q3DWheelEvent::Modifiers::NoModifier; + return QWheelEvent::Modifiers::NoModifier; } } diff --git a/src/input/frontend/q3dmouseevent.h b/src/input/frontend/qmouseevent.h index ef1a74bb0..109875d38 100644 --- a/src/input/frontend/q3dmouseevent.h +++ b/src/input/frontend/qmouseevent.h @@ -34,27 +34,27 @@ ** ****************************************************************************/ -#ifndef QT3DINPUT_Q3DMOUSEEVENT_H -#define QT3DINPUT_Q3DMOUSEEVENT_H +#ifndef QT3DINPUT_QMOUSEEVENT_H +#define QT3DINPUT_QMOUSEEVENT_H #include <Qt3DInput/qt3dinput_global.h> #include <QObject> -#include <QMouseEvent> +#include <QtGui/QMouseEvent> #include <QtGlobal> QT_BEGIN_NAMESPACE namespace Qt3DInput { -class QT3DINPUTSHARED_EXPORT Q3DMouseEvent : public QObject +class QT3DINPUTSHARED_EXPORT QMouseEvent : public QObject { Q_OBJECT Q_PROPERTY(int x READ x CONSTANT) Q_PROPERTY(int y READ y CONSTANT) Q_PROPERTY(bool wasHeld READ wasHeld CONSTANT) - Q_PROPERTY(Qt3DInput::Q3DMouseEvent::Buttons button READ button CONSTANT) + Q_PROPERTY(Qt3DInput::QMouseEvent::Buttons button READ button CONSTANT) Q_PROPERTY(int buttons READ buttons CONSTANT) - Q_PROPERTY(Qt3DInput::Q3DMouseEvent::Modifiers modifier READ modifier CONSTANT) + Q_PROPERTY(Qt3DInput::QMouseEvent::Modifiers modifier READ modifier CONSTANT) Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) public: @@ -77,8 +77,8 @@ public: }; Q_ENUM(Modifiers) - explicit Q3DMouseEvent(const QMouseEvent &e); - ~Q3DMouseEvent(); + explicit QMouseEvent(const QT_PREPEND_NAMESPACE(QMouseEvent) &e); + ~QMouseEvent(); inline int x() const { return m_event.x(); } inline int y() const { return m_event.y(); } @@ -92,19 +92,19 @@ public: inline QEvent::Type type() const { return m_event.type(); } private: - QMouseEvent m_event; + QT_PREPEND_NAMESPACE(QMouseEvent) m_event; }; -typedef QSharedPointer<Q3DMouseEvent> Q3DMouseEventPtr; +typedef QSharedPointer<QMouseEvent> QMouseEventPtr; -class QT3DINPUTSHARED_EXPORT Q3DWheelEvent : public QObject +class QT3DINPUTSHARED_EXPORT QWheelEvent : public QObject { Q_OBJECT Q_PROPERTY(int x READ x CONSTANT) Q_PROPERTY(int y READ y CONSTANT) Q_PROPERTY(QPoint angleDelta READ angleDelta CONSTANT) Q_PROPERTY(int buttons READ buttons CONSTANT) - Q_PROPERTY(Qt3DInput::Q3DWheelEvent::Modifiers modifier READ modifier CONSTANT) + Q_PROPERTY(Qt3DInput::QWheelEvent::Modifiers modifier READ modifier CONSTANT) Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) public: @@ -127,8 +127,8 @@ public: }; Q_ENUM(Modifiers) - explicit Q3DWheelEvent(const QWheelEvent &e); - ~Q3DWheelEvent(); + explicit QWheelEvent(const QT_PREPEND_NAMESPACE(QWheelEvent) &e); + ~QWheelEvent(); inline int x() const { return m_event.x(); } inline int y() const { return m_event.y(); } @@ -141,16 +141,16 @@ public: inline QEvent::Type type() const { return m_event.type(); } private: - QWheelEvent m_event; + QT_PREPEND_NAMESPACE(QWheelEvent) m_event; }; -typedef QSharedPointer<Q3DWheelEvent> Q3DWheelEventPtr; +typedef QSharedPointer<QWheelEvent> QWheelEventPtr; } // namespace Qt3DInput QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3DInput::Q3DMouseEvent*) -Q_DECLARE_METATYPE(Qt3DInput::Q3DWheelEvent*) +Q_DECLARE_METATYPE(Qt3DInput::QMouseEvent*) +Q_DECLARE_METATYPE(Qt3DInput::QWheelEvent*) -#endif // QT3DINPUT_Q3DMOUSEEVENT_H +#endif // QT3DINPUT_QMOUSEEVENT_H diff --git a/src/input/frontend/qmouseinput.cpp b/src/input/frontend/qmouseinput.cpp index 235c06538..d200a3b22 100644 --- a/src/input/frontend/qmouseinput.cpp +++ b/src/input/frontend/qmouseinput.cpp @@ -37,7 +37,7 @@ #include "qmouseinput.h" #include "qmouseinput_p.h" #include "qmousecontroller.h" -#include "q3dmouseevent.h" +#include "qmouseevent.h" #include <Qt3DCore/qbackendscenepropertychange.h> QT_BEGIN_NAMESPACE @@ -146,16 +146,16 @@ void QMouseInput::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) QBackendScenePropertyChangePtr e = qSharedPointerCast<QBackendScenePropertyChange>(change); if (e->type() == NodeUpdated) { if (e->propertyName() == QByteArrayLiteral("mouse")) { - Q3DMouseEventPtr ev = e->value().value<Q3DMouseEventPtr>(); + QMouseEventPtr ev = e->value().value<QMouseEventPtr>(); mouseEvent(ev.data()); } else if (e->propertyName() == QByteArrayLiteral("wheel")) { - Q3DWheelEventPtr ev = e->value().value<Q3DWheelEventPtr>(); + QWheelEventPtr ev = e->value().value<QWheelEventPtr>(); emit wheel(ev.data()); } } } -void QMouseInput::mouseEvent(Q3DMouseEvent *event) +void QMouseInput::mouseEvent(QMouseEvent *event) { switch (event->type()) { case QEvent::MouseButtonPress: diff --git a/src/input/frontend/qmouseinput.h b/src/input/frontend/qmouseinput.h index c31576a84..ec6176bfd 100644 --- a/src/input/frontend/qmouseinput.h +++ b/src/input/frontend/qmouseinput.h @@ -38,7 +38,7 @@ #define QT3DINPUT_QMOUSEINPUT_H #include <Qt3DInput/qt3dinput_global.h> -#include <Qt3DInput/q3dmouseevent.h> +#include <Qt3DInput/qmouseevent.h> #include <Qt3DCore/qcomponent.h> QT_BEGIN_NAMESPACE @@ -68,24 +68,24 @@ Q_SIGNALS: void controllerChanged(QMouseController *controller); void containsMouseChanged(bool containsMouse); - void clicked(Qt3DInput::Q3DMouseEvent *mouse); - void doubleClicked(Qt3DInput::Q3DMouseEvent *mouse); + void clicked(Qt3DInput::QMouseEvent *mouse); + void doubleClicked(Qt3DInput::QMouseEvent *mouse); void entered(); void exited(); - void pressed(Qt3DInput::Q3DMouseEvent *mouse); - void released(Qt3DInput::Q3DMouseEvent *mouse); - void pressAndHold(Qt3DInput::Q3DMouseEvent *mouse); - void positionChanged(Qt3DInput::Q3DMouseEvent *mouse); + void pressed(Qt3DInput::QMouseEvent *mouse); + void released(Qt3DInput::QMouseEvent *mouse); + void pressAndHold(Qt3DInput::QMouseEvent *mouse); + void positionChanged(Qt3DInput::QMouseEvent *mouse); - void wheel(Qt3DInput::Q3DWheelEvent *wheel); + void wheel(Qt3DInput::QWheelEvent *wheel); protected: QMouseInput(QMouseInputPrivate &dd, Qt3DCore::QNode *parent = 0); void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; - void mouseEvent(Q3DMouseEvent *event); + void mouseEvent(Qt3DInput::QMouseEvent *event); void setContainsMouse(bool contains); private: |