Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMouseReleaseEvent doesn't return which mouse button

QMouseReleaseEvent doesn't return which mouse button

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 694 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roest
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      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.

      1 Reply Last reply
      1
      • R Offline
        R Offline
        Roest
        wrote on last edited by
        #3

        Oops guess reading helps. Thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved