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

the pyside2-uic generate incorrect python code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.15.2
    • PySide, Tooling
    • None
    • 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

            crmaurei Cristian Maureira-Fredes
            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