Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to get child QGraphicsItem to ignore input events
Forum Updated to NodeBB v4.3 + New Features

How to get child QGraphicsItem to ignore input events

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 611 Views 2 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.
  • P Offline
    P Offline
    patrickkidd
    wrote on last edited by
    #1

    I feel like I should know this by now, but is there a way to have a child QGraphicsItem pass all input events to its parent?

    Right now I have a parent item that draws a simple shape and a child QGraphicsTextItem that just draws a number in the middle of that shape. The child is grabbing mouse events so that I can't drag the parent. I just want the child to ignore or pass all input events on to the parent.

    Thanks!

    https://alaskafamilysystems.com/

    kshegunovK 1 Reply Last reply
    0
    • P patrickkidd

      I feel like I should know this by now, but is there a way to have a child QGraphicsItem pass all input events to its parent?

      Right now I have a parent item that draws a simple shape and a child QGraphicsTextItem that just draws a number in the middle of that shape. The child is grabbing mouse events so that I can't drag the parent. I just want the child to ignore or pass all input events on to the parent.

      Thanks!

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      Hi,
      Is this what you're looking for?

      Read and abide by the Qt Code of Conduct

      P 1 Reply Last reply
      0
      • kshegunovK kshegunov

        Hi,
        Is this what you're looking for?

        P Offline
        P Offline
        patrickkidd
        wrote on last edited by
        #3

        @kshegunov said in How to get child QGraphicsItem to ignore input events:

        Hi,
        Is this what you're looking for?

        Close, but as far as I can tell this method would prevent dragging of some child items. Some of my child items are still meant to be draggable. I am looking to prevent input from only a subset of items.

        https://alaskafamilysystems.com/

        kshegunovK 1 Reply Last reply
        0
        • P patrickkidd

          @kshegunov said in How to get child QGraphicsItem to ignore input events:

          Hi,
          Is this what you're looking for?

          Close, but as far as I can tell this method would prevent dragging of some child items. Some of my child items are still meant to be draggable. I am looking to prevent input from only a subset of items.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @patrickkidd said in How to get child QGraphicsItem to ignore input events:

          Close, but as far as I can tell this method would prevent dragging of some child items. Some of my child items are still meant to be draggable. I am looking to prevent input from only a subset of items.

          I think (take it with a grain of salt), that if you filter out the event, you accept() it, but if you don't and call the base implementation of event() you should see it sink to the child.

          Read and abide by the Qt Code of Conduct

          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