GTK vs Qt

From WikiVS, the open comparison website
Jump to: navigation, search


GTK Qt
GTK
VS
Qt
http://www.gtk.org http://qt.nokia.com

GTK+ and Qt are open-source cross-platform User Interface toolkits and development frameworks. These are the two most popular frameworks in use for Linux and BSD because they are open-source and give developers a powerful toolkit to design Graphical User Interfaces. GTK+ is used as the standard toolkit for the GNOME, LXDE and Xfce Desktop Environments while Qt is used for KDE.

Contents

[edit] Development

Qt is developed by an open community around Qt Software, a division of Nokia. Qt Software was originally named Trolltech before being acquired by Nokia in 2008.

GTK+ was originally created to develop GIMP and is now developed and maintained by the GNOME Foundation.

[edit] Usability

Qt's API is said to be cleaner and better documented than GTK+'s.

Qt uses a code generator called MOC.

GTKmm, the C++ interface to GTK+, uses standard C++ templates.

[edit] Design Tools

With GTK+, many people use Glade to easily construct the GUI visually and then code the callbacks. Current version of Glade output data in GtkBuilder format, which is directly supported by GTK+.

Qt has Qt Creator, which functions both as an IDE and also seamlessly incorporates Designer, a tool that allows easy layout of widgets and simple connections of slots and signals between widgets.

[edit] Documentation

Nokia has extensive documentation for Qt.

GTK+ has documentation available both online and locally using the DevHelp system.

[edit] Framework

Both Qt and GTK+ were developed from the ground up with Object Oriented Programming in mind. Qt is developed in C++, GTK in C in an object oriented manner using the GObject type system. C++ bindings are available through gtkmm.

[edit] Coverage

Qt is a complete consistent framework. You can easily connect HTTP events to GUI elements, fill forms with results from a database query or build an interactive visualization of large datasets.

GTK+ is only a GUI toolkit, but can be seen as part of a GObject based library stack. It interoperates very well with other libraries such as GLib, GIO, GNet, GStreamer, Poppler, Pango, Cairo and Clutter.

[edit] Portability

Both Qt and GTK+ are available on most popular desktop Operating Systems. For mobile devices, Qt for Embedded allows Qt to run directly on the hardware, without the need of X11 or a window manager. The first Qt application started becomes the window manager featuring full composition and top-level transparency. GTK+ on embedded devices (e.g. Meego) requires an X11 server + window manager, resulting in at least three processes running for a hello world application.

OS Qt GTK+
Windows XP Native Native
Windows Vista Native Native
Windows Mobile (CE) Native Not available
Mac OSX Native Through X11
Linux/Unix (X11) Native Native
Linux/Unix (framebuffer) Native Native [1]
Symbian (S60) Native Not available
WebOS Native Not available
Android Free 3rd party port Not available

Qt looks more native than GTK+ on Windows and Mac platforms. This is because Qt tries to use native widgets whenever possible. Even so, neither Qt nor GTK+ will look and feel completely native on Windows or Mac. GTK+ brings more consistent user experience when switching from one platform to another, since Look And Feel remains unchanged, but Qt can do that as well if needed. The native look&feel of Qt is just another theme.

[edit] Performance

GTK+ proponents say that GTK+ uses less memory than Qt. The difference, however, is negligible according to Qt advocates. The reason some people are seeing Qt hogging memory is mostly that they're using an old version of the gcc compiler — it used to be very inefficient at generating C++ code especially for advanced features such as templates and exceptions. These problems have long been fixed; with gcc 4.4, Qt typically does not use more memory than GTK+.

[edit] Native Languages and Language bindings

Natively, Qt has C++ based libraries. It also supports Java [2] (officially supported in the past, but not anymore [3]), Perl [4], Python [5] [6], PHP [7], and Ruby [8] based development. Qt also ships with the embedded scripting language QtScript, which is an ECMA-Script (JavaScript) implementation.

Natively, GTK+ has C based libraries. It supports several languages like for example C++ [9], Java [10], Perl [11], Python [12], PHP [13], Ruby [14], JavaScript [15], and Mono/C# [16].

GObject libraries, the base for GTK+, have a powerful tool to allow them to be available to any language supporting GObject-Introspection. Any library with a new release, can install its GIR (XML format) and Typelib files, to be available for bindings with no extra effort and by-hand created binding.

GTK+ applications can also be developed with Vala, an object oriented programming language similar to C#, specially designed for the GObject type system. Vala programs compile to C code, without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.

Python bindings: Mature and actively-developed LGPL bindings exist for both GTK+ (PyGTK) and Qt (PySide). The creation of PySide was funded by Nokia to provide free bindings (mostly) compatible with the more restrictively, GPL-licensed free version of PyQt. Binaries are available for Linux, OS X and Windows.

[edit] Rivalries

A good example is when Nokia (previously focused on GTK+) announced that it will improve the co-operation with Trolltech (Qt)[17]. Motorola representatives announced they will focus more on the GTK+ [18].

In 2008, Nokia acquired Trolltech to gain control of Qt. In 2009, Nokia adopted the LGPL for Qt.

[edit] Licenses

GTK+ is under the LGPL. This means that it can also be used by closed source applications in environments which support dynamic linking.

Qt is triple-licensed. The LGPL allows the free version of Qt to be included in software which isn't licensed under the GPL (proprietary software, or open source software released under a different license). It is also available as a GPL-licensed library which can only be used by open source projects with compatible licenses. Finally, there is also a commercially available proprietary license, which allows for the development of closed source software using Qt.

[edit] Links

See Also the Following Articles

Personal tools
Namespaces
Variants
Actions
Navigation
Ads
Toolbox