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

pyside2-uic still generates QString

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.14.0
    • PySide
    • None
    • WIndows 10, Python 3.8.1, Qt 5.12.5
    • Windows
    • 7c0341daeef9c975b0e736b9d8a52b9649c6a06c (qt/qtbase/5.14)

    Description

      I'm using pyside2-uic (on Windows) to generate a python file. But some QString are still generated though not supported in a Python3/Qt5 environment. It looks like it appears only when using a QTabWidget object.

      Consequently, the pyside2-uic ends without error, but when running a Python program with the generated code, it logically fails (QString not supported).

      Error message :

      self.tabWidget.addTab(self.tab_options, QString())
      NameError: name 'QString' is not defined

      When I replace the 2 QString() with a python string (like "tab1", "tab2"), the Python program works well.

      In attachment:

      • Original .ui file (located in a qt folder in my project)
      • Generated .py file (located in a qt folder in my project)
      • main.py 

       

      So I guess there is some issue when generating the .py file whith QTabWidget, still generating a QString object like in the older versions.

       

      Attachments

        1. main.py
          0.4 kB
        2. mainwindow.py
          7 kB
        3. main-window.ui
          5 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kleint Friedemann Kleint
              janiko71 Jean GEBAROWSKI
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes