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

pyside2-uic generate wrong signature for QAction components

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 5.15.2
    • Tooling
    • None
    • Linux/Wayland

    Description

      When I used the Python script generated by pyside2-uic, I got the following error:

      Traceback (most recent call last):
      File "/home/minh/gui-project/qtgraph_side.py", line 230, in <module>
      main()
      File "/home/minh/gui-project/qtgraph_side.py", line 222, in main
      window = MainWindow()
      File "/home/minh/gui-project/qtgraph_side.py", line 219, in _init_
      self.ui.setupUi(self)
      File "/home/minh/gui-project/sideui.py", line 21, in setupUi
      self.actionOpen = QAction(MainWindow)
      TypeError: 'PySide2.QtWidgets.QAction' called with wrong argument types:
      PySide2.QtWidgets.QAction(MainWindow)
      Supported signatures:
      PySide2.QtWidgets.QAction(PySide2.QtGui.QIcon, str, typing.Union[PySide2.QtCore.QObject, NoneType] = None)
      PySide2.QtWidgets.QAction(typing.Union[PySide2.QtCore.QObject, NoneType] = None)
      PySide2.QtWidgets.QAction(str, typing.Union[PySide2.QtCore.QObject, NoneType] = None)

      It seems that pyside2-uic generated the wrong signature for QAction. When I tried QUiLoader instead everything worked just fine. However I'd like to generate a script if possible.

      Attachments

        1. gui2.ui
          3 kB
        2. sideui2.py
          5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            alphaomega Nguyen Le Phuc Minh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes