send mouse wheel input to active EditMode during drag operations

sceneinput
Marc Zinnschlag 9 years ago
parent 0a5bfb2107
commit 1d4f8b2595

@ -59,3 +59,5 @@ void CSVRender::EditMode::drag (int diffX, int diffY) {}
void CSVRender::EditMode::dragCompleted() {}
void CSVRender::EditMode::dragAborted() {}
void CSVRender::EditMode::dragWheel (int diff) {}

@ -71,6 +71,9 @@ namespace CSVRender
/// \note dragAborted will not be called, if the drag is aborted via changing
/// editing mode
virtual void dragAborted();
/// Default-implementation: ignored
virtual void dragWheel (int diff);
};
}

@ -110,6 +110,8 @@ bool RenderWidget::eventFilter(QObject* obj, QEvent* event)
keyPressEvent(static_cast<QKeyEvent*>(event));
if (event->type() == QEvent::KeyRelease)
keyReleaseEvent(static_cast<QKeyEvent*>(event));
if (event->type() == QEvent::Wheel)
wheelEvent(static_cast<QWheelEvent *>(event));
// Always pass the event on to GLWidget, i.e. to OSG event queue
return QObject::eventFilter(obj, event);

@ -599,8 +599,14 @@ void CSVRender::WorldspaceWidget::mouseDoubleClickEvent (QMouseEvent *event)
void CSVRender::WorldspaceWidget::wheelEvent (QWheelEvent *event)
{
//if(!mMouse->wheelEvent(event))
RenderWidget::wheelEvent(event);
if (mDragging)
{
EditMode& editMode = dynamic_cast<CSVRender::EditMode&> (*mEditMode->getCurrent());
editMode.dragWheel (event->delta());
}
RenderWidget::wheelEvent(event);
}
void CSVRender::WorldspaceWidget::keyPressEvent (QKeyEvent *event)

Loading…
Cancel
Save