Skip to content


[3d] fix camera controller using wrong shift/ctrl status (fixes #20131)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wonder-sk committed Nov 6, 2018
1 parent 1e16680 commit fbde0c8
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 270 deletions.
4 changes: 4 additions & 0 deletions src/3d/qgs3dmapscene.cpp
Expand Up @@ -17,7 +17,11 @@

#include <Qt3DRender/QCamera>
#include <Qt3DRender/QMesh>
#include <Qt3DRender/QObjectPicker>
#include <Qt3DRender/QPickEvent>
#include <Qt3DRender/QPickingSettings>
#include <Qt3DRender/QPickTriangleEvent>
#include <Qt3DRender/QPointLight>
#include <Qt3DRender/QRenderSettings>
#include <Qt3DRender/QSceneLoader>
#include <Qt3DExtras/QForwardRenderer>
Expand Down

0 comments on commit fbde0c8

Please sign in to comment.