7 ms·
I love KDE,I like QT, why is GTK the preferred toolkit on Linuxes these days ? I would really like to see an objective analysis, I am not in the camp of KDE/QT
by istoica 12y ago
I love KDE,I like QT, why is GTK the preferred toolkit on Linuxes these days ?
I would really like to see an objective analysis, I am not in the camp of KDE/QT against Gnome/GTK, but in modern times, what makes GTK a better goto choice in respect to other frameworks(QT, FOX, FLTK)?
Is it inertia, is it philosophy, is it technical details, is it licensing policy ?
- Sammi 12y agoOne of the best discussions on the subject, made by old hackers, but new guys to GUI programming, who tried both: https://www.youtube.com/watch?v=ON0A1dsQOV0 https://www.youtube.com/watch?v=ON0A1dsQOV0
- yoz-y 12y agoI think one of the main points is the language. GTK is a C framework, Qt is C++. A lot of people in Linux community prefer to use old school C. Also licensing was certainly an issue at some point. The open source project I was working on made the choice to use GTK because it was Free. If we had to make the choice now, again, we would choose Qt. But it is too late to rewrite years worth of code.
- adrusi 12y agoAlso, while GTK is written in C, it is designed with cross-language compatability in mind. GTK has first class support in C, C++, Vala, Python, and Javascript (there are still more official bindings and countless unofficial bindings). Qt is almost exclusively a C++ framework. There are Python bindings, but they aren't comparable to GTK's.
- Sammi 12y agoI haven't tried these, but there seems to be QT bindings for quite a few languages: https://qt-project.org/wiki/Category:LanguageBindings https://qt-project.org/wiki/Category:LanguageBindings
- Zardoz84 12y agoIt's a real problem. I really like to use QT, but I found that is problematic if you aren't using C++. For example on C, D or Java. There is bindigns, but or are lagging behind the last version of QT (ie Qt 4.8 or more older) with very few support or are abandoned some time ago.
- lmedinas 12y agoI'm not so sure if most of the people want to use GTK because it's C. Because usually that means that they have to deal with GObject which is not so nice.
- fmoralesc 12y agoI like GObject a lot (esp. over higher-level languages like python). I just wish creating typelibs was easier.
- scarygliders 12y agoTo be honest, I don't care what language Qt is written. As long as there is a binding for my language of choice, as long as Qt does what the documentation says it does, as long as the developers seem to know their stuff, and listen to people's problems with agency, then that's good enough for me.
- fetbaffe 12y agoUbuntu is switching to Qt for Ubuntu Touch. If I remember correctly it is about building resolution independent applications, which GTK has (had?) poor support for. For Desktop you can build Qt QML-applications with Unity/GTK themeing I think. http://developer.ubuntu.com/apps/qml/ http://developer.ubuntu.com/apps/qml/
- adrusi 12y agoReally? I know that GNOME 3 (and maybe also Unity) are the DEs of choice for HiDPI displays, so I'd be surprised if there were any real deficiencies in GTK's resolution handling.
- fetbaffe 12y agoSee this discussion. http://askubuntu.com/questions/281092/why-is-canonical-choosing-qt-over-gtk-for-unitys-next-generation http://askubuntu.com/questions/281092/why-is-canonical-choos... And this answer http://askubuntu.com/a/315235 http://askubuntu.com/a/315235 "GTK+ does not support resolution independence, Modern mobile devices have ultra high pixel densities. If you run a GTK+ application on a mobile screen all the user interface elements would be so small as to be unusable. This has been an open bug on GTK+ since 2008 but they have not done anything about it." Read the entire answer. I am no expert to validate if it is correct or not.
- fmoralesc 12y agoFrom the bug report ([1]): > Matthias Clasen [gtk+ developer] 2014-08-23 05:59:18 UTC > closing this as we have hi-dpi scale support now - it is not quite the same thing, but close enough to render this bug obsolete [1]: https://bugzilla.gnome.org/show_bug.cgi?id=546711#c58 https://bugzilla.gnome.org/show_bug.cgi?id=546711#c58
- scarygliders 12y agoBefore I started to use Qt in my python projects, I was using GTK. At the time, there was no absolute reason for doing so - it was merely the first thing I tried. For various reasons (memory is vague, it was a while back), I soon began to get frustrated with GTK. Then I started reading various articles on the subject of 3rd-party Gnome theme designers getting extremely frustrated because for every point release of Gnome/Gtk, their themes broke in lots of annoying ways. I read about those frustrations, about incredulity that a point release introduced non-backwards compatible changes, about anger at Gnome developer's responses to those frustrations. A very good article to read is http://igurublog.wordpress.com/2012/11/05/gnome-et-al-rotting-in-threes/ http://igurublog.wordpress.com/2012/11/05/gnome-et-al-rottin... Gnome itself.. I stopped using Gnome desktop not long after that - the big push for me was the transition from being a great desktop environment in Gnome 2, to some horrible abomination in Gnome 3. Now, some people like Gnome 3's way of doing things, I don't. For similar reasons I refuse to have anything to do with Ubuntu's Unity. The Gnome developer response to issues leaves something to be desired... "We know best, shut up!" is the best way I can describe my impression of them. There's something almost, dare I say it, Communist Party in my opinion, of how they do things. It puts me off. I've been using KDE since then - it presents me with a desktop that's useful to me. It also led me to try out the Qt library. What a breath of fresh air! Well documented! No unexpected changes in operation or backwards-incompatibility in minor revisions! Great responses from Qt/KDE developers! Anyway that's my own personal experience - I wouldn't dare suggest that is why others choose Qt & KDE in favour of Gnome/Gtk.
- neurobro 12y agoI can't speak to the developer experience for Qt vs. GTK, but one day the scrollbars in the GTK-based programs I use started going into ultra slow motion if I held down the mouse button for 1/4 second. While looking for a place to report the bug, I discovered this is an intentional "zoom" feature. Almost nobody knew about this amazing(?) feature, so with virtually no discussion, it was made to activate automatically to be more "discoverable". Personally, my life would be better if I hadn't discovered this UX regres-(cough)-feature. This sort of thing also reflects poorly on the software using the library. (Initially I thought Synaptic was broken.) I'm surprised that a mature library can change overnight in such a far-reaching way on some dude's whim.
- anon4 12y agoFrom what I've heard, GTK was born due to licensing restrictions of the older versions of Qt - Qt used to be dual-licensed, available either under a commercial license, or under GPL (not LGPL). Some people found that too restrictive.
- nknighthb 12y agoNo. Some people (especially the FSF) objected initially to the FreeQt license (which did not meet OSI and FSF definitions) and then the QPL[0] for a few reasons, most importantly because it was not GPL-compatible. Qt/X11's release under the GPL came quite a bit later after GTK+ and GNOME were well on their way to becoming established projects. [0] http://en.wikipedia.org/wiki/Q_Public_License http://en.wikipedia.org/wiki/Q_Public_License
- maxerickson 12y agoIt was written for GIMP: http://en.wikipedia.org/wiki/Peter_Mattis http://en.wikipedia.org/wiki/Peter_Mattis (the second quote is the most salient) I would agree that licensing concerns informed other decisions between GTK and QT though.
- exDM69 12y agoIn my opinion, it might be related to Qt being a huge framework and ecosystem where GTK is "just" a GUI toolkit. I don't know if things have changed recently but at Qt at least used to require custom C++ extensions. This requires you to use custom toolchains or the recommended way of using the Qt Creator IDE. This isn't necessarily bad (I've only quickly tried it out, I don't really know) but it certainly makes me look at other alternatives first. This isn't perhaps a big problem if you use other languages than C++ and there are decent wrappers available. But having to use a custom compiler/preprocessor just to get a GUI up isn't what I really want. Qt is a pretty intrusive framework and ecosystem, where you have QStrings and QSockets and QEverything. GTK is perhaps a bit more lean and mean library than a full ecosystem. I've also noticed that Qt applications do not work very well over remote X connection over slow networks. Apps built with other GUI toolkits work much more fluently. (I understand that this is not very common these days but I still do work on remote X on a daily basis). I am sure that the Qt frameworks solve practical problems in cross platform development, but I'd rather not get involved in a whole ecosystem when all I need is a GUI toolkit.
- dded 12y ago> (I understand that this is not very common these days but I still do work on remote X on a daily basis) It's probably more common than you think. We also use it.
- scarygliders 12y agoAs another poster replied, remote desktop users are a lot more common than you might realise :) I haven't found this problem with Qt and remote connections. Then again I usually use Xrdp with the X11rdp back-end. If you haven't already done so, perhaps you should try it, it works beautifully, and if you run a Debian-based distro, I've even written a utility which compiles X11rdp/xrdp and packages it for your convenience ;)
- nknighthb 12y ago"Custom toolchains" is massively overstating things. The only mandatory thing is the MOC, which is just a preprocessor that spits out some more C++ code for your regular compiler to build, and it's easily integrated with ordinary Makefiles (or whatever other half-sane build process you want). qmake is optional. http://qt-project.org/doc/qt-4.8/moc.html http://qt-project.org/doc/qt-4.8/moc.html http://stackoverflow.com/questions/3632038/can-i-use-qt-without-qmake-or-qt-creator http://stackoverflow.com/questions/3632038/can-i-use-qt-with... (And I don't know what to make of your comment about remote X. Years ago I sometimes ran entire remote KDE sessions in Xnest and didn't really have any problems, so this would seem like either something new, or a problem with your environment.)
- rmsaksida 12y agoJust a thought: maybe KDE is the reason why GTK is so popular. I've been a Linux user for roughly 14 years, and every time I try KDE, I can't seem to give it more than 5 minutes. The KDE UX is like kryptonite to me. I feel like a senile old lady when I use it, unable to grasp what the hell is going on. I briefly tried KDE again when GNOME 2 was killed, and I uncomfortably went back to GNOME. I deeply disliked GNOME 3, but at least I found it usable. (I eventually switched to XFCE). I know KDE is a mature, large, beautiful project, but ultimately a desktop environment is about user experience, and KDE's doesn't click with me. I'm aware my experience is entirely subjective, but I suspect there are others like me who just can't get used to the K. So we end up in GNOME, and by inertia resort to using and developing GTK applications. I think it'd be very cool if there was something like XFCE for Qt. Maybe LXQt will play this role in the future.
- rantanplan 12y agoKDE's major sin is the lack of a sane, usable, default configuration. It took me a few years to understand that people don't want to invest, not even a few hours, to configure their DE. And KDE comes with a lot of configuration settings. So they ended up in Gnome. I've been using it for ~10 years and although it's the only DE I can get any job done, even today the defaults are ugly and overwhelming. And only a few distros(OpenSUSE only?) make an effort to provide a decent KDE experience for the user.
- rmsaksida 12y agoI think Linux users in particular don't mind investing in their DEs, but the investiment cost shouldn't be so high in the beginning as to scare off new users. DEs have to carefully balance a good initial configuration with the flexibility for long term usage. A second issue with "investing in your DE" is that we tend to update computers and installations a lot these days. Any extra step required to configure your environment becomes tedious over time. I used to have a rich dotfiles folder, but the pain of maintaining it became so high that I slimmed it down to the absolute minimum. I even forced myself to conform to some programs' defaults. The less time I spend hunting for this kind of highly specific documentation, the better.
- Osmium 12y agoI'd like to know too, because QT makes the best cross-platform apps. A QT app on OS X feels good to use in a way that other cross-platform GUI apps really don't. But I've never tried to code with it, so I don't know what it's like behind the scenes.
- gioele 12y ago> what makes GTK a better goto choice in respect to other frameworks (QT, FOX, FLTK). I do not have an answer but I would like to show a different angle to this question: why do Qt applications often feel overly complex and GTK applications are usually much simpler to use? Concrete examples: * Transmission ( https://www.transmissionbt.com/images/screenshots/GTK-Large.jpg https://www.transmissionbt.com/images/screenshots/GTK-Large.... ) vs. KTorrent ( https://www.kde.org/images/screenshots/ktorrent.png https://www.kde.org/images/screenshots/ktorrent.png ) * Rhythmbox ( https://wiki.gnome.org/Apps/Rhythmbox/Screenshots?action=AttachFile&do=get&target=Audio_CD_Tab.png https://wiki.gnome.org/Apps/Rhythmbox/Screenshots?action=Att... ) vs. Amarok ( https://amarok.kde.org/sites/amarok.kde.org/files/Amarok2.7screenie.png https://amarok.kde.org/sites/amarok.kde.org/files/Amarok2.7s... ) * Simple Scan ( http://i1-linux.softpedia-static.com/screenshots/Simple-Scan-Ancell_1.png http://i1-linux.softpedia-static.com/screenshots/Simple-Scan... ) vs. Skanlite ( https://docs.kde.org/development/en/extragear-graphics/skanlite/main-window.png https://docs.kde.org/development/en/extragear-graphics/skanl... ) * GNOME Maps ( http://www.gnome.org/wp-content/uploads/2010/09/maps-3.12-1150x863.png http://www.gnome.org/wp-content/uploads/2010/09/maps-3.12-11... ) vs. Marble ( https://marble.kde.org/img/gallery/marble-desktop-atlas-distance-route.png https://marble.kde.org/img/gallery/marble-desktop-atlas-dist... ) * Brasero ( http://www.novell.com/documentation/opensuse103/opensuse103_gnome_user/graphics/brasero_dataproject.png http://www.novell.com/documentation/opensuse103/opensuse103_... ) vs. K3b ( http://digitizor.com/wp-content/uploads/2010/02/k3b-1-70-0.png http://digitizor.com/wp-content/uploads/2010/02/k3b-1-70-0.p... ) * Shotwell ( http://ubuntuportal.com/wp-content/uploads/2014/10/ubuntu-14.10-Shotwell-Picture-Manager.jpg http://ubuntuportal.com/wp-content/uploads/2014/10/ubuntu-14... ) vs. Digikam ( http://www.flickr.com/photos/digikam/2603789332/ http://www.flickr.com/photos/digikam/2603789332/ ) Please also compare the default theme for Gnome ( http://blogs.gnome.org/mclasen/files/2014/06/adwaita.png http://blogs.gnome.org/mclasen/files/2014/06/adwaita.png ) with that of KDE ( http://upload.wikimedia.org/wikipedia/commons/6/6d/Plasma_Desktop_4.4.jpg http://upload.wikimedia.org/wikipedia/commons/6/6d/Plasma_De... ). I appreciate the configurability and power of most KDE applications, but I cannot stand the lack of design and ergonomics that pervades the KDE world.
- jstanek 12y agoIn your examples, you are comparing KDE apps with GNOME apps. Though the KDE ones are all Qt and the GNOME ones are all GTK, it's not really a fair comparison since GNOME and KDE have different design objectives (KDE strives to be more feature-complete and configurable while GNOME wants to be simple to use and have a clean UI). The design choices in your comparison aren't dictated by the toolkit, but rather the HIG of each desktop. There are a lot of clean and simple Qt apps, like the official implementation of Tox [0]. [0] https://tox.im/assets/ss.png https://tox.im/assets/ss.png
- levosmetalo 12y agoIt's not only about the framework, it's about the language too. Qt is written in C++, and so it's hard to use effectively when not using C++. On the other hand, GTK being written in C, it is possible to use it either directly, or through some simple FFI or wrapper from whatever language of choice. That alone is enough of the reason that every non C++ developer prefer GTK.
- wvh 12y agoI guess initially Gtk was preferred because of the licensing confusion around Qt while Gtk was clearly GNU open-source. Maybe Firefox for Linux would be based on Qt if it were started today; it would probably help for mobile. I doubt anybody would really be interested in moving an old code base like LibreOffice or Firefox over to Qt, so since they started out with Gtk, they will most likely stay with Gtk. The last years – since Gnome 2.0 I guess, but definitely Gnome 3.0 – Gtk and Gnome have had an enterprise cleaning broom going through it, which has made them feel more restricted but also more uniform and less as if a bunch of hobbyists have each added their own pet project and preferences to a common code base. I personally think Qt is great, and with a stronger corporate backer or design team KDE could be polished a bit better without taking away what makes it KDE. Gnome probably has a lot more corporate backing (for desktop) and paid developers than KDE, and I guess consistency and polishing of rough edges are helped by corporate backing and paid development work. Qt is doing well on mobile though (Sailfish, Ubuntu mobile). It'll be interesting to see how this will influence the desktop side of things. (For what it's worth – I have both Gnome and KDE installed, and use KDE most of the time.)
- BruceM 12y agoRegarding Firefox and Qt vs Gtk ... this is going back a long long time (to the Seamonkey days and prior to some really huge changes), but Gtk people were involved with Mozilla early on and as Mozilla contributors. Perhaps pavlov will step in and say something, but people like him, Chris Blizzard and others really stepped up early on. On the Qt side, there were some initial hacks to get the old codebase working with Qt from some Trolltech folks, but I remember that being something they sort of tossed over the wall ... and that was before the original Mozilla codebase was scrapped and the change to XUL happened. Did KHTML exist back then and was it good enough that it deterred more KDE / Qt folks from working on Mozilla? I don't recall as it has been ages. Of course, KHTML went on to become the foundation of WebKit ... so much history!
- ciupicri 12y agoI don't like the license of the pyqt Python binding which forces me to use GPL or pay upfront if I remember correctly. Also my experience with Qt Designer hasn't been as pleasant as with Glade when it came to dynamic layouts. I've struggled an hour to insert something into a vertical container with no luck.
- fineIllregister 12y agoPySide are the LGPL Python bindings from the Qt Project.
- ciupicri 12y agoI know about PySide, that's why I specifically named pyqt.
- 72deluxe 12y agoC vs C++ perhaps? I would choose Qt myself, but that's because I prefer writing in C++. Linux land is typically the C Fortress, is it not? (Vala is making inroads in GNOME land though I think?) I wrote Qt stuff years ago and found it well documented. I didn't even know where to start in GTK land. I have since moved to wxWidgets as it appears to be free of politics and fits in nicely under Mac OSX (some Qt stuff was obviously Qt under OSX I noticed)
- Avshalom 12y agoA lot of this is historical. So some thoughts in no particular order: Back a decade ago qt wasn't cross platform, gtk was. So when I was on windows I was using pidgin (nee gaim), gimp, scite, Firefox... When I moved to Linux I of course kept using the same. And back then to do cross platform what you usually did was use a meta toolkit like wxwidgets, which on Linux wrapped gtk. So again that was the cross platform toolkit. Being in c meant complete bindings for a lot more languages especially with SWIG anything that didn't have the level of support of say python went with gtk bindings. Until KDE4 qt brought with it a dependency on the entire KDE environment kedit, Kate, kstars, ktypingtutor, a bazillion things. Which always seemed like a lot when you just wanted a PDF viewer or something. Because of the kparts architecture and just culture in general qt/KDE apps tended to include the kitchen sink Konquerer was the most notorious, but a lot of apps were like that, which felt very fat to a lot of people and not 'unixy' enough.
- deleted 12y ago[deleted]