pyuic4 Issues

Need help with C, C++, perl, python, etc?

pyuic4 Issues

Postby bracprogrammer » 2007-01-26 20:54

I'm developing a program using Qt Designer (4) and PyQt (4). pyuic4, however, keeps spitting out an error. Despite my best google efforts, I can't figure out a solution. I'll post the code below, and thanks for any advice you guys might have.

sql@mysql:~/Desktop/Project$ pyuic4 -d main.ui
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'main.ui'
# Created: Fri Jan 26 12:44:56 2007
# by: PyQt4 UI code generator 4.0.1
# WARNING! All changes made in this file will be lost!

import sys
DEBUG:root:UI version is 4.0
DEBUG:root:uiname is MainWindow
from PyQt4 import QtCore, QtGui

class Ui_MainWindow(object):
def setupUi(self, MainWindow):
DEBUG:root:toplevel widget is QMainWindow

palette = QtGui.QPalette()
Traceback (most recent call last):
File "/usr/bin/pyuic4", line 65, in ?
error = generateUi(args[1], options.output, options.execute, options.indent)
File "/usr/bin/pyuic4", line 28, in generateUi
uic.compileUi(uifname, pyfile, execute, indent)
File "/usr/lib/python2.4/site-packages/PyQt4/uic/", line 54, in compileUi
winfo = compiler.UICompiler().compileUi(uifile, pyfile)
File "/usr/lib/python2.4/site-packages/PyQt4/uic/Compiler/", line 65, in compileUi
w = self.parse(input_stream)
File "/usr/lib/python2.4/site-packages/PyQt4/uic/", line 452, in parse
File "/usr/lib/python2.4/site-packages/PyQt4/uic/", line 319, in createUserInterface
self.wprops.setProperties(self.toplevelWidget, elem)
File "/usr/lib/python2.4/site-packages/PyQt4/uic/", line 159, in setProperties
getattr(self, propname)(widget, prop)
File "/usr/lib/python2.4/site-packages/PyQt4/uic/", line 226, in palette
File "/usr/lib/python2.4/site-packages/PyQt4/uic/", line 69, in _color
return QtGui.QColor(*int_list(prop))
File "/usr/lib/python2.4/site-packages/PyQt4/uic/", line 10, in int_list
return [int(child.text) for child in iter(prop)]
ValueError: invalid literal for int():
Posts: 1
Joined: 2007-01-26 20:47

Postby thamarok » 2007-01-26 22:04

It could be something wrong with your source code.. if you could post it, I think some QT gurus could help you.

Postby ajdlinux » 2007-01-26 22:37

Yes, please post your UI file, otherwise it's a bit hard to track down :)
Spammers, email this:
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby Lavene » 2007-01-27 06:14

Just a tip: Phil Thompson, the creator of PyQt, is very active on the PyKDE mailing list and on the comp.lang.python newsgroup. Both are very friendly and helpful groups too (personally I prefer the usenet group).

Anyway, as 'ajdlinux' is saying it's hard to say what's wrong without your .ui file.

Site admin
Posts: 5096
Joined: 2006-01-04 04:26
Location: Oslo, Norway

Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests