GUI - Qt Designer

J

John Bradbury

Is there any way to take the output produced by Qt designer (or any other
GUI designer) and use it in Python to create a screen? There must be a
better way of creating screens than having to use the TkInter routnes and
add every widget one by one in the program.

John Bradbury
 
P

Phil Thompson

Is there any way to take the output produced by Qt designer (or any other
GUI designer) and use it in Python to create a screen? There must be a
better way of creating screens than having to use the TkInter routnes and
add every widget one by one in the program.

Use the pyuic utility that comes with PyQt.

Phil
 
J

John J. Lee

John Bradbury said:
Is there any way to take the output produced by Qt designer (or any
other GUI designer) and use it in Python to create a screen? There
[...]

PyQt. It includes pyuic, which does what you want.


John
 
E

Eric Williams

John said:
Is there any way to take the output produced by Qt designer (or any other
GUI designer) and use it in Python to create a screen? There must be a
better way of creating screens than having to use the TkInter routnes and
add every widget one by one in the program.

John Bradbury


You need PyQt and/or PyKDE.

You can use pyuic DialogWhatever.ui > DialogWhatever.py to convert the
QtDesigner *.ui file to a python file.

Then you can import it into a PyQt app and use it like any other python Qt
class.

One warning, however: It's not as easily portable as Tkinter. On windows,
especially, it's pretty much only usable if you've bought the full Qt
Commercial verson. The free version of Qt/Win only goes up to version 2.3.

Boa-constructor is alpha still, but usable to make wxPython apps in a RAD
environment.

PythonCard was another alternative, but I'm not sure if it's still being
maintained.

Hope that helps!

cya,
Eric
 
J

Jarek Zgoda

John Bradbury said:
Is there any way to take the output produced by Qt designer (or any other
GUI designer) and use it in Python to create a screen?

You are not limited to PyQt, wxPython has few nice GUI designers, of
which wxGLADE seems to be the easiest to use. Or -- at you will -- you
can use xrc resources, wchich are native to wxWindows and can be shared
between wxPython and wxWindows applications.

The window designs (frames, forms) created with Qt Designer can be
translated to Python code using pyuic tool. BlackAdder IDE has this
support built-in, although I never tried this approach.
 
J

John Bradbury

Phil said:
Use the pyuic utility that comes with PyQt.

Phil


Thanks everyone for the very helpful repsonses. It seems to be a topic whch
is not covered fully in the books ( at least the ones I have).

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top