[PyQt] A potential pyuic (5.3) bug

Richard Duivenvoorde rdmailings at duif.net
Fri Jun 20 09:02:08 BST 2014


Hi,

I think it is the same problem as the one I hit, see this thread:

http://www.riverbankcomputing.com/pipermail/pyqt/2014-June/034399.html

which is fixed in master if I'm correct.

Regards,

Richard Duivenvoorde

On 20-06-14 09:56, Xinkai wrote:
> 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
> 
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 



More information about the PyQt mailing list