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. QGraphicsObject intercept touch event

QGraphicsObject intercept touch event

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.6k 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.
  • B Offline
    B Offline
    blackbelt
    wrote on last edited by
    #1

    I've a QGraphicsView, a QGraphicsScene, and a QGraphicsObject. I can manage the touch event as mouse event in the QGraphicsView but I want the QGraphicsObject to manage its touch event. Is that possible?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kkrzewniak
      wrote on last edited by
      #2

      Sure just re-implement those:
      @
      virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * mouseEvent)
      virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent)
      virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent)
      virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent)
      @

      Me, Grimlock, not "nice dino". ME BASH BRAINS!

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blackbelt
        wrote on last edited by
        #3

        thank you. Is possibile to avoid the touch propagation if the QGraphicsObject consume it?

        EDIT: It does not work. The QGraphicsObject does not receive mouse event. MayBe because the QGraphicsView does not propagate it?

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kkrzewniak
          wrote on last edited by
          #4

          Yes, just make sure to call.
          @
          mouseEvent->accept();
          @

          Me, Grimlock, not "nice dino". ME BASH BRAINS!

          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