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

the pyside2-uic generate incorrect python code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.2
    • PySide, Tooling
    • None
    • Windows

      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

        1. QQ截图20210430202716.png
          26 kB
          WY WY
        2. QQ截图20210430202806.png
          63 kB
          WY WY
        3. QQ截图20210430202842.png
          70 kB
          WY WY
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            csu_wy WY WY
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes