kiriloff
kiriloff

Reputation: 26333

Qt Designer code generation issue

I am using Qt Designer. When I lauch the code generation (View code), I have the following issue:

Code Generation Failed 
Unable to launch C:/Python27/Lib/site-packages/PyQt4\uic.

I tried to use the tips here

You can generate code by using the pyuic4.bat file 
located under the PyQt4 install directory, on Win usually
C:/Python##/Lib/site-packages/PyQt4. 
Usage from the command line is:
pyuic4.bat inputfile.ui > output.py

pyuic4.bat inputfile.ui > output.py gives me an output.py file, but launching this output.py script gives nothing. The execution is pending for a while, then stop. I don't know if code has been generated / where it should have been generated ... What I would like is the code in C++/Qt. What should I do once I have output.py ?

Could somebody explain more precisely how to proceed ? Is this tip making possible to see the rendering of the UI, or the generated code (which I want) ? Where can I find the code ? What is another working trick ?

Upvotes: 0

Views: 7370

Answers (1)

kiriloff
kiriloff

Reputation: 26333

You can do this way to generate C++ file

cmd

uic -o sample.h sample.ui

with sample.ui the .ui file first saved with Qt Designer. Code is generated in sample.h

Upvotes: 1

Related Questions