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

PySide2-uic generated code missing import for QCursor

    XMLWordPrintable

Details

    • 21a14767b30f6f8d27b06e609ec8eaa5ddffb324 (qt/qtbase/5.14)

    Description

      Running pyside2-uic on a .ui file containing a definition for property "cursor" generates code which doesn't have QCursor imported. Running a project with the generated code results in

        File "C:\test\ui_mainwindow.py", line 28, in setupUi
          self.label.setCursor(QCursor(Qt.SizeFDiagCursor))
      NameError: name 'QCursor' is not defined
      

      See the attached ui_mainwindow.py for reference.

      Steps to reproduce:

      1. Run pyside2-uic on the attached .ui file

      Attachments

        1. mainwindow.ui
          1 kB
        2. ui_mainwindow.py
          2 kB
        For Gerrit Dashboard: PYSIDE-1182
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            miikapernu Miika Pernu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes