打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
GTK vs Qt - WikiVS
userphoto

2010.04.05

关注

From WikiVS, the open comparison website

Jump to: navigation, search


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

GTK+ and Qt are open-source cross-platform UserInterface toolkits and development frameworks. These are the two mostpopular frameworks in use for Linux and BSD because they areopen-source and give developers a powerful toolkit to design GraphicalUser Interfaces. GTK+ is used as the standard toolkit for the GNOME andXfce Desktop Environments while Qt is used for KDE.

Contents

[hide]

[edit] Development

Qt is developed by Qt Software, a division of Nokia. Qt Software wasoriginally 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 Gladeto easily construct the GUI visually and then code the callbacks. Theproblem with Glade is that it brings one more library dependency.GtkBuilder, which is included in GTK+, is a substitute for Glade. It isrecommended by GTK+ developers to use GtkBuilder over Glade. Nowdevelopers can design a GUI in Glade Designer and convert them toGtkBuilder XML using converter utility in Makefile.

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

[edit] Documentation

Trolltech has extensive documentation for Qt.

GTK+ is lacking in documentation compared to Qt.

[edit] Framework

Both Qt and GTK+ were developed from the ground up with ObjectOriented Programming in mind. Qt is developed in C++, GTK+ in C in anobject oriented manner using the GObject type system. C++ bindings areavailable through gtkmm.

[edit] Coverage

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

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

[edit] Portability

Both Qt and GTK+ are available on most popular desktop OperatingSystems. For mobile devices, Qt for Embedded allows Qt to run directlyon the hardware, without the need of X11 or a window manager. The firstQt application started becomes the window manager featuring fullcomposition and top-level transparency. GTK+ on embedded devices (e.g.Maemo) requires an X11 server + window manager, resulting in at leastthree 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 Port available [1]
Linux/Unix Native Native
Symbian (S60) Native Not available

Qt looks more native than GTK+ on Windows and Mac platforms. This isbecause Qt tries to use native widgets whenever possible. Even so,neither Qt nor GTK+ will look and feel completely native on Windows orMac. From the other hand GTK+ brings more consistent user experiencewhen switching from one platform to another, since Look And Feelremains unchanged.

[edit] Performance

GTK+ proponents say that GTK+ uses less memory than Qt. Thedifference, however, is negligible according to Qt advocates. Thereason some people are seeing Qt hogging memory is mostly that they'reusing an old version of the gcc compiler - it used to be veryinefficient at generating C++ code especially for advanced featuressuch as templates and exceptions.These problems have long been fixed; with gcc 4.4, Qt typically doesnot 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 languageQtScript, 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#, speciallydesigned for the GObject type system. Vala programs compile to C code,without imposing any additional runtime requirements and without usinga different ABI compared to applications and libraries written in C.

[edit] Rivalries

A 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] Licenses

GTK+ is under the LGPL. This means that it can also be used byclosed source applications in environments which support dynamiclinking.

Qt is triple-licensed. For one it is available as GPL licensedlibrary which can only be used by open source projects with compatiblelicenses. But there is also a commercially available proprietarylicense, which allows for the development of closed source softwareusing Qt. Until recently, Qt required a proprietary license for use onMS Windows, but it has finally been made available under the GPL in itsMS Windows compatible version. The last license is the LGPL, whichNokia adopted in January 2009. The LGPL allows the free version of Qtto be included in software which isn't licensed under the GPL(proprietary software, or open source software released under adifferent licence).

[edit] Links

A reasonably complete comparison at techfreaks: http://techfreaks4u.com/blog/?p=1021

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Meego:为什么是QT? – 英特尔? 软件网络博客 - 中文
huihoo.org - linux开发终极指南(linuxbyte.net)
村长的麦田 | Ruby中各GUI toolkit的比较 (1)
Qt、GTK 和KDE、GNOME的关系
Cross-Platform GUI Library 介紹
Configuring Qt Creator for the Raspberry Pi
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服