Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pygtk2 vs. pyqt. pros and cons

84 views
Skip to first unread message

gabor

unread,
Feb 28, 2003, 7:46:59 PM2/28/03
to
hi,

i have to decide between pyqt and pygtk ( i simply find tkinter ugly :).
sorry about that, it's a personal choice ).

so if you are familiar with both of them,
please tell me about your experiences, and
tell me which one do you recommend.

thanks,
gabor
--
That's life for you, said McDunn. Someone always waiting for someone
who never comes home. Always someone loving something more than that
thing loves them. And after awhile you want to destroy whatever
that thing is, so it can't hurt you no more.
-- R. Bradbury, "The Fog Horn"

i...@nospamamaze.nl

unread,
Mar 1, 2003, 8:21:13 AM3/1/03
to
gabor <ga...@z10n.net> wrote:
: hi,

:
: i have to decide between pyqt and pygtk ( i simply find tkinter ugly :).
: sorry about that, it's a personal choice ).
:
: so if you are familiar with both of them,
: please tell me about your experiences, and
: tell me which one do you recommend.
:

I've been doing some UI selection myself lately. Here are some pro's / cons:

Tkinter:
Pro's:
- Default with python
- works on Windows and Unix
- Works with Twisted (www.twistedmatrix.com)
Con's:
- Ugly widgets
- Limited functionality (i.e. single column listbox) - only usable
with extensions
- IMHO: Api is not very nice

GTK:
Pro's:
- Glade (!)
- Themability
- Quite functional widgets (though still limited in 1.2)
- Works with Twisted (www.twistedmatrix.com)
Con's:
- Doesn't really work on windows

wxPython:
Pro's:
- cross platform with native look and feel
- very large and functional widget set
Con's:
- Doesn't work well with Twisted at this moment (requires ugly hack)
- Not always very stable (exprienced this myself, and heard others
complain about this)

Boa is not considered a Pro with wxWindows - it's unstable (got it
to crash in 30 minutes, but that might be a wxWindows issue),
doesn't run out of the box (requires some string imports), which gives
me the feeling this is a very immature project. The Interface designer
isn't really impressive either.

QT:
Pro's:
- does what you expect from a GUI toolkit, haven't looked into it too
much though
- portable accross unix/windows
Con's:
- QT is only free under X11, as far as I know


Except for Glade, there aren't any good interface builders, and portability
to windows is a strict requirement for my project, so I'm currently looking
into wxPython. Too bad the wxPython / wxWindows documents aren't downloadable
(as far as I could see)

Cheers

Ivo

--
Drs. I.R. van der Wijk -=-
Brouwersgracht 132 Amaze Internet Services V.O.F.
1013 HA Amsterdam -=-
Tel: +31-20-4688336 Linux/Web/Zope/SQL
Fax: +31-20-4688337 Network Solutions
Web: http://www.amaze.nl/ Consultancy
Email: i...@nospamAmaze.nl -=-

David M. Cook

unread,
Mar 1, 2003, 8:46:39 AM3/1/03
to
In article <mailman.1046479682...@python.org>, gabor wrote:

> i have to decide between pyqt and pygtk ( i simply find tkinter ugly :).
> sorry about that, it's a personal choice ).

I would suggest playing a bit with glade and pygtk, or qdesigner and pyQt to
see which you like more. Don't forget wxpython and Boa Constructor.

The best source of info on pygtk is at

http://www.async.com.br/faq/pygtk/index.py?req=all

Dave Cook

Geoff Gerrietts

unread,
Feb 28, 2003, 9:44:47 PM2/28/03
to
Quoting gabor (ga...@z10n.net):
> so if you are familiar with both of them,
> please tell me about your experiences, and
> tell me which one do you recommend.

I just spent a little time developing a pyqt version of a pygtk tool I
had previously written. I'm not tremendously experienced, but I've
written code in both GUIs: I've written a lot more pygtk code, but
it's all based on the Gtk 1 toolkit, so times have probably changed
around me.

Under pygtk and gtk, I developed "both ways": doing things by hand,
and doing things with Glade + libglade. Of the two, the former was
cleaner and the latter was more convenient. Neither was preferable to
using Qt Designer and pyuic to generate template code. So, in the
"ease of rapid development" camp, I would hafta say qt kicks the snot
out of gtk.

Under qt, the generated code is built onto a single class, which you
are expected to subclass and fill out with handlers. The resulting
architecture has your "widgets" in a generated module, then your
handlers in a second module, and the two linked by inheritance. Under
gtk, I never developed this way, though I could have: I had handlers
in one class hierarchy, and widgets in another, and I used some
unfortunate black magic to blend the two.

I personally prefer using composition to inheritance for this (better
reusability), but neither architecture did a terribly good job of
permitting me this option. Gtk has the dubious distinction of making
it possible.

I had some real problems coming up with a convenient way to make a
combo box or selection widget work for me under Gtk. I saw a couple
posts around indicating that the API for some of these things changed
in Gtk 2, but the change didn't seem dramatic enough for my tastes. I
found it much easier to get these controls working "as expected" under
Qt -- but if I wanted finer-grained control, I might find the Qt API
to lack granularity. I don't think so, but it's possible. The Gtk
version of the file selection dialog had some bad juju lingering
around it, also; I hear a rumor that they're going to fix it but I
haven't confirmed that for myself.

Both toolkits are fully-featured, though, with a great variety of
controls and a lot of available tools. My experience to date has been
that Qt is really the better choice, except maybe in regards to
licensing, and possibly with respect to architecture. Others may have
differing opinions, but I think the bottom line is that you won't go
wrong with either choice.

Thanks,
--G.

--
Geoff Gerrietts <geoff at gerrietts dot net> http://www.gerrietts.net/
"If I were two-faced, would I be wearing this one?" --Abraham Lincoln

Tim Evans

unread,
Mar 1, 2003, 4:28:19 PM3/1/03
to
i...@NOSPAMamaze.nl writes:

> gabor <ga...@z10n.net> wrote:
> : hi,
> :
> : i have to decide between pyqt and pygtk ( i simply find tkinter ugly :).
> : sorry about that, it's a personal choice ).
> :
> : so if you are familiar with both of them,
> : please tell me about your experiences, and
> : tell me which one do you recommend.
> :
>
> I've been doing some UI selection myself lately. Here are some pro's / cons:
>

[snip]

> GTK:
> Pro's:
> - Glade (!)
> - Themability
> - Quite functional widgets (though still limited in 1.2)
> - Works with Twisted (www.twistedmatrix.com)
> Con's:
> - Doesn't really work on windows

You should look at GTK 2.2. It is just generally better than the
old 1.2, with some standout features being:
- New multi-columned list and tree widget.
- New text widget (based on Tk, I think).
- Stock icon support is now part of GTK, not a GNOME extension, and
the new stock icons are really pretty.
- The Python API has been cleaned up a lot.
- Can use markup on labels, e.g. "normal <b>bold</b> <i>italic</i>" works.
- Works better on win32 than it used to.
- Better default theme, which also fits better with win32.

--
Tim Evans

Nomad

unread,
Mar 2, 2003, 3:47:44 PM3/2/03
to
On 01 Mar 2003 13:21:13 GMT, i...@NOSPAMamaze.nl wrote:

>Except for Glade, there aren't any good interface builders, and portability
>to windows is a strict requirement for my project, so I'm currently looking
>into wxPython. Too bad the wxPython / wxWindows documents aren't downloadable
>(as far as I could see)

What about QT Designer? It's great for GUI painting, and has the pro
that you can use the same form design for any language supported by
the Q framework -- via a UI compiler tool (such as the pyuic that
comes with PyQt).

--
Nomad

Wondering of the vast emptyness of the 'net
in search of something cool.

0 new messages