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

QMenu exec_ is not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.1.2
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      401a5b8a3d4468f97ec20a86055ad785262ceb43 (pyside/pyside-setup/dev) 024dd90393b73df3a52d217378ca2dc7c3328dc0 (pyside/pyside-setup/6.1)

      Description

      Even though it is deprecated, the exec_ method of QMenu is not working as expected. Executing the attached script and clicking once on the action displayed in the menu gives this output

      (venv6) ~/workspace$ python menubug.py 
      ~/workspace/menubug.py:15: DeprecationWarning: 'exec_' will be removed in the future. Use 'exec' instead.
       a = m.exec_(point)
      ~/workspace/menubug.py:15: RuntimeWarning: CopyCppToPython(): SbkConverter::copyToPython is null for "PySide6.QtGui.QAction".
       a = m.exec_(point)
      None

      Note that the result of the function is None instead of the expected action object. Changing exec_ to exec is working as expected.

        Attachments

        1. menubug.py
          0.6 kB
        2. pyside1625.py
          0.9 kB
        For Gerrit Dashboard: PYSIDE-1625
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            bdev a dev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes