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. PyQt5 Alternative to setHandlesChildEvents

PyQt5 Alternative to setHandlesChildEvents

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.6k Views 3 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.
  • J Offline
    J Offline
    Jimbo
    wrote on last edited by
    #1

    Hello,

    I have been porting a PyQt4 application to use PyQt5. Everything seems to work fine apart from one thing: setHandlesChildEvents is now obsolete with QGraphicsItemGroup meaning I can no longer pick up on click events on my items within a group.

    What is the alternative approach with PyQt5? I have tried replacing it with self.MyGroup.setFiltersChildEvents(False) but this has no effect.

    Thanks for any guidance,

    JimboMonkey

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's likely a question you should rather ask the PyQt folks. They have a mailing list.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jimbo
        wrote on last edited by Jimbo
        #3

        Ok, thank you. I have subscribed to their mailing list and will post my question there.

        I believe my question also relates to C++ Qt as well though as I found out about the obsolescence from the documentation pages (http://doc.qt.io/qt-4.8/qgraphicsitem-obsolete.html). So if anyone knows the answer for C++ let me know.

        Thanks,

        Jimbo

        1 Reply Last reply
        0
        • A Offline
          A Offline
          altendky
          wrote on last edited by
          #4

          I haven't worked with graphics items but...

          http://www.qtcentre.org/threads/66799-setHandlesChildEvents()-obsolete
          https://bugreports.qt.io/browse/QTBUG-6861

          They seem relevant, perhaps they will be useful. It does seem that the issue and solution are not related to Python specifically.

          Cheers,
          -kyle

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jimbo
            wrote on last edited by
            #5

            Thanks Kyle.

            In the end I solved it by subclassing my qgraphicsitemgroup and adding a sceneEventFilter.

            This appears to be the approach the C++ people take

            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