GTK+ vs Qt, Round 1


Identify the best operating system is easy: Fedora. And recognize the best programming language too: C++. But what is the best GUI development framework? Under Linux we have two of them Qt and GTK. My first bet was, that Qt is superior, because it supports out of the box C++, and because it has more features which also run in Android. But, a deeper look shows, that Gtk+ could perhaps outperform Qt.

The problem with Qt is, that it is more than only a GUI framework, it is a complete operating system. I want to give an example. In the SFML library it is possible to draw also buttons, this is done with a simple extension, which is very minimalistic. So the question is: why is Qt so big? I don’t know, but Qt modifies the C++ language standard heavily, and invents many things which are already there. And it works not very good together with gstreamer, which is a multimedia framework in RHEL.

In contrast, GTK+ and gtkmm are small and lightweight GUI frameworks. Easy to use is none of them. Under gtkmm I didn’t mastered yet a simple “Hello World” example. The problem is, that certain compiler settings are needed, a slot-pipeline for connecting the button to a method and everything is weak documented. So it is until now open, if Qt or GTK+ is the better GUI toolkit.

I think the question is important, because if a developer wants to create a GUI app in Linux, he wants to know, which tutorial he should read and in which framework he should invest his spare time.

As far as i can see, the fight between GTK+ and Qt is similar to the fight between Ubuntu and Fedora. That means, in theory both can be used for building a Opensource operating system. But at the end, a decision is needed for one of the frameworks. As far as I know, it makes sense to develop GTK+ against Qt, because Qt has two major pitfalls. At first, the problem with the license, and secondly the problem, that Qt is too big for Linux.

Getting the pros and cons of the GUI frameworks is not so easy as it looks like. The problem is, that in theory with every toolkit it is possible to create an app. In theory, it is possible to use Java 8 or the Mono framework under Linux. The question which is open is, which of the alternative is the more Linux-way-of-life.

I can understand every developer, who prefers to not use Linux for GUI development. Under MS-Windows the situation is more standardized. There is one framework, which is heavily documented and if this don’t work, there is no alternative. In Linux, the situation is confusing. Every distribution has its own framework, and some programs didn’t even use GTK+ or Qt, instead they have own toolkit onboard. It is a rational choice of 99% of all developers not to use Linux as their operating system, because the situation is a mess.

On a terminal / command-line level, Linux is standardized. There is only one kernel, and only one C++ standard, one filesystem and that’s it. So it makes absolute sense to program a database backend, php server and Java application server with that operating system. Only the GUI support is a bit uncomfortable.

From a technical point of view, gui development should be the easier part in programming. Because it is possible to create a gui with 100 lines of code in Python, so what is the problem? It seems, that there is a problem, because MS-Windows and Mac OS X have both good support for GUI development, while Linux not.

3 thoughts on “GTK+ vs Qt, Round 1

  1. Manuel Rodríguez: “Identify the best operating system is easy: Fedora. And recognize the best programming language too: C++. But what is the best GUI development framework? ”
    La 1°: En Linux es Debian, es un corolario, una tautología. En Windows es XP, sencillo y sin discusión. En Mac: Ninguno =D .
    La 2°: En efecto es C++, solo estaría Assembler por encima, pero no todos pueden masticar binario.
    La 3°: Estoy en esa disyuntiva, usé wxWidgets pero me irrita bastante las limitaciones que padece con los eventos ( por ejemplo con el teclado, es muy pobre ) y los $%/$(*][?[ assertions me hacen hervir la sangre al punto de evaporarla. Qt lo he visto por encima y parece prometedor, tiene alcances no solo gráficos sino hasta de manejo de puertos seriales, creación de servicios, etc etc. La licencia es un problema pero no puedo quejarme de eso porque son las reglas de sus propietarios. Ahora la GTK nunca la he probado.

    Like

  2. Het lijkt erop dat het identificeren van het beste besturingssysteem en de beste programmeertaal moeilijker voor je is dan dat je denkt.

    Like

Comments are closed.