<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I think I may have found a bug in PyQt 5.3.<br>
<br>
Steps to reproduce:<br>
<br>
1. "pyuic5 -o ui.py" the following<br>
<br>
<font color="#006600"><?xml version="1.0" encoding="UTF-8"?><br>
<ui version="4.0"><br>
<class>Form</class><br>
<widget class="QWidget" name="Form"><br>
<property name="geometry"><br>
<rect><br>
<x>0</x><br>
<y>0</y><br>
<width>400</width><br>
<height>300</height><br>
</rect><br>
</property><br>
<property name="windowTitle"><br>
<string>Form</string><br>
</property><br>
<widget class="QTableWidget" name="tableWidget"><br>
<property name="geometry"><br>
<rect><br>
<x>10</x><br>
<y>10</y><br>
<width>381</width><br>
<height>271</height><br>
</rect><br>
</property><br>
<column><br>
<property name="text"><br>
<string>Column1</string><br>
</property><br>
</column><br>
<column><br>
<property name="text"><br>
<string>Column2</string><br>
</property><br>
</column><br>
<column><br>
<property name="text"><br>
<string>Column3</string><br>
</property><br>
</column><br>
</widget><br>
</widget><br>
<resources/><br>
<connections/><br>
</ui></font><br>
<br>
2. Notice that in the compiled ui.py, there are no <i><span
class="n">setColumnCount</span></i><i><span class="p">(</span></i><i><span
class="p">)</span></i> and <i><span class="n">setRowCount</span></i><i><span
class="p">(</span></i><i><span class="p">)</span></i>, which
will cause problems.<br>
3. Run the following code with ui.py, exception.<br>
<br>
<font color="#006600">#!/usr/bin/python3<br>
<br>
from PyQt5.QtWidgets import QApplication, QDialog<br>
import sys<br>
<br>
from ui import Ui_Form<br>
<br>
class MyDlg(QDialog, Ui_Form):<br>
def __init__(self, parent = None):<br>
super().__init__(parent)<br>
self.setupUi(self)<br>
<br>
class DummyApp(QApplication):<br>
def __init__(self, *args):<br>
super().__init__(*args)<br>
self.dlg = MyDlg()<br>
self.dlg.show()<br>
<br>
if __name__ == "__main__":<br>
app = DummyApp([])<br>
sys.exit(app.exec())</font><br>
<br>
4. All of these don't happen with pyuic5 (5.2)<br>
<br>
<br>
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.<br>
<br>
<br>
Thanks in advance,<br>
<br>
Xinkai<br>
</body>
</html>