Application Development Framework Choices: GTK+ vs Qt
Creating applications with a visually appealing graphical user interface (GUI) requires some type of foundational toolkit to make the job practical. The leading candidates for Linux are the toolkits behind the two most popular desktop environments--namely GNOME and KDE. While they represent similar functionality, they are two totally different entities with different design philosophies and structure.
Platform Choices
So what is it that drives a developer or team to choose one platform over another? Often the choice is driven by the familiarity of one or more of the teammates with a particular platform. This obviously drives productivity as time is not wasted learning about the platform. If you take familiarity out of the picture and choose strictly on the merits of each, then your choice is a little more difficult.
One of the first questions needing an answer with regards to any new development project centers around the user--who will use the application and what will be their primary desktop environment? A corollary question would be does the application need to run on different operating systems or will it be targeted at a specific OS/desktop environment? Once this is established you may have your platform decision made for you.
If the OS'environment choice doesn't matter, then you need to look at the foundational issues of each platform. From a programming language perspective Qt is fundamentally a C++ based system while GTK+ relies primarily on C. Both platforms support other languages and on the multiple language support front GTK+ has a slight edge.
The actual process of building a graphical user interface (GUI) with both GTK+ and Qt is very similar. Both use a similar approach to widgets, layouts and panels. Each platform has tools to visually create your design. At the end of the day it's probably a wash as to which choice would be easier from this perspective.
GTK+
The GTK+ toolkit, otherwise known as the GIMP toolkit, was first released in 1997 as a part of the GNU Image Manipulation Program (GIMP). GTK+ is coded in the C programming language but has bindings for just about every popular language in use today. The GNOME desktop is based on GTK+, with essentially all of the utilities built with the GTK+ libraries.
Gtk# is a binding of the GTK+ toolkit to the Mono platform, making it available to the C#, Java, Python, and VB.Net languages. A number of applications are based on this set of tools, including Banshee (music player), Beagle (search tool), F-spot (photo organizer), and the TomBoy note-taking applet.
At the top of the productivity application list would be Evolution. Evolution is one of the most full-featured personal information managers (PIM) available on Linux. It has everything you would expect from a commercial-grade PIM, including the ability to connect to popular enterprise messaging platforms such as Microsoft Exchange. For word processing there's Abiword, a popular open source program based on the GTK+ libraries.
Glade is a tool for creating a user interface using a graphical layout approach. Glade itself is written mainly in C with its user interface items essentially hard coded. The output of a Glade design is an XML-based file describing all the user interface items you create along with their descriptive properties. An application must then implement hooks or signal handlers to respond to the events created by user actions.
Qt
Trolltech released the first version of Qt (pronounced "cute") in 1994. Qt was designed from the beginning with the C++ language in mind. As such the power behind Qt is in its class libraries. Qt includes a whole host of class libraries to support everything from core functionality to database manipulation, GUI construction, network communications, multimedia operations, OpenGL graphics, XML manipulation including XQuery support, scripting, and Web-based programming through WebKit.
Qt has an impressive list of high profile applications based on the product including Adobe Photoshop Album, Google Earth, the Netflix Player by Roku, and Skype's Linux client. Most of the utility applications you find as a part of KDE also use the Qt libraries. Qt ships with a bevy of developer tools including Qt Designer for creating GUI applications, Qt Linquist for adding international language support, Qt Assistant for presenting on-line documentation and QMake for building and distributing software packages.
Documentation for the Qt Classes can be found on the Trolltech documentation web site. One quick look at the page and you'll see the massive number of routines and functionality provided by the Qt framework. The primary Qt Reference Documentation web page includes everything you ever wanted to know and more about the Qt framework complete with examples and tutorials.
Developer Tools
If you're an experienced developer you know how valuable a true Integrated Development Environment (IDE) can be to your productivity. While many of the more modern development strategies include building test cases before you write the actual code, there is no substitute for a good debugging tool when you're trying to track down a problem. Both GTK+ and Qt have supporting IDEs to help you get the job done.
Anjuta (http://www.anjuta.org/) is a GNOME-integrated development tool with all the features you would expect from a modern IDE. Anjuta uses the concept of a project containing multiple pieces allowing you to break down a complex application into manageable parts. Debugging and memory profiling tools help you get past those last hurdles to deliver quality code. Macro support makes it possible to automatically execute repetitive editing sequences over an entire file. It also makes it easy to insert standard blocks of text for things like version and editing history using keywords like @DATE_TIME and @USER_NAME.
Trolltech offers Qt Eclipse Integration downloads (see previous article on Eclipse) to allow programmers to use the Eclipse IDE for both C++ and Java development. Eclipse can also be used for GTK+ development with a little work. There's a discussion on the Ubuntu forums site with the steps required to get the GTK tutorial files to compile.
KDevelop represents the consolidated efforts of the KDE team and provides a number of features focused at creating applications for the KDE platform. Sample projects include things like a KOffice Part, a Konqueror Navigation Panel Plugin and more. Code project has a good tutorial article on building a simple application using the KDE Application Designer. There's also a good on-line book available to help get you going with KDevelop.
Final Word
Creating a complex GUI-based application is not an easy task. Building that application using a computer language you're unfamiliar with and a development environment you've never seen is a recipe for failure. Choosing familiar tools and languages will help give your project a leg up on a successful outcome.
The good news is, you don't have to write your application in C or C++ to take advantage of either of these toolkits. Both have support for many of the more popular languages in use today. Should you choose the GTK+ route you can add C# and VB.Net to the list should you so desire. In the final analysis it comes down to picking the tool you're most comfortable with and sticking with it.


