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. PySide2 contextMenuEvent and mouseMoveEvent clash

PySide2 contextMenuEvent and mouseMoveEvent clash

Scheduled Pinned Locked Moved Unsolved Language Bindings
python
4 Posts 2 Posters 2.1k Views
  • 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.
  • GofferG Offline
    GofferG Offline
    Goffer
    wrote on last edited by A Former User
    #1

    Hey everyone.

    I'am trying to convert a UI from PySide to PySide2 but I am having a hard time with the contextMenuEvent. Everyything works fine with PySide but in PySide2 in some cases the events seems to be confused.

    # Traceback (most recent call last):
    #   File "/sw/dev/legoffl/pythonDev/picker.py", line 919, in mouseMoveEvent
    #     super(PickerView, self).mouseMoveEvent(event)
    # TypeError: # 'PySide2.QtWidgets.QGraphicsView.mouseMoveEvent' called with wrong argument types:
    #   PySide2.QtWidgets.QGraphicsView.mouseMoveEvent(PySide2.QtGui.QContextMenuEvent)
    # Supported signatures:
    # PySide2.QtWidgets.QGraphicsView.mouseMoveEvent(PySide2.QtGui.QMouseEvent)
    
    

    From what I understand, It seems that the contextMenu event is still the one detected when the mouse is moving. This only happens for some entries of my menu. Now the question is WHY ? PySide version work perfectly. What has changed ???
    Is tthere a new trick with PySide2 ???

    Thx

    jsulmJ 1 Reply Last reply
    0
    • GofferG Goffer

      Hey everyone.

      I'am trying to convert a UI from PySide to PySide2 but I am having a hard time with the contextMenuEvent. Everyything works fine with PySide but in PySide2 in some cases the events seems to be confused.

      # Traceback (most recent call last):
      #   File "/sw/dev/legoffl/pythonDev/picker.py", line 919, in mouseMoveEvent
      #     super(PickerView, self).mouseMoveEvent(event)
      # TypeError: # 'PySide2.QtWidgets.QGraphicsView.mouseMoveEvent' called with wrong argument types:
      #   PySide2.QtWidgets.QGraphicsView.mouseMoveEvent(PySide2.QtGui.QContextMenuEvent)
      # Supported signatures:
      # PySide2.QtWidgets.QGraphicsView.mouseMoveEvent(PySide2.QtGui.QMouseEvent)
      
      

      From what I understand, It seems that the contextMenu event is still the one detected when the mouse is moving. This only happens for some entries of my menu. Now the question is WHY ? PySide version work perfectly. What has changed ???
      Is tthere a new trick with PySide2 ???

      Thx

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Goffer So, you're handling events by yourself? Can you show the code?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • GofferG Offline
        GofferG Offline
        Goffer
        wrote on last edited by
        #3

        Sorry, I am not allowed to share the code as it' company property.

        I am simply subclassing a QGrapgicsView and overriding ContextMenuEvent and MouseMoveEvent to add some features, nothing fancy.

        jsulmJ 1 Reply Last reply
        0
        • GofferG Goffer

          Sorry, I am not allowed to share the code as it' company property.

          I am simply subclassing a QGrapgicsView and overriding ContextMenuEvent and MouseMoveEvent to add some features, nothing fancy.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Goffer Well, without code it is hard to help...

          https://forum.qt.io/topic/113070/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