The Qt Toolkit

http://qt.nokia.com

Qt's latest version is 4.8, but it is usually referred to as "Qt 4" to avoid confusion with the previous major release, Qt 3. The KDE™ 3.5.x desktop was built using Qt 3 and the KDE™ 4.x desktop was built using Qt 4. The two versions are not compatible, and a tool is provided to migrate applications built with Qt 3 to Qt 4. Some classes, methods, and properties in Qt 3, however, were not carried forward into Qt 4, and those will have to be replaced using existing Qt 4 objects.

The Qt (pronounced cute) toolkit includes three major components, plus the QtCreator IDE and the Qt- SDK. They are produced by Nokia™, which purchased Qt from the original developer, Trolltech™ so that Nokia™ could use Qt to develop their mobile phone OS, Symbian™. They also use Qt to support MeeGo™, an open source Linux™ project which brings together the Moblin™ project, headed up by Intel™, and Maemo™, by Nokia™, into a single open source activity. Nokia™ states that MeeGo™ integrates the experience and skills of two significant development ecosystems, versed in communications and computing technologies. The MeeGo™ project believes these two pillars form the technical foundations for next generation platforms and usages in the mobile and device platforms space. MeeGo™ currently targets platforms such as netbooks/entry-level desktops, hand held computing and communications devices, in-vehicle infotainment devices, connected TVs, and media phones.

Note

On February 11, 2011, Nokia™ announced a partnership with Microsoft™ in which Nokia™ will replace Symbian™ with Windows Phone 7™ in wealthy American and European markets, but continue to use Symbian™ in India and other poorer regions. Because of a huge outcry by Qt and open source supporters who contributed to Symbian™, Meego™, and Maemo™, Nokia™ released a blog message the next day. It seems they need Qt in order to continue to support Symbian™ on the 200 million Nokia™ phones that run it, and MeeGo™ and Maemo™ for a disruptive presence in the markets for which they are being offered. But, the partnership puts the commercial version of Qt in a questionable light due to the influence of Microsoft™ and the history of its partnership with Novell™ and others which no longer exist.

Qt's three major components are the Designer, the Linguist and the Application Programming Interface (API). The Qt toolkit allows you to write source code for advanced applications with graphical user interfaces on either Linux™, Windows™, or Mac™. It compiles them on all three platforms and embedded operating systems with little or no rewriting of the source code, saving time and development costs.

Since the Qt Toolkit is under the GPL™/LGPL™, it is not threatened by this partnership, and Canonical™ announced that they are going to use Qt instead of GNOME™ to develop their Unity™ 2D desktop. So, considering that, and the fact that Qt is under the GPL™/LGPL™ license, Qt remains as viable a development tool as it was before the announcement.

Kubuntu uses the KDE™ desktop, and KDE™ was built with Qt. Some would say that Qt is the most powerful GUI RAD tool available on Linux™, and Windows™ as well.

Installation of Qt

The entire Qt toolkit is in the repository as qt-sdk or as part of the Qt SDK available from the http://qt.nokia.com/downloads website under either the LGPL™ or a commercial license. The latest version is 1.2 and is available from Nokia™ in either the 32 bit or 64 bit version. Each includes the QtCreator, the Designer, the Assistant (API), the Linguist, and all the necessary libraries and utilities. Qt SDK can be installed in the user's home account and used to create applications regardless of which version of Qt libraries the KDE™ desktop requires, because the SDK startup script sets the shell environment to point to the SDK libraries.

To use the QtCreator without installing the SDK, one must first install the Qt components from the repository so that the Qt libraries, qmake, moc, debugger, and other utilities will be available to be automatically located by QtCreator when it is installed. Installing the following necessary packages in the order given will establish a proper QtCreator development environment:

  1. qt4-dev-tools

  2. qt4-doc (installs the API locally — to save HD space, use the online version)

  3. qt4-designer

  4. qt4-make

  5. qt4-qtconfig

  6. libqt4-sqlite

  7. qtcreator

Several other packages might be necessary depending on your needs. For example, if you want to create database applications, then libqt4-sql-psql, libqt4-sql-mysql, and libqt4-sql-sqlite will allow you to connect to a PostgreSQL™, MySQL™ or SQLite3™ database, respectively. Also consider qt4-demos, libqt4-dbg, libqt4-network, libqt4-script, libqt4-xml, python-qt4 (Python™ bindings), and libqt4-webkit.

One can also create Qt applications using just Qt-Designer, the Assistant, and the Linguist, by installing all of the 6 necessary packages listed above except for qtcreator, which can be replaced using Kate or your favorite text editor. In this case one runs the Qt-Designer to create the graphical user interfaces independent of the text editor used.

Qt™ Designer

The Designer is the graphical user interface (GUI) designing tool for graphical applications written using the Qt toolkit. Qt provides the building blocks — a broad set of customizable widgets, graphics canvas, style engine, and more that you need to build modern user interfaces. You can incorporate 3D graphics, multimedia audio or video, visual effects, and animations into your projects. Qt's integration with the WebKit™ web rendering engine means that one can quickly incorporate content and services from the web into their native application, and can use the web environment to deliver their services and functionality.

Qt™ Linguist

The Linguist is Qt's i18n tool (the word "internationalization" has 18 letters between its first and last letter). It allows for easy creation of translation files which are used with the translate (tr()) function to allow the text displayed by an application to be localized to the language of the user.

Qt™ Assistant

The Assistant is Qt's Application Programming Interface (API) with world class documentation for Qt. It deals with more than just Qt's tools and classes. The API for any release of Qt, its tools and addons can be found here. It includes the following: Class index, Function index, Modules, Namespaces, Global Declarations, and the elements of the new declarative tool QML™.

Other Qt API Topics are: Programming with Qt, Device UI's and Qt Quick, UI Design with Qt, Cross-platform and Platform-specific info, Qt and Key Technologies, and How-To's and Best Practices. Several dozen examples are documented. The Assistant also includes tutorials, demos and QML™ examples.

QtCreator

QtCreator is Qt's graphical IDE, linking a powerful text editor, the Designer and debugger in a GUI environment. The LGPL™ version includes connectivity to PostgreSQL™ and other open source databases. The commercial license allows connectivity to those open source databases and to proprietary databases like Oracle™. QtCreator is similar in power to Microsoft's Visual Studio C++™. Simple applications can sometimes be created without having to write a single line of code. The internet and YouTube™ is full of tutorials and videos describing all levels of Qt development.