diff options
-rw-r--r-- | src/datavisualization/engine/abstract3dcontroller.cpp | 12 | ||||
-rw-r--r-- | src/datavisualization/engine/q3dscene.cpp | 4 | ||||
-rw-r--r-- | tests/qmlcamera/qml/qmlcamera/main.qml | 24 |
3 files changed, 28 insertions, 12 deletions
diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp index cfc05166..625794a5 100644 --- a/src/datavisualization/engine/abstract3dcontroller.cpp +++ b/src/datavisualization/engine/abstract3dcontroller.cpp @@ -380,48 +380,36 @@ void Abstract3DController::mouseDoubleClickEvent(QMouseEvent *event) { if (m_activeInputHandler) m_activeInputHandler->mouseDoubleClickEvent(event); - - emitNeedRender(); } void Abstract3DController::touchEvent(QTouchEvent *event) { if (m_activeInputHandler) m_activeInputHandler->touchEvent(event); - - emitNeedRender(); } void Abstract3DController::mousePressEvent(QMouseEvent *event, const QPoint &mousePos) { if (m_activeInputHandler) m_activeInputHandler->mousePressEvent(event, mousePos); - - emitNeedRender(); } void Abstract3DController::mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos) { if (m_activeInputHandler) m_activeInputHandler->mouseReleaseEvent(event, mousePos); - - emitNeedRender(); } void Abstract3DController::mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos) { if (m_activeInputHandler) m_activeInputHandler->mouseMoveEvent(event, mousePos); - - emitNeedRender(); } void Abstract3DController::wheelEvent(QWheelEvent *event) { if (m_activeInputHandler) m_activeInputHandler->wheelEvent(event); - - emitNeedRender(); } void Abstract3DController::setSize(const int width, const int height) diff --git a/src/datavisualization/engine/q3dscene.cpp b/src/datavisualization/engine/q3dscene.cpp index 3cda41b7..71e3c5a3 100644 --- a/src/datavisualization/engine/q3dscene.cpp +++ b/src/datavisualization/engine/q3dscene.cpp @@ -271,6 +271,8 @@ void Q3DScene::setActiveCamera(Q3DCamera *camera) &Q3DScene::emitNeedRender); disconnect(d_ptr->m_camera, &Q3DCamera::yRotationChanged, this, &Q3DScene::emitNeedRender); + disconnect(d_ptr->m_camera, &Q3DCamera::zoomLevelChanged, this, + &Q3DScene::emitNeedRender); } d_ptr->m_camera = camera; @@ -281,6 +283,8 @@ void Q3DScene::setActiveCamera(Q3DCamera *camera) &Q3DScene::emitNeedRender); connect(camera, &Q3DCamera::yRotationChanged, this, &Q3DScene::emitNeedRender); + connect(camera, &Q3DCamera::zoomLevelChanged, this, + &Q3DScene::emitNeedRender); } emit activeCameraChanged(camera); diff --git a/tests/qmlcamera/qml/qmlcamera/main.qml b/tests/qmlcamera/qml/qmlcamera/main.qml index 1f87d5eb..705f284d 100644 --- a/tests/qmlcamera/qml/qmlcamera/main.qml +++ b/tests/qmlcamera/qml/qmlcamera/main.qml @@ -71,6 +71,30 @@ Item { scene.activeCamera.zoomLevel: zoomSlider.value inputHandler: null } + + MouseArea { + id: inputArea + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + property bool selectionOn: false + + onPressed: { + if (mouse.button == Qt.LeftButton) + selectionOn = true; + testChart.scene.selectionQueryPosition = Qt.point(mouse.x, mouse.y); + } + + onReleased: { + if (mouse.button == Qt.LeftButton) + selectionOn = false; + } + + onPositionChanged: { + if (selectionOn) { + testChart.scene.selectionQueryPosition = Qt.point(mouse.x, mouse.y); + } + } + } } ControlSurface { |