Gui: [skip ci] avoid that 3D view handles a single wheel scroll event twice

This commit is contained in:
wmayer
2020-04-02 14:02:03 +02:00
parent 5e9731c990
commit e498b0ebbf

View File

@@ -999,7 +999,13 @@ bool QuarterWidget::viewportEvent(QEvent* event)
QMouseEvent* mouse = static_cast<QMouseEvent*>(event);
QGraphicsItem *item = itemAt(mouse->pos());
if (!item) {
QGraphicsView::viewportEvent(event);
bool ok = QGraphicsView::viewportEvent(event);
// Avoid that wheel events are handled twice
// https://forum.freecadweb.org/viewtopic.php?f=3&t=44822
if (event->type() == QEvent::Wheel) {
event->setAccepted(ok);
return ok;
}
return false;
}
}