The Ultimate Qt Community site
Home News Forum Wiki Contest FAQ Links

Go Back   Qt Centre Forum > Qt > Qt Designer

Qt Designer Qt Designer oriented issues.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 28th June 2008, 11:59
pnikolov's Avatar
pnikolov pnikolov is offline
Beginner
 
Join Date: Jun 2008
Location: Bulgaria
Qt products used: Qt4
Qt platforms used: Windows
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Question PyQt4 - Code generation faied: unable to launch...

Hello,

I am trying to use PyQt4 Designer, but I am having troubles running it. The Designer is runnig weell but when I go to Form -> View Code... an error ocurrs: Unable to lounch C:/Python25/PyQt4/bin\uic
I tried reinstalling it, etc., no solution.
I use PyQt4 installed from binary gpl
I use Python 2.5.2
When I type python in CMD the Python starts corretly
When i type in Python shell import PyQt4, it is importing corretly.
I use Windows Vista Ultimate SP1

Can you help me to make my PyQt4 Designer work

All the Best!

Reply With Quote
  #2  
Old 2nd July 2008, 10:55
igor71 igor71 is offline
Beginner
 
Join Date: Jun 2008
Qt products used: Qt4
Qt platforms used: Windows
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: PyQt4 - Code generation faied: unable to launch...

Maybe you should generate python code with pyuic4.bat file which installs in
c:\pythonXX dir?
pyuic4.bat youfile.ui >generated.py helps?

I personally load those ui files on the fly without generating python code:
something like this works for me:
Qt Code:
  1. import sys
  2. from PyQt4 import QtCore,QtGui,uic
  3. form_class, base_class = uic.loadUiType("unnamed.ui")
  4.  
  5. class MyWidget (QtGui.QWidget, form_class):
  6.     def __init__(self,parent=None,selected=[],flag=0,*args):
  7.         QtGui.QWidget.__init__(self,parent,*args)
  8.         self.setupUi(self)
  9. if __name__ == '__main__':
  10.     app = QtGui.QApplication(sys.argv)
  11.     form = MyWidget(None)
  12.     form.show()
  13.     app.exec_()
Try this little script with your ui file.

Reply With Quote
  #3  
Old 2nd July 2008, 22:05
pnikolov's Avatar
pnikolov pnikolov is offline
Beginner
 
Join Date: Jun 2008
Location: Bulgaria
Qt products used: Qt4
Qt platforms used: Windows
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: PyQt4 - Code generation faied: unable to launch...

Thank you for the support.
Yes I`ve already used the pyuic4.bat and pyrcc4.exe from the command line.. and it works fine.

Are there any advantages using the .ui file instead of the generated .py, optimization or something else?
__________________
http://www.nikolov.biz
Be smart!
Reply With Quote
  #4  
Old 3rd July 2008, 14:45
igor71 igor71 is offline
Beginner
 
Join Date: Jun 2008
Qt products used: Qt4
Qt platforms used: Windows
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: PyQt4 - Code generation faied: unable to launch...

Main advantage: no need to generate code
Just load ui file instead of loading generated code.
Disadvantage i think is a speed of execution.
May be it's a little slower than running pre-generated files...

Reply With Quote
  #5  
Old 16th July 2008, 23:29
Lighther Lighther is offline
Beginner
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: PyQt4 - Code generation faied: unable to launch...

Hi, I tried to use the script but I got the following error:

Canīt get _Z10forcepointR11QTextStream from the dinamic link library of Qtcore.dll

I need help!!!

I'm using Python 2.5 and PyQt v4.4.2

Edit: I have some problems importing QtCore!!!

Edit2: I have solved the error that was launched when I tried to compile the .ui file, if you have the same problem with the Qtcore4.dll on windows, you must copy Qtcore4.dll (C:\Python25\Lib\site-packages\PyQt4 in my PC) and paste it in windows/system32. It looks so primitive but it worked. Now my problem is to run de .py code because the "Import QtGui" sentence throws a DLL error again, I'll get crazy about this T_______T

Final Edit: Ok I solved it again, On windows we must copy and paste the DLL files into system32 folder to make them work with our .py file. Maybe some imports like QtCore and QtGui will throw a DLL error so If you have installed PyQt v4.4.2 on windows and you are using python 2.5 maybe you will have this path directory C:\Python25\PyQt4\bin.

In this folder you can find all de DLLs needed for using PyQt and you just have to copy them as you need them.

Once you have copied the DLL files you can compile de .ui file using the next command on console (cdm), and you must be loceted in the folder where you have the .ui file

pyuic4 -o fileName.py -x yourFileName.ui

and this will make your .py file from the .ui file

I hope my English writting becomes fine to understood

Last edited by Lighther; 17th July 2008 at 01:29.
Reply With Quote
Reply

Bookmarks

Tags
designer, problem, problem generate code, pyqt4, uic

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:36.

Powered by vBulletin Version 3.7.1 Copyright ©2000 - 2008, Jelsoft Enterprises Ltd., vRewrite 1.5 SEOed URLs completed by Tech Help Forum and Chalo Na.
© 2006–2008 Qt Centre - The Ultimate Qt Community site
Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.