[osg-users] osgQt::GLWidget Scroll Bug

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Wed Feb 12 11:36:26 PST 2020


I think I'm running into a bug in OSG.  I've implemented my own versions of 
mouse events in a sub-classed osgQt::GLWidget so I can redraw the 3D view 
only when necessary:

void Osg3dViewCM::mousePressEvent(QMouseEvent* event)
{
    m_mouseDown = true;

    if (_cameraManipulator.valid())
    {
        osgQt::GLWidget::mousePressEvent(event);

        frame();
    }
}

void Osg3dViewCM::mouseReleaseEvent(QMouseEvent* event)
{
    m_mouseDown = false;

    if (_cameraManipulator.valid())
    {
        osgQt::GLWidget::mouseReleaseEvent(event);

        frame();
    }

    emit cameraChanged(_cameraManipulator->getInverseMatrix());
}

void Osg3dViewCM::mouseMoveEvent(QMouseEvent* event)
{
    if (_cameraManipulator.valid() && m_mouseDown)
    {
        osgQt::GLWidget::mouseMoveEvent(event);

        frame();
    }
}

void Osg3dViewCM::wheelEvent(QWheelEvent *event)
{
    if (_cameraManipulator.valid())
    {
        osgQt::GLWidget::wheelEvent(event);

        frame();
    }
}

I'm using a default osgEarth::Util::EarthManipulator and clicking and 
dragging on the view updates it without an issue rotating or panning 
properly.  For some reason, when I scroll the wheel, the frame function 
doesn't update the view.  If I click on the view after scrolling, it gets 
updated with the zoom operation applied.  Am I missing something?

Thank you,
Scott

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/a6b79fd7-c723-451a-8dab-407f1e41bd16%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200212/0539ef1b/attachment.html>


More information about the osg-users mailing list