[PyQt] A potential pyuic (5.3) bug

Xinkai yeled.nova at gmail.com
Fri Jun 20 08:56:24 BST 2014


Hi,

I think I may have found a bug in PyQt 5.3.

Steps to reproduce:

1. "pyuic5 -o ui.py" the following

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>Form</class>
 <widget class="QWidget" name="Form">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>400</width>
    <height>300</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>Form</string>
  </property>
  <widget class="QTableWidget" name="tableWidget">
   <property name="geometry">
    <rect>
     <x>10</x>
     <y>10</y>
     <width>381</width>
     <height>271</height>
    </rect>
   </property>
   <column>
    <property name="text">
     <string>Column1</string>
    </property>
   </column>
   <column>
    <property name="text">
     <string>Column2</string>
    </property>
   </column>
   <column>
    <property name="text">
     <string>Column3</string>
    </property>
   </column>
  </widget>
 </widget>
 <resources/>
 <connections/>
</ui>

2. Notice that in the compiled ui.py, there are no
/setColumnCount//(//)/ and /setRowCount//(//)/, which will cause problems.
3. Run the following code with ui.py, exception.

#!/usr/bin/python3

from PyQt5.QtWidgets import QApplication, QDialog
import sys

from ui import Ui_Form

class MyDlg(QDialog, Ui_Form):
    def __init__(self, parent = None):
        super().__init__(parent)
        self.setupUi(self)

class DummyApp(QApplication):
    def __init__(self, *args):
        super().__init__(*args)
        self.dlg = MyDlg()
        self.dlg.show()

if __name__ == "__main__":
    app = DummyApp([])
    sys.exit(app.exec())

4. All of these don't happen with pyuic5 (5.2)


My environment: Archlinux 64bit + Python 3.4 + PyQt 5.3-1. I also tried
to compile the PyQt package on my own, didn't help.


Thanks in advance,

Xinkai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140620/1f9c587c/attachment.html>


More information about the PyQt mailing list