[PyQt] Bug in custom widget using QStringList when using pyuic

Vincent van Beveren V.vanBeveren at rijnhuizen.nl
Fri Mar 12 10:23:39 GMT 2010


Hi everyone,

I have created a custom component which uses a QStringList as property value. This goes fine in designer, however, when using pyuic4 to compile the component it messes things up. This is the python code produced:

# === header removed
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(161, 161)
        self.QPyLedArray = QPyLedArray(Form)
        self.QPyLedArray.setGeometry(QtCore.QRect(12, 12, 68, 134))
        self.QPyLedArray.setNames([<PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C590>, <PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C5D0>, <PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C5F0>, <PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C630>, <PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C690>, <PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C6F0>, <PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C750>, <PyQt4.uic.Compiler.qtproxies.i18n_string object at 0x00C0C790>])
        self.QPyLedArray.setVerticalMode(True)
        self.QPyLedArray.setObjectName("QPyLedArray")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        Form.setWindowTitle(QtGui.QApplication.translate("Form", "QStringList", None, QtGui.QApplication.UnicodeUTF8))

from rijnh.qt.widgets.qpyledarray import QPyLedArray
# ===

As you can see the setNames is messed up. I've useds pyQt 4.4.3 and pyQt 4.6. Both have the same issue. I have attached the qpyledarray.py so you can try to compile it. You will need to edit the qledarrayfails.ui with a text-editor and set the correct package.

Regards,
Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100312/d3a691fd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qpyledarray.py
Type: application/octet-stream
Size: 24270 bytes
Desc: qpyledarray.py
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100312/d3a691fd/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qledarrayfails.ui
Type: application/octet-stream
Size: 1119 bytes
Desc: qledarrayfails.ui
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100312/d3a691fd/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qledarrayfails.py
Type: application/octet-stream
Size: 1478 bytes
Desc: qledarrayfails.py
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100312/d3a691fd/attachment-0005.obj>


More information about the PyQt mailing list