0000607: Holding down middle mouse button (wheel) will zoom out without scrolling

This commit is contained in:
wmayer
2012-02-24 11:07:41 +01:00
parent 739236ca76
commit 463652407a
2 changed files with 9 additions and 2 deletions

View File

@@ -74,6 +74,7 @@
# include <Inventor/VRMLnodes/SoVRMLGroup.h>
# include <QEventLoop>
# include <QKeyEvent>
# include <QWheelEvent>
# include <QMessageBox>
# include <QTimer>
# include <QStatusBar>
@@ -1033,6 +1034,14 @@ void View3DInventorViewer::selectAll()
*/
void View3DInventorViewer::processEvent(QEvent * event)
{
// Bug #0000607: Some mices also support horizontal scrolling which however might
// lead to some unwanted zooming when pressing the MMB for panning.
// Thus, we filter out horizontal scrolling.
if (event->type() == QEvent::Wheel) {
QWheelEvent* we = static_cast<QWheelEvent*>(event);
if (we->orientation() == Qt::Horizontal)
return;
}
if (event->type() == QEvent::KeyPress) {
QKeyEvent* ke = static_cast<QKeyEvent*>(event);
if (ke->matches(QKeySequence::SelectAll)) {