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

pyside2-uic generate wrong treewidget code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.12.4
    • PySide
    • None
    • win10 x64, python3.6.8 32bit
    • Windows

    Description

      1. create UI file with designer
      2. place two tree widgets and add columns
      3. use pyside2-uic to generate python code
      4. check the python code, headerItem().setText set the wrong column index.
      # -*- coding: utf-8 -*-
      
      # Form implementation generated from reading ui file 'tree.ui',
      # licensing of 'tree.ui' applies.
      #
      # Created: Wed Jun 26 08:47:48 2019
      #      by: pyside2-uic  running on PySide2 5.12.4
      #
      # WARNING! All changes made in this file will be lost!
      
      from PySide2 import QtCore, QtGui, QtWidgets
      
      class Ui_Form(object):
          def setupUi(self, Form):
              Form.setObjectName("Form")
              Form.resize(338, 468)
              self.treeWidget = QtWidgets.QTreeWidget(Form)
              self.treeWidget.setGeometry(QtCore.QRect(40, 30, 256, 192))
              self.treeWidget.setObjectName("treeWidget")
              self.treeWidget_2 = QtWidgets.QTreeWidget(Form)
              self.treeWidget_2.setGeometry(QtCore.QRect(40, 250, 256, 192))
              self.treeWidget_2.setObjectName("treeWidget_2")
      
              self.retranslateUi(Form)
              QtCore.QMetaObject.connectSlotsByName(Form)
      
          def retranslateUi(self, Form):
              Form.setWindowTitle(QtWidgets.QApplication.translate("Form", "Form", None, -1))
              self.treeWidget.headerItem().setText(0, QtWidgets.QApplication.translate("Form", "aaa", None, -1))
              self.treeWidget_2.headerItem().setText(1, QtWidgets.QApplication.translate("Form", "bbb", None, -1))
      

      Attachments

        1. tree.ui
          1 kB
        2. Ui_tree.py
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            wzzgdcn Weizhen Zheng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes