Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2718

PySide6.QtGui.QInputEvent is missing method matches (and key) in release 6.7.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.7.0
    • PySide
    • None

      Implementing an `eventFilter` in some widget, I am using syntax such as:{}

       

      class SomeWidget(QtWidgets.QWidget):
          def eventFilter(self, source: QtCore.QObject, event: QtCore.QEvent) -> bool:
              if event.type() == QtCore.QEvent.KeyPress:
                  if event.matches(QtGui.QKeySequence.Copy):
                      self.copy_selection()
                      return True
                  if event.matches(QtGui.QKeySequence.Paste):
                      self.paste_selection()
                      return True
              return super().eventFilter(source, event)

      But this fails with latest 6.7.0 (while it was working with past releases):

       

      AttributeError: 'PySide6.QtGui.QInputEvent' object has no attribute 'matches' 

      Note it is also missing method 'key', so even the alternate syntax would not work:

      event.key() == QtGui.QKeySequence.Copy 

       

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            dubourg Vincent Dubourg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes