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

QShortcut inline scheme on QListWidget triggers twice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.4
    • 6.0.0
    • PySide
    • None
    • PySide6 on Python 3.9 on Win 10.0.19041.610
    • Windows
    • 66e438fa82cd9a5c3de419439271c7b0777082cf (pyside/pyside-setup/dev) 0b5c63935a66a1cff85c19562870576294286e2b (pyside/pyside-setup/6.0) f3da098d40bb7f8103f6d49d73115dd8d92e7d23 (pyside/pyside-setup/5.15)

    Description

      I subclassed a QListWidget to have a shortcut on the Delete-key to remove items.

      The setup scheme that used to work with PySide2 no problems now triggers double and removes 2 items!

      QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Delete), self, self.remove_selected)

       

      There is a workaround:

      shortcut = QtGui.QShortcut(self)
      shortcut.setKey(QtGui.QKeySequence(QtCore.Qt.Key_Delete))
      shortcut.activated.connect(self.remove_selected)

      works like expected!

      Attachments

        1. ps2_list.py
          1 kB
        2. ps6_list.py
          1 kB
        3. pyside1448.py
          2 kB
        For Gerrit Dashboard: PYSIDE-1448
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            ewerybody Eric Werner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews