You are not logged in.

#1 2010-06-01 22:02:44

dozerismydogsname
Member
Registered: 2010-02-11
Posts: 65

qt vs gtk

Hey, i'm currently trying to learn some basic gui programming for linux. I've noticed that i've only seen 2 libraries for guis; qt and gtk. I have a few questions about both:

Is one easier to learn over the other?
Is there any major difference (performance wise) between the 2 languages?

Offline

#2 2010-06-01 22:13:08

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,487
Website

Re: qt vs gtk

I find that qt appears to be more well structured which will help your learning, but then I understand C++ better than C.  gtkmm (GTK C++ bindings) just seem like a hack.   Saying that, the biggest thing I ever wrote was in GTK, mainly because I have a GTK desktop so both are usable...

Overall performance differences are minimal.

Offline

#3 2010-06-01 22:25:02

tlvb
Member
From: Sweden
Registered: 2008-10-06
Posts: 297
Website

Re: qt vs gtk

I find gtk+ pretty easy to understand, having had used it in python (and c iirc) ...that is as long as you stay away from gtkTreeModel/gtkTreeView/gtkCellRenderer etc. those are a pain to deal with, but I don't know if Qt is better.


I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.

Offline

#4 2010-06-01 22:45:10

simlan
Member
From: Germany
Registered: 2010-05-30
Posts: 20

Re: qt vs gtk

There are more libraries:

*Tcl/Tk
*wxWidgets
*fltk

to only name the "most" popular. Normaly all with many languagebindings. I glimpsed at GTK,QT,wxWidgets (mainly at Pythonbindings) and found that GTK offers some nice Tricks (Smart GUI editor, meta files for independece of any specific language binding.....) and I must admit I hate Slots wink

Offline

#5 2010-06-08 21:38:46

Kpunkt
Member
Registered: 2009-06-08
Posts: 144

Re: qt vs gtk

I'd go for Qt since it can do much more that just make a GUI (think of network or database access). Has some good python bindings (PyQt), it's fast and powerful and pretty straight forward so if there's no special reason to avoid it, I'd say: Qt

Offline

#6 2010-06-08 23:17:40

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: qt vs gtk

I'm a C guy, but I also find QT better from a programming standpoint. I haven't made any big GUIs though wink

Offline

#7 2010-06-08 23:28:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,294

Re: qt vs gtk

Personally, I like gtkmm over Gtk+.  I spent a good part of last week playing with gtk+ and straight c.  I got really frustrated with the UI builder stuff.  GTK+ tries to be somewhat object oriented, but does so by creating long descriptive function names.  I don't often disagree with Allan, but I found Gtkmm to bring harmony to Gtk.

That said, I really like Qt.  The licensing is now acceptable for things that are not pure GPL.  It works very well for cross platform (Windows) work.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2010-06-09 00:01:37

Cheifchimp
Member
From: Queensland Australia
Registered: 2009-05-07
Posts: 69

Re: qt vs gtk

I've been working with gtk & glade for a couple of years and find them both a nightmare to use.

I find the gtk reference so terse that its of no value and the tutorial positively prehistoric.

Finding examples of how to use particular widgets is a case of trawling deep into masses of blogs and then only finding trivial implimentations.

Everytime I find a widget that is easy to understand and use it gets deprecated in favour of a 'swiss army knife' replacement.

'Real world' examples use so much indirection I have no hope of following them.

Offline

#9 2010-06-09 01:12:20

scottman
Member
From: Utah
Registered: 2010-02-12
Posts: 27
Website

Re: qt vs gtk

dude, go hardcore and do straight xlib wink if not i would google around to see which one has the most documentation. If i am correct Qt was professionally developed for awhile which might provide more documentation now thats its opening up. GTK+ has a ubuntu presence and so more noobs playing with it, which means more blog posts on their solutions etc...

Offline

#10 2010-06-09 02:30:33

theapodan
Member
From: Virginia, USA
Registered: 2008-10-21
Posts: 116

Re: qt vs gtk

simlan wrote:

There are more libraries:

*Tcl/Tk
*wxWidgets
*fltk

to only name the "most" popular. Normaly all with many languagebindings. I glimpsed at GTK,QT,wxWidgets (mainly at Pythonbindings) and found that GTK offers some nice Tricks (Smart GUI editor, meta files for independece of any specific language binding.....) and I must admit I hate Slots wink

Tcl/Tk is great, especially if you are starting out programming.  It takes very little typing to produce a functioning, useful GUI program in Tcl/Tk.

Offline

#11 2010-06-09 09:31:07

SiC
Member
From: Liverpool, England
Registered: 2008-01-10
Posts: 430

Re: qt vs gtk

I'd make a vote for wxWidgets.  It is quite straightforward, and code::blocks makes things nice and easy.  It also has good python bindings and is C++ rather than C.

I like it mostly because I used to do a lot of MFC programming years back, and I find that using event tables for event management is quite straightforward.

It is also cross platform, it uses GTK+ on Linux and Native windows widgets on windows, so writing cross platform stuff is a easy and it looks native on both platforms, which QT doesn't, it uses it's own widget libraries.

Offline

#12 2010-06-10 20:56:18

xenobrain
Member
From: Lodi, CA
Registered: 2006-05-31
Posts: 91

Re: qt vs gtk

Both GTK and Qt are easy enough to learn, and both have very nice Python bindings if you want to go that route.

As for deciding on which one to learn?  Well, what DE are you targeting?  KDE?  Gnome/XFCE/LXDE?  It's an easy choice if you already have one in mind.

If you just want to learn "GUI Programming", I'd push strongly for Qt.  It has a beautiful object-oriented API, it's own highly integrated IDE, and your apps will look great on Windows too (Mac OS X is also supported).  And did I mention the documentation?  Simply the best.

Offline

#13 2010-06-11 01:07:39

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: qt vs gtk

I'm just starting to learn GTK and even though I manage to get things done and the documentation is relatively complete, there's a crucial lack of tutorials and examples. I'm spending a lot of time searching the web and not finding anything of use.

I still want to use GTK because it looks better than Qt and I prefer C to C++ and I'm (obviously) running XFCE.

Offline

#14 2010-06-13 22:52:25

aksdb
Member
Registered: 2007-10-07
Posts: 38

Re: qt vs gtk

Although some of you are now probably going to lynch me, but if you don't have a strict preference for C/C++ (which your initial post didn't state), I would recommend Lazarus (which uses FreePascal). It's design is based on Delphi (which you might have heard about) and is therefore a very good IDE for building user interfaces. It supports QT, GTK2, WinAPI, Carbon and some other backends, which you can "switch" at any time. Want to compile your program for windows? Fine, it will look completely native (actually, it is completely native then big_smile). Want to have specific versions for Gnome/GTK and KDE/QT? No problem.

And no, the underlying language (ObjFPC/Object Pascal) is by no means outdated or can't compete. You have object orientation, generics, etc.
So as I said, if you are open for a "different" language, give it a shot. IMHO the IDE alone is worth it.

Last edited by aksdb (2010-06-13 22:53:48)

Offline

#15 2010-06-13 23:01:18

SiC
Member
From: Liverpool, England
Registered: 2008-01-10
Posts: 430

Re: qt vs gtk

aksdb wrote:

Although some of you are now probably going to lynch me, but if you don't have a strict preference for C/C++ (which your initial post didn't state), I would recommend Lazarus (which uses FreePascal). It's design is based on Delphi (which you might have heard about) and is therefore a very good IDE for building user interfaces. It supports QT, GTK2, WinAPI, Carbon and some other backends, which you can "switch" at any time. Want to compile your program for windows? Fine, it will look completely native (actually, it is completely native then big_smile). Want to have specific versions for Gnome/GTK and KDE/QT? No problem.

And no, the underlying language (ObjFPC/Object Pascal) is by no means outdated or can't compete. You have object orientation, generics, etc.
So as I said, if you are open for a "different" language, give it a shot. IMHO the IDE alone is worth it.

Damn, I used to love Delphi, never seen that though, tempting bloody tempting to play with :S

Offline

Board footer

Powered by FluxBB