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. [solved] Which mouse button caused the mousePressEvent in a graphics scene?
Forum Updated to NodeBB v4.3 + New Features

[solved] Which mouse button caused the mousePressEvent in a graphics scene?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.7k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    ThaRez
    wrote on last edited by
    #1

    Hello
    I'm wondering how to tell which mouse button caused the mousePressEvent in the graphics scene, as both seems to call the event?

    the event function is as follows:

    @void gItem::mousePressEvent (QGraphicsSceneMouseEvent *event)@

    Thank you! Best regards
    Richard

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      "QGraphicsSceneMouseEvent::buttons":http://doc.qt.nokia.com/latest/qgraphicsscenemouseevent.html#buttons

      bq. Returns the combination of mouse buttons that were pressed at the time the event was sent

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        You should check the "event":http://doc.qt.nokia.com/4.7/qgraphicsscenemouseevent.html#buttons
        [quote]Qt::MouseButtons QGraphicsSceneMouseEvent::buttons () const
        Returns the combination of mouse buttons that were pressed at the time the event was sent.
        See also button() and modifiers().[/quote]

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • T Offline
          T Offline
          ThaRez
          wrote on last edited by
          #4

          thank you, looked at event, but don't know how I missed the button()... stupid me.. :)

          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