Book Review: Programming with Qt, 2nd Edition

There are only 2-3 books regarding Qt, the popular GUI C++ Toolkit for UNIX, Windows, MacOS and embedded Linux. Without doubt, the most important and up-to-date book for Qt until now is “Programming with QT, 2nd Edition“, by Matthias Kalle Dalheimer, published by O’Reilly.The book I reviewed is the 2nd Edition, released only a month ago, adding support and documentation for Qt 3.x which was released in last October. Having read the 1st edition here and there, I was reluctant to buy it a year ago, for two reasons: Qt 3.0 was going to be released which was breaking compatibility with Qt 2.x, so the book was going to be out of date, and also, I already knew there was going to be a 2nd edition of the book. So, I waited, and the wait was the wise thing to do, as the book indeed is updated for Qt 3.x.


The book is one of the richest and most complete guides of any GUI Toolkit books I read so far (sample chapter). It starts with a really good introduction for Qt, and also pinpoints the reasons why Qt is using GUI emulation and not API emulation (Motif, MFC) or API layering (wxWindows). Quite some food for thought, really.


It continues with introducing the first program (a “Hello World,” what else?) and the unique approach of “messages” between components in Qt: The Signals and the Slots (not to be confused with the UNIX SIGNALs). To easily read the book and follow the flow, you will only need either C knowledge or some basic C++ knowledge. The book is well balanced, being advanced and simple at the same time, so it will serve both experienced C++ programmers and newbies.


Qt (some pronounce it “cute”) is all about the User Interface and its structure, so there are many chapters about how to use the built-in widgets, how to create your own, how to use the Qt Designer RAD tool, and even a whole chapter on how to design GUIs that make sense! Other intermediate content includes how to interface with the underlying OS, OpenGL and Perl, how to work with files and directories, how to use the HTML and Text processing modules, Localisation, and more. In the advanced sections, you will find well-defined information on debugging, networking, event handling, how to access databases, and my favorite chapter: Multithreading with Qt.


The book is not only focusing on how to write Qt apps, but also on how to make sure your code is portable among all supported platforms. And here is my second most important problem with the book: There is not much information about Qt under MacOS. While the author says that most of the code has been tested under MacOS, there are places in the book where there are tips of how to use or not to use something under Unix or Windows for portability, but there is no word for MacOS.


The biggest problem with the book though is the non-inclusion of a chapter that talks about how to interface with the KDE libs. While the author himself is a KDE developer (he is the original author of KChart for the KOffice package), I would expect some information on how to use QT with KDE. Sure, the book is all about Qt and not KDE, and also it is focusing on portability (if you interface with KDE, you lose your Windows/MacOS portability), however, most of the people who will purchase this book are KDE developers trying to learn Qt. These hackers outnumber the developers who are using Qt “professionally”, hence my request for a KDE-specific chapter.


The book contains lots of source code, however it comes with no CD, and also I could not find the source as a download on O’Reilly’s web site.


All in all, this is the best Qt book out there — very easy to follow and read, and if you are into OOP C++ programming (either a KDE hacker or a developer trying to find a truly portable and capable toolkit or if you are an ex-BeOS developer), you should take a look on both Qt and the book. You won’t regret it.


Overall: 9/10








Buy “Programming with Qt, 2nd Edition
at Amazon.com for less


3 Comments

  1. 2002-03-05 1:22 am
  2. 2002-03-05 1:33 am
  3. 2002-03-05 1:48 am