Epilogue
This book has presented a broad range of approaches and techniques for Qt programming, although it has concentrated on key areas of Qts functionality. All of the books examplesthe .hpp
and .cpp
code files, the .qrc
resource files, and the Qt .pro
project fileswere created and edited using a plain text editor, and Qt Designer wasnt used at all. Nowadays, Qt development need not be quite so austere. For those who prefer to design their windows visually, the Qt Designer tool is available, and for those who want a complete IDE (Integrated Development Environment), the Qt Creator tool (which integrates Qt Designer) can be used. For the libraries and basic tools get a standard Qt distribution; for everythingincluding Qt Creatorget the Qt SDK distribution.
Qt contains an enormous amount of functionality, but nonetheless, additional components are available. Some are available from Qt Development Frameworksfor example, the Qt Solutions, many of which are now LGPL licensed. These provide many additional widgets and various utility classes; see qt.nokia.com/products/appdev/add-on-products/catalog/4. There are also third-party component providers. The Qwt library (qwt.sourceforge.net) provides widgets and utility classes of particular use in scientific and engineering applications. The LibQxt library (www.libqxt.org) provides a lot of utility modules and classes including bindings to the Berkeley DB library, and a wide variety of additional widgets. The qt-apps.org web site provides a repository for third-party Qt add-ons, and includes a large collection of components and widgets.
To learn more about Qt, naturally it is worth looking at the wide variety of Qt books now availableQt Development Frameworks maintains a list of them at qt.nokia.com/developer/books. In addition, ICS (Integrated Computer Solutions, Inc.; www.ics.com/learning/icsnetwork) regularly provides free online video webcasts that explain Qt technologies and provide summaries of whats new in new Qt releases. Most of the talks given at the Qt Development Frameworks annual Qt Developer Days are filmed and viewable online, with the keynotes and technical sessions being particularly interesting (qt.nokia.com/developer/learning/online/talks). Another useful source of Qt information is Qt Quarterly, a free online magazine that provides short timely articles on Qt programming (qt.nokia.com/doc/qq/index.html), although for more up to the minute information there is the corporate Qt blog, blog.qt.nokia.com, and even better, the Qt developers Qt Labs blog, labs.qt.nokia.com/blogs. Questions can be asked on the qt-interest
mailing listthis is a very high-traffic list, but it has some really excellent postersjust be sure to check with Google and the documentation first, to avoid being flamed!
Qt Development Frameworks provides a roadmap (qt.nokia.com/developer/qt-roadmap) that describes where Qt is heading. As might be expected from a Nokia-owned company, the roadmap includes new APIs supporting touch screens and mobile phone-related APIs for messaging and mobile services. But there is also lots of interest for desktop developers.
The biggest new feature, scheduled for release in Qt 4.7, is Qt Quick (Qt User Interface Creation Kit). This will introduce a completely new paradigm for creating user interfaces. Qt Quick uses a JavaScript-based declarative language, QMLQt Meta-Object Languagethat makes full use of the animation and state machine frameworks to provide very slick and easy-to-create user interfaces. Using Qt Quick is much more flexible than the conventional widgets and layouts approach, and makes it really easy to apply animated transformations to widgets. Qt Quick is best for situations where an application needs different user interfaces for different devices and form factors. The traditional QWidget
s approach is best for when we want a single user interface design to be used on all targets and that has excellent integration with the platforms native look and feel. So, overall, Qt Quick is ideal for consumer electronics and embedded devices, whereas QWidget
s are ideal for desktop applications.
In the medium to long term, there is also a huge amount of work going on in the field of graphics. Considerable efforts are being made to provide a simpler and more Qt-like 3D API as a layer above the OpenGL APIs (which will remain fully accessible), so as to abstract away as much of the complexity and platform specificity of the OpenGL APIs as possible.
Here are a few things that arent on the roadmap, that perhaps should be. The undo/redo framework ought to be fully integrated with the model/view architecture. At present it isnt easy to provide undo/redo for models and even when it is achieved, we must be careful to use our own methods for certain operations rather than the usual ones, to keep the undo/redo working correctly. Another thing that would be nice to see is improved database support. At present no Qt widget understands NULL values, and the database support feels like it has been rather awkwardly squeezed to fit the model/view architecture. Also, database behavior, particularly regarding SQLite, seems to change in subtle ways even between minor releases. Lets hope that future Qt versions improve in this area. On a more positive note, the Item Views NG (Next Generation) project seems to be making steady progress, and is on its way to being more powerful, more flexible, and yet easier to use than the current model/view architectureand by the time you read this, it might be ready for prime time.
A few more blue skyand personalwishes for a future Qt would be the addition of a PDF API that supports the reading, editing, and writing of PDF files, and that covers every PDF feature. It would also be nice if Qt provided a similar API for reading and editing Open Document Format files, as well as improving the writing of files in this format. Support for reading and writing the most common archive formats would be usefulespecially .tar
files (including those compressed with gzip
or bzip2
), and .zip
files (for which Qt already has internal APIs, at least for writing). It would also be nice to see Qt increasing its support of larger environmentsfor example, with high-level APIs to support clientserver programming. And, of course, more widgets would be welcome, particularly 2D and 3D graph widgets that would make Qt more convenient for scientific and engineering users out of the box. For Qt 5, it would be nice to see the Meta-Object Compiler being dropped. The Boost libraries have already shown that it is possible to implement a signals and slots mechanism and a property system using standard C++, but whether it is possible to implement all of (or enough of) Qts object model remains an open question.
Of course, it is no longer necessary to wait for the Qt developers to add the features that we want. Qt is now developed in a more open way than ever before, so if there is a feature you would like added, you can implement it yourself and try to get it merged into the official version of Qt: see qt.gitorious.org for details.
Qt is a superb software development framework that has seen a huge investment by Nokia to improve and extend the functionality it offers. Qt can be used for non-GUI programming, including servers, web backends, and command line tools; and for GUI programming, supporting applications that have sophisticated, attractive, and highly dynamic user interfaces. Qt can be used on embedded devicesanything from toasters to mobile phones and PDAsthrough to desktop systems and way beyond.
Qts huge size can be daunting, but once the fundamentals are learned, Qts API consistency makes it straightforward to learn whatever other classes and modules are relevant to your needs. The excellent documentation, Qts examples and demos source code, books such as this, the online resources mentioned above, training courses, and, of course, Qts own source code should be sufficient for anyones learning needs. And unlike some platform-specific libraries we could mention, Qt makes programming a pleasure, allowing us to develop on the platform of our choice, and to deploy on the platforms our users prefer.