[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] pyuic4 strange behavior
From:       Marco Fabiani <himork () kth ! se>
Date:       2008-08-26 9:30:31
Message-ID: 48B3CD37.8030909 () kth ! se
[Download RAW message or body]

Hello,

I am trying to generate some python code from a Qt Designer file with 
pyuic4. In my GUI I have a custom widget written in python (see another 
of my posts).
The code of the custom widget start with the usual "from PyQt4 import 
QtCore, QtGui".

Now, if I run pyuic4 I get this error message:

---
Traceback (most recent call last):
   File "/Library/Python/2.5/site-packages/PyQt4/uic/pyuic.py", line 73, 
in <module>
     options.indent, options.pyqt3_wrapper)
   File "/Library/Python/2.5/site-packages/PyQt4/uic/pyuic.py", line 28, 
in generateUi
     uic.compileUi(uifname, pyfile, execute, indent, pyqt3_wrapper)
   File "/Library/Python/2.5/site-packages/PyQt4/uic/__init__.py", line 
66, in compileUi
     winfo = compiler.UICompiler().compileUi(uifile, pyfile)
   File 
"/Library/Python/2.5/site-packages/PyQt4/uic/Compiler/compiler.py", line 
15, in __init__
     CompilerCreatorPolicy())
   File "/Library/Python/2.5/site-packages/PyQt4/uic/uiparser.py", line 
88, in __init__
     self.factory = QObjectCreator(creatorPolicy)
   File "/Library/Python/2.5/site-packages/PyQt4/uic/objcreator.py", 
line 53, in __init__
     raise WidgetPluginError, "%s: %s" % (e.__class__, str(e))
WidgetPluginError: <type 'exceptions.NameError'>: name 'QtCore' is not 
defined
---

I tried to play around with the widget's file, and surprisingly if I 
change the custom widget code to "from PyQt4 import xxx, QtGui" (where 
xxx can be anything except QtCore) I manage to get my python code 
generated, and it also appears to work...

Is that a bug?
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic