Skip to content

Commit fbde0c8

Browse files
committedNov 6, 2018
[3d] fix camera controller using wrong shift/ctrl status (fixes #20131)
We used Qt3DInput::QLogicalDevice with its axes and actions for camera controller, but over time this got quite impractical, moreover we started to have problems with shift/ctrl actions getting stuck in wrong state in case they were pressed or released while 3D canvas was not focused (which is in fact relatively common when using other widgets in the GUI) This commit switches over to using just QMouseHandler and QKeyboardHandler for handling key and mouse events and this not only makes the code easier to read, but also the issues with shift/ctrl go away (because we do not keep their status anymore, we just check whether they are active inside event handlers). The speed of change with mouse wheel and keys should be similar or a bit less than what it was before.
1 parent 1e16680 commit fbde0c8

File tree

4 files changed

+246
-270
lines changed

4 files changed

+246
-270
lines changed
 

‎src/3d/qgs3dmapscene.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
#include <Qt3DRender/QCamera>
1919
#include <Qt3DRender/QMesh>
20+
#include <Qt3DRender/QObjectPicker>
21+
#include <Qt3DRender/QPickEvent>
2022
#include <Qt3DRender/QPickingSettings>
23+
#include <Qt3DRender/QPickTriangleEvent>
24+
#include <Qt3DRender/QPointLight>
2125
#include <Qt3DRender/QRenderSettings>
2226
#include <Qt3DRender/QSceneLoader>
2327
#include <Qt3DExtras/QForwardRenderer>

0 commit comments

Comments
 (0)
Please sign in to comment.