[PyQt] pyuic4 addItem issue

Hans-Peter Jansen hpj at urpla.net
Sat Jun 20 14:16:24 BST 2009


Hi Phil,

attached is a ui file, generated with designer of Qt 4.5.1, that throws 
this exception:

> pyuic4 -dp configdialogbase.ui
PyQt4.uic.uiparser: UI version is 4.0
PyQt4.uic.uiparser: uiname is ConfigDialogBase
PyQt4.uic.uiparser: toplevel widget is QDialog
PyQt4.uic.properties: setting property geometry
PyQt4.uic.properties: setting property windowTitle
PyQt4.uic.uiparser: push QDialog ConfigDialogBase
PyQt4.uic.uiparser: push QGridLayout gridLayout_3
PyQt4.uic.uiparser: push QHBoxLayout horizontalLayout
PyQt4.uic.properties: setting property sizePolicy
PyQt4.uic.properties: setting property minimumSize
PyQt4.uic.properties: setting property maximumSize
PyQt4.uic.properties: setting property baseSize
PyQt4.uic.properties: setting property tabKeyNavigation
PyQt4.uic.properties: setting property movement
PyQt4.uic.properties: Static
PyQt4.uic.properties: setting property flow
PyQt4.uic.properties: TopToBottom
PyQt4.uic.properties: setting property viewMode
PyQt4.uic.properties: IconMode
PyQt4.uic.uiparser: push QListWidget lwConfig
PyQt4.uic.uiparser: pop widget QListWidget lwConfig
PyQt4.uic.uiparser: new topwidget <PyQt4.QtGui.QDialog object at 0x8192bec>
PyQt4.uic.properties: setting property sizePolicy
PyQt4.uic.properties: setting property currentIndex
PyQt4.uic.uiparser: push QTabWidget twConfig
PyQt4.uic.uiparser: push QWidget generalTab
PyQt4.uic.uiparser: push QGridLayout gridLayout_2
PyQt4.uic.properties: setting property title
PyQt4.uic.uiparser: push QGroupBox groupBox
PyQt4.uic.uiparser: push QFormLayout formLayout
PyQt4.uic.properties: setting property text
PyQt4.uic.properties: setting property buddy
PyQt4.uic.uiparser: push QLabel lbName
PyQt4.uic.uiparser: pop widget QLabel lbName
PyQt4.uic.uiparser: new topwidget <PyQt4.QtGui.QGroupBox object at 0x818e42c>
PyQt4.uic.uiparser: push QLineEdit leName
PyQt4.uic.uiparser: pop widget QLineEdit leName
PyQt4.uic.uiparser: new topwidget <PyQt4.QtGui.QGroupBox object at 0x818e42c>
PyQt4.uic.properties: setting property text
PyQt4.uic.properties: setting property buddy
PyQt4.uic.uiparser: push QLabel lbEmail
PyQt4.uic.uiparser: pop widget QLabel lbEmail
PyQt4.uic.uiparser: new topwidget <PyQt4.QtGui.QGroupBox object at 0x818e42c>
PyQt4.uic.uiparser: push QLineEdit leEmail
PyQt4.uic.uiparser: pop widget QLineEdit leEmail
PyQt4.uic.uiparser: new topwidget <PyQt4.QtGui.QGroupBox object at 0x818e42c>
PyQt4.uic.properties: setting property text
PyQt4.uic.properties: setting property buddy
PyQt4.uic.uiparser: push QLabel lbMailServer
PyQt4.uic.uiparser: pop widget QLabel lbMailServer
PyQt4.uic.uiparser: new topwidget <PyQt4.QtGui.QGroupBox object at 0x818e42c>
PyQt4.uic.uiparser: push QLineEdit leMailServer
PyQt4.uic.uiparser: pop widget QLineEdit leMailServer
PyQt4.uic.uiparser: new topwidget <PyQt4.QtGui.QGroupBox object at 0x818e42c>
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/port_v2/invoke.py", line 12, in invoke
    exit_status = driver.invoke()
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/driver.py", line 35, in invoke
    return self._preview()
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/driver.py", line 49, in _preview
    widget = loadUi(self._ui_file)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/__init__.py", line 112, in loadUi
    return DynamicUILoader().loadUi(uifile, baseinstance)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/Loader/loader.py", line 21, in loadUi
    return self.parse(filename)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 700, in parse
    actor(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 548, in createUserInterface
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 329, in createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 349, in handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 329, in createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 349, in handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 168, in createWidget
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 168, in createWidget
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 329, in createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 349, in handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 168, in createWidget
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 329, in createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 349, in handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 526, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.6/site-packages/PyQt4/uic/uiparser.py", line 266, in createSpacer
    self.stack.peek().addItem(spacer, *elem.attrib["grid-position"])
TypeError: too many arguments to QFormLayout.addItem(), 1 at most expected

Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configdialogbase.ui
Type: application/x-designer
Size: 6141 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090620/59d310e6/configdialogbase.bin


More information about the PyQt mailing list