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

the pyside2-uic generate incorrect python code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Component/s: PySide, Tooling
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      I'am using Qt designer to design UI, then
      pyside2-uic ./source/mainwindow.ui -o ./template/ui_mainwindow.py
      but the python code is incorrect:

      self.scrollArea.setObjectName(u"scrollArea")
      self.scrollArea.setGeometry(QRect(0, 0, 1131, 771))
      self.scrollArea.setWidgetResizable(True)
      self.scrollAreaWidgetContents = QWidget()
      self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
      self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 1129, 769))
      self.verticalLayoutWidget = QWidget(self.scrollAreaWidgetContents)
      self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget")
      self.verticalLayoutWidget.setGeometry(QRect(0, 0, 1121, 771))
      self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget)
      self.verticalLayout.setObjectName(u"verticalLayout")
      self.verticalLayout.setContentsMargins(0, 0, 0, 0)
      self.scrollArea.setWidget(self.scrollAreaWidgetContents)

       

      when i use the above code, the scrollbar was invalid, so i change it to this:

       

      self.scrollArea = QScrollArea(self.data_tab)
      self.scrollArea.setObjectName(u"scrollArea")
      self.scrollArea.setGeometry(QRect(0, 0, 1131, 771))
      self.scrollArea.setWidgetResizable(True)
      self.scrollAreaWidgetContents = QWidget()
      self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
      self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 1129, 769))
      # self.verticalLayoutWidget = QWidget(self.scrollAreaWidgetContents)
      # self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget")
      # self.verticalLayoutWidget.setGeometry(QRect(0, 0, 1121, 771))
      self.verticalLayout = QVBoxLayout(self.scrollAreaWidgetContents)
      self.verticalLayout.setObjectName(u"verticalLayout")
      self.verticalLayout.setContentsMargins(0, 0, 0, 0)
      self.scrollArea.setWidget(self.scrollAreaWidgetContents)

       

      the pyside2-uic generate a superfluous widget

        Attachments

        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:
            csu_wy WY WY
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes