Click to See Complete Forum and Search --> : qt and gtk differences


emus
08-10-2004, 12:38 PM
I've been wondering why so many stand-alone linux applications with no Gnome or KDE affiliations are implemented with GTK.

Is GTK simply easier to use, or are there other reasons?
I understand that Qt was not always free http://www.kde.org/whatiskde/kdefreeqtfoundation.php, but after the agreement back in '98, why is it that I always find more applications coded in GTK?


Thanks,

emus

hard candy
08-10-2004, 01:28 PM
No doubt the fact that Qt uses C++ as the underlying language is also a piece of the percieved problem; for any given computer language one can readily find both vigorous proponents and opponents.

Further to this, until fairly recently, the quality of the freely available C++ compiler, G++, was rather poor. This has resulted in people having the attitude that C++ is a poor language choice.

The most direct "competitor," Gtk, is implemented using C which has the salutory effect that Gtk is almost trivially integratable with virtually any language, which is somewhat preferable.

from http://cbbrowne.com/info/qtcontroversy.html

rocketpcguy
08-10-2004, 02:15 PM
kde qt apps take SUCH a long time to load in gnome, but gnome gtk apps loads just as fast in kde. why? any way to fix this?

emus
08-10-2004, 03:07 PM
Thanks for the link hard candy. That page cleared up a lot of questions.

bwkaz
08-10-2004, 06:34 PM
Originally posted by rocketpcguy
kde qt apps take SUCH a long time to load in gnome, but gnome gtk apps loads just as fast in kde. why? any way to fix this? It's due to the C++ thing.

A LOT of Qt's C++ code is done with virtual functions, which take a lot longer to link at runtime. For every single widget, you need to resolve all its virtual functions as the widget is created. Prelinking helps a bit with that, but I don't think it helps to the point where it's as fast as C and Gtk.

The reason it takes even longer when KDE isn't running is because there are no copies of the Qt library sitting in memory already at that point (the runtime linker will re-use the readonly part of the Qt lib if it's available, but it's not at that point).