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

PySide2-uic generated code missing import for QCursor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.14.0
    • Fix Version/s: None
    • Component/s: PySide
    • Commits:
      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
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            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