LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-22-2009, 11:45 PM   #1
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 109

Rep: Reputation: 15
Cool generate Qt code with pyuic4


Hello Everybody....

I have used Qt Designer to generate a basic GUI. The file saved from Qt Designer I named it myGUI.ui .

Now, I have to generate from myGUI.ui the ui_myGUI.py, right? To get this done, we must run pyuic4, directly or via mkpuqt.py or Make PyQt. I tried to get it done, so went into the Py25 console:

Code:
pyuic4 -o C:\dev\prgr\src\ui_myGUI.py C:\dev\prgr\src\myGUI.ui
The system cannot find the path specified.
Then to be sure, I moved the file myGUI.ui to the folder where is found the pyuic4, and run again...

Code:
pyuic4 -o ui_myGUI.py myGUI.ui
The system cannot find the path specified.
I didn't figure out how to get it running.

I googled around and didn't find much useful material or any practical example/setup on internet about how to put the pyuic4 to generate the ui_myGUI.py.

Of course the better would be to run pyuic4 directly from the Eclipse IDE, which I have integrated and compiling Python 2.5 and 2.6. However, no way is working.

What I am doing wrong, or what is missing here?

All comments or suggestions are mostly appreciated.

Last edited by threaderslash; 09-23-2009 at 07:30 AM.
 
Old 09-23-2009, 05:27 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,094

Rep: Reputation: 104Reputation: 104
it means that pyuic4 (what that?) is not where you think it is
or the path enviroment variable is set wrong
 
Old 09-23-2009, 08:17 PM   #3
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 109

Original Poster
Rep: Reputation: 15
Lightbulb

Yep.. the ..!\Py25\Lib\site-packages\PyQt4 is included into the System Properties : Environment Variables : Path.

Also, just tried.. on console:

Code:
pyuic4 -o C:\dev\prgr\src\ui_myGUI.py -x C:\dev\prgr\src\myGUI.ui
The system cannot find the path specified.

pyuic4 -o ui_myGUI.py -x myGUI.ui
The system cannot find the path specified.
Still gives the same error.

Very strange. Maybe it seems to be a bug .. see: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523059 .

Any light please?

Last edited by threaderslash; 09-23-2009 at 08:37 PM.
 
Old 09-23-2009, 08:38 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,094

Rep: Reputation: 104Reputation: 104
try using a full path to pyuic4
 
Old 09-23-2009, 11:24 PM   #5
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 109

Original Poster
Rep: Reputation: 15
Wink

Using the console, I went into the directory where is found the pyuic4, so ..!\Py25\Lib\site-packages\PyQt4. Copied the file myGUI.ui there. Then run the command:

Code:
pyuic4 -o ui_myGUI.py -x myGUI.ui
The system cannot find the path specified.
Any other ideas?
 
Old 09-24-2009, 07:26 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,302

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
A library ( e.g. pyuic4.so ) is not found by 'cd'
to it's location.

Must either be in the LD_LIBRARY_PATH , or you must
start all commands with e.g. : ( Linux )
export LD_LIBRARY_PATH=/usr/lib/qt4/lib
( please replace with actual path.)

All path's can be detected with the command : 'env | grep PATH

.....
Why use "back slashes" ( \ ) ? ?
Isn't it a Linux system ?
.....

Last edited by knudfl; 09-24-2009 at 07:28 AM.
 
Old 09-24-2009, 07:48 PM   #7
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 109

Original Poster
Rep: Reputation: 15
Yep.. The project is a development for a customer, and they only use windows. To define PATH on Win, you go in the graphic mode to the Enviroment Variables and set it to PATH.
 
Old 11-05-2009, 02:51 AM   #8
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 109

Original Poster
Rep: Reputation: 15
Lightbulb Solved: generate QtPython code from QtDesigner

Here is how to setup the Qt Designer to generate the QtPython code on Eclipse IDE:
http://groups.google.com/group/pytho...5297a34dccc2c2
Thanks Brendan - for the nice tutorial. It really works!
 
  


Reply

Tags
member


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation problems of c++ files in ns-2.33 to generate the object code. shyan Linux - Newbie 4 12-14-2010 07:29 AM
Generate CA help saman Linux - Wireless Networking 1 04-22-2008 05:25 AM
Java: Generate html code Clemente Programming 6 11-26-2006 01:39 PM
how to generate .so abd_bela Programming 1 01-31-2006 04:12 AM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM


All times are GMT -5. The time now is 04:37 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration