QMouseReleaseEvent doesn't return which mouse button



  • So I tested with overriding QWidget:::mouseReleaseEvent( QMouseEvent* event ) and with an event filter QEvent::MouseButtonRelease.
    In both cases event->buttons() returns QFlags<Qt::MouseButtons>(NoButton). Is that inteded?

    I'm on win10, vs2017, self compiled 5.9.0 from Git


  • Moderators

    Yes, this is intended and documented. button() returns the button that caused the event. buttons() contains the buttons pressed when the event was triggered, excluding the button that caused the release event.



  • Oops guess reading helps. Thanks


Log in to reply