From WikiVS, the open comparison website
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 and Xfce Desktop Environments while Qt is used for KDE.
[edit] DevelopmentQt is developed by 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] UsabilityQt'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 ToolsWith GTK+, many people use Glade to easily construct the GUI visually and then code the callbacks. The problem with Glade is that it brings one more library dependency. GtkBuilder, which is included in GTK+, is a substitute for Glade. It is recommended by GTK+ developers to use GtkBuilder over Glade. Now developers can design a GUI in Glade Designer and convert them to GtkBuilder XML using converter utility in Makefile. Qt has 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] DocumentationTrolltech has extensive documentation for Qt. GTK+ is lacking in documentation compared to Qt. [edit] FrameworkBoth 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] CoverageQt 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] PortabilityBoth 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. Maemo) requires an X11 server + window manager, resulting in at least three processes running for a hello world application.
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. From the other hand GTK+ brings more consistent user experience when switching from one platform to another, since Look And Feel remains unchanged. [edit] PerformanceGTK+ 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 bindingsNatively, 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], and Mono/C# [15]. 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. [edit] RivalriesA good example is when Nokia (prior focused on GTK+) announced that it will improve the co-operation with Trolltech (Qt)[16]. Motorola representatives announced they will focus more on the GTK+ [17]. In 2008, Nokia acquired Trolltech to gain control of Qt. In 2009, Nokia adopted the LGPL for Qt. [edit] LicensesGTK+ 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. For one it is available as GPL licensed library which can only be used by open source projects with compatible licenses. But there is also a commercially available proprietary license, which allows for the development of closed source software using Qt. Until recently, Qt required a proprietary license for use on MS Windows, but it has finally been made available under the GPL in its MS Windows compatible version. The last license is the LGPL, which Nokia adopted in January 2009. 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 licence). [edit] Links
A reasonably complete comparison at techfreaks: http:///blog/?p=1021 |
|