What is difference between GTK and QT applications?

Many packages are available in both GTK and QT versions.

  • What’s the difference between them?
  • Is there any difference in
    performance or working method?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

In general, the difference from a user perspective should be purely cosmetic. Qt and GTK set themes independently (via, e.g., qtconfig or gtk-chtheme) but this is harmonized by some desktop environments.

GNU/Linux tends to be more GTK oriented than Qt in the sense that the former is more commonly used, so you may want to prefer it when given the choice; an exception would be under KDE, which uses Qt for its own applications — although none of these factors is very important.

A more significant issue would be in contexts with very limited RAM (as in, < 1/4 GB); in this case you would probably want the system to use exclusively GTK or Qt, but not both. On most modern desktops with gigabytes of memory, however, this is not a concern — using both extensively might cost you an extra (wild guess) 50-100 MB.


Note that there are also different versions of both GTK (2 and 3) and Qt (3 and 4) still widely used but not backward compatible (so a Qt 3 application cannot use Qt 4 libraries). However, both versions may exist on a system at the same time and the most serious consequence of this would be the potential for confusion and a bit more memory bloat.

Method 2

No, there is no difference in the internal structure of such programs. GTK and Qt are user interface toolkits and frameworks. They are libraries that the developers use to design graphical interfaces.

When a graphical (GUI) program is written, first its core internals are developed. This is what makes the program run. You never see the core, they simply execute in the background. On top of this core, a User Interface (UI) is designed.

Now, the developers could design the complete interface from scratch, or re-use designs made by others. Re-using design has a major advantage. It allows all the programs in your computer to look similar. Hence, they use GUI toolkits. GTK and Qt are two extremely common GUI toolkits.

GTK is the standard toolkit for GNOME while Qt is used by KDE. From the user’s point of view, it’s just the looks that differ. The program remains the same at heart.

Method 3

Another important aspect to consider is the Qt licensing link to their license disclosure which is explicitly set to be freely available to most non-profit making projects, but a commercial relationship is possible and might have restrictions for that case. Whereas GTK, state explicitly that it can be used freely even in proprietary applications GTK statement:

Are there any licensing restrictions?
GTK is free software and part of the GNU Project. However, the licensing terms for GTK, the GNU LGPL, allow it to be used by all developers, including those developing proprietary software, without any license fees or royalties.

A key aspect of complex GUI development will rely upon GLADE as an designing kit and whether that suites your approach glade link. It aims to be cross platform, but may not be as extensively supported cross platform as Qt is.

Method 4

How do they compare as far as their respective object models, and how closely do they follow the C++ standard — in my limited experience, QT seemed to be a little hacky with it’s code generators and reinventing the wheel with their own functionally equivalent classes for strings and classes. In short QT seemed to have more whistles and bells, which I’m sure many found useful, but it also seemed to have a heavy, proprietary feel to it. As I said, I had limited experience with it (and even less with Gtk). I’d like some opinions about how they compare today — from a developer’s perspective, who leans towards generic approaches to things that try to use C++ standards (like STL, C++ strings, threads etc)


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x