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

pyside2-uic output with syntax errors (no colons)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 5.14.0
    • Fix Version/s: 5.14.1, 5.14.2
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      windows 10, python 3.8.1
    • Platform/s:
      Windows

      Description

      Python 3.8.1, pyside2 5.14

      In QT Designer I created for example QMainWindow and one QTableWidget in it with some columns and rows.

      after pyside2-uic process I got (fragment):

      self.tableWidget = QTableWidget(self.centralwidget) 
      if (self.tableWidget.columnCount() < 4) 
          self.tableWidget.setColumnCount(4) 
      __qtablewidgetitem = QTableWidgetItem()
      

      So there is SyntaxError: invalid syntax in second row (no colon)

      One more bug:
      I have .ui file with QFrames with same name.
      After pyside2-uic I got a correct error, but not in console - directly in .py file (end fragment):

              ___qtablewidgetitem35.setText(QCoreApplication.translate("MainWindow", u"Ok", None));
          # retranslateUi
      
      Error: mainwindow1.ui: Warning: The name 'frame' (QFrame) is already in use, defaulting to 'frame1'.
      
      mainwindow1.ui: Warning: The name 'frame' (QFrame) is already in use, defaulting to 'frame2'.
      
      mainwindow1.ui: Warning: The name 'frame' (QFrame) is already in use, defaulting to 'frame3'.
      
      mainwindow1.ui: Warning: The name 'frame' (QFrame) is already in use, defaulting to 'frame4'.
      
      mainwindow1.ui: Warning: The name 'frame' (QFrame) is already in use, defaulting to 'frame5'.
      
      mainwindow1.ui: Warning: The name 'frame' (QFrame) is already in use, defaulting to 'frame6'.
      
      
      while executing 'c:\python381\lib\site-packages\PySide2\uic -g python mainwindow1.ui'
      

      Also, instead of UTF-8 text (russian) I got unicode:

      #if QT_CONFIG(tooltip)
              self.btnAlerts.setToolTip(QCoreApplication.translate("MainWindow", u"\u0421\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0442\u0440\u0435\u0432\u043e\u0433", None))
      #endif // QT_CONFIG(tooltip)
              self.btnAlerts.setText(QCoreApplication.translate("MainWindow", u"\u0422\u0440\u0435\u0432\u043e\u0433\u0438", None))
      #if QT_CONFIG(tooltip)
      

      In pyside 5.13 there was normal utf-8.

        Attachments

        1. 11untitled.py
          4 kB
        2. 11untitled.ui
          2 kB
        3. jira.py
          3 kB
        4. pyside1169.ui
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            novd V D
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes