Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. [solved] PySide subclassed QGraphicsItem not getting mouse events when used as module
Forum Updated to NodeBB v4.3 + New Features

[solved] PySide subclassed QGraphicsItem not getting mouse events when used as module

Scheduled Pinned Locked Moved Language Bindings
3 Posts 1 Posters 2.1k 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.
  • N Offline
    N Offline
    neon22
    wrote on last edited by
    #1

    I'm using Pyside to create an interactive subclassed QGraphicsView - containing some subclassed QGraphicsItems. It works well in its own module and receives mouse events.

    But when used as a module from another file, and incorporated into another Layout - my mouse events are not being triggered. However .itemChange is working. Everything except the mouse events. I am not using tracking events such as hover. I am using mousePressEvent and mouseReleaseEvent.

    I have seen c++ responses about setting "setMouseTracking" but this is for widgets and my QGraphicsItems have been added as items not widgets. So when I call this funcion it tells me it doesn't exist for items. Also that seems to be for hover type of events - which I am not needing. I believe I am subclassing properly and I pass on the events to the parent class. As I said at the start - my code works fine in a standalone file.

    Any ideas what I've forgotten to do ?

    The standalone - working program,
    the parent program - where it stops working,
    and the ui file it uses are all here (too big for this forum's guidelines):
    http://stackoverflow.com/questions/13696178/subclassed-qgraphicsitem-not-getting-mouse-events-when-used-as-module

    1 Reply Last reply
    0
    • N Offline
      N Offline
      neon22
      wrote on last edited by
      #2

      This suggests a solution for keypress style events but not sure how to override mouse events for GraphicsItems.
      http://qt-project.org/forums/viewthread/21613/

      1 Reply Last reply
      0
      • N Offline
        N Offline
        neon22
        wrote on last edited by
        #3

        Stupid error in my code where I, myself, on my own, disable my own widgets by setting inhibit_edit to True.
        Sigh...

        I need a bit of a lie down :)

        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