advertisement

Print
What's New in Qt 2.2.2

by Boudewijn Rempt
11/24/2000

The Qt Palmtop Environment

Palmtop is becoming an exciting area of Linux development. While most Linux PDA projects are still vaporware (see All Linux PDA: Fact or Fiction), other projects have come to full fruition. One of these is the Qt Palmtop Environment.

Qt Palmtop is licensed under the GPL. You can download the source these ways: a binary that runs on top of Linux, a binary that runs from a single boot floppy on any PC, a binary for the iPAQ, or a binary for the Cassiopeia.

The package is fairly large -- about 2.5 MB. Another project, Microwindows, has delivered a a package that needs a mere 100 KB for its environment, but that excludes the base OS and all applications.

Qt Palmtop is more than just a GUI and a window manager. It offers a choice of input methods (handwriting, picklists, Unicode) and all the utilities you need on a palmtop plus games and even an MPEG player!

Now you can comfortably run a Linux-based PDA and have it do everything that you want it to do. Hack it as much as you like! Qt Palmtop offers all the features of Qt for Windows or X11, such as the canvas, plus new features such as handwriting recognition.

Go to Troll Tech, and start playing...

I just spent some time with the final release of Qt 2.2.2. Qt is best known as the toolkit underlying KDE, but it's also a very complete cross-platform C++ toolkit in itself, used by an increasing number of commercial applications such as Opera.

Qt applications can be run on three platforms: Unix/X11, Windows, and embedded Linux. Qt has been certified open source since version 2.0, the Unix/X11 version is released under GPL since version 2.2, and the embedded version is GPL since version 2.2.2. The Windows version remains proprietary in the sense that developers need to pay for a license, but there are no run-time restrictions. For instance, the GPLed Python bindings to Qt, PyQt, are available freely with a Qt dll for Windows.

Qt Designer is beautiful GUI

What's new in Qt 2.2? The coolest, most impressive addition is Qt Designer. This is a great GUI design utility. I've reviewed Qt Designer before (see Visual Design with Qt), but to sum it up: Qt Designer is a very stable, very easy-to-use dialog designer. It is especially good in creating complex dynamic layouts (helped by Qt 2.2's vastly improved layout managers) and in supporting the well-known signals/slots architecture.

The design is sensible: There's a separate GUI designer that saves the designs in an XML formatted file, and a compiler, uic, that takes the design files and creates C++ code. This opens up the possibility of writing all kinds of extensions to the system, and indeed, there is already a pyuic available that can generate Python code instead of C++. Designer is a truly wonderful tool, and now with version 2.2.2, it can even import the Microsoft standard .RC dialog resources files.

OpenGL, XML modules, and more

With Qt 2.2, the toolkit has certainly become very comprehensive, offering almost everything that's needed for application development, and Troll Tech has decided to split the library into several modules. Paying customers can choose between a professional and an enterprise edition, the difference being the number of modules they receive. Users of the free edition get the full set, but their development has to be open source, too.

You can choose which modules are compiled into the library, but you cannot compile modules into smaller, separate libraries.

The following modules are available:

  • Canvas - a sophisticated 2D drawing area that allows more than one concurrent view
  • Iconview - an area with movable, labeled icons
  • Network - a complete set of easy-to-use network classes
  • OpenGL - a widget that allows rendering of OpenGL
  • Table - an editable table widget
  • Workspace - an MDI implementation
  • XML - a SAX2 XML parser and a DOM tree implementation.

XML parser and DOM implementation

The advent of Qt Designer has brought about several other new features. Most notable amongst these is the XML parser and DOM tree implementation. The parser has a SAX2-compliant interface, but the naming is adapted to the Qt standards. This fast XML parser has already been very useful in the development of the upcoming KDE 2 desktop.

Another improvement that should come as a godsend to developers is the QAction/QActionGroup combo. This is a mechanism whereby a certain user interface action can be defined at once both for a toolbar and a menu item, together with accelerator keys. These actions can then be logically grouped in QActionGroups. I've been building something like this time and again for my own applications ever since Qt 1.44, but never getting it really right, and the Troll Tech implementation works very well indeed.

Troll Tech has taken some flack for their QString class, with detractors arguing that Troll Tech should use the standard C library string. However, QString offers excellent Unicode support, and Troll Tech is committed to bringing the same level of Unicode support to Unix/X11 as Windows 2000 has. The standard C library string just doesn't offer that.

And Qt offers a decent mechanism for producing localised applications, too. Version 2.2.2 brings numerous improvements to this area, with expanded support for Chinese and Thai. Internationalisation is further helped with the BSD-style licensed Qt Linguist.

Qt has now started building real support for threading, with QMutex, QSemaphore, QCondition, and QThread. Other extremely usable classes are available for networking applications, like QSocket, QServerSocket, or QNetworkOperation, and for encoding text, like QTextCodec, QTextEncoder, and QTextDecoder.

Pages: 1, 2

Next Pagearrow