Preface to the Second Edition

[ fromfile: preface2e.xml id: preface2e ]

It is hard to know when a book is 'finished,' especially when writing about a subject (Qt) that is also under constant development. So, like Qt, our book has also been under constant development since its conception.

Since the publication of the first edition, Trolltech released Qt 4.2, Nokia purchased Trolltech, Nokia released Qt 4.7.3, and Alan became a Nokia Certified Qt Specialist.

In the second edition there are improvements in every chapter. Many eyeballs have scrutinized it, and we have rewritten a number of examples and explanations. We have added new exercises and review questions, some with handouts and solutions.

The first part of the book has been rearranged to introduce Qt earlier than before. We decided to take advantage of some of Qt's static convenience functions to write simple dialog-based applications prior to fully covering classes, functions, etc. File Streams have also been introduced earlier so that we could present more interesting examples and assignments.

Widgets, MainWindows, Models and Views, Reflection, Threads, and Databases have all been rewritten to use new classes that have been added to Qt since our first edition went to press. The Models and Views chapter has been revised, and now explains the use of Delegates, QXmlStreamReader, QStandardItemModel, QFileSystemModel, QColumnView, sorting and filtering, cut and paste, and drag and drop.

The section on threads has been completely rewritten to highlight the advantages of using QtConcurrent algorithms rather than managing the QThreads directly from your code.

The Dynamic Forms section is gone. Instead, we show how to design forms manually and with the assistance of QtCreator/Designer, pointing out various techniques of integrating designer forms with user code.

The media player labs and solutions have been rewritten to use Phonon.

The FileVisitor example, which was originally developed back in the Qt3 days, has outlived its usefulness now that we have QDirIterator. The section on Iteration is new, and there is no longer a section devoted to the rarely used Visitor pattern. Instead, we emphasize the Iterator Pattern.

Some classes we placed in our libraries have been simplified or adapted to use the capabilities of the newest Qt components. We show new smart and shared pointers, and how to use them.

More design patterns have been introduced and described. For each pattern, we have either provided an implementation (perhaps as an exercise) or, where appropriate, we have pointed out the Qt classes that implement or use the pattern.

Tips and best practices have been taken from various sources including Nokia's official Qt training material, and are made available to you here.