Trolltech | Documentation | Qt Quarterly | « Unblocking Networking

What's New in Qt 3.3
by Jasmin Blanchette
Qt 3.3 is now available. This new version introduces many improvements over Qt 3.2. We will review the most important changes in this article; for a complete list of what has changed, see

New QLocale Class

The QLocale class offers number-to-string and string-to-number conversions for various languages. For example: //0vx {

    QLocale iranian(QLocale::Persian, QLocale::Iran);
    QString s = iranian.toString(195);  // s == "195"
    int n = iranian.toInt(s);           // n == 195
    QLocale german(QLocale::German, QLocale::Germany);
    QString s = german.toString(3.14);  // s == "3,14" (comma)
    double d = german.toDouble(s);      // d == 3.14

The user's default locale is used by QString::sprintf() to produce locale-dependent numeric output. For QString::arg(), the C locale is used by default, but this can be overridden by using the %L syntax as follows:

    s1 = QString("%1 cars").arg(195);   // s == "195 cars"
    s2 = QString("%L1 cars").arg(195);  // s == "195 cars"

It is expected that QLocale will be developed further in Qt 4 to support other locale categories.

Improved .NET Support

Qt's ActiveQt module has been improved to work smoothly in a .NET environment. ActiveQt can be used as a bridge to export Qt widgets and other components through Microsoft COM.

The Qt reference documentation has been extended to explain how to write Qt applications that interoperate with .NET without sacrificing portability. It also explains how to use a manual approach using Microsoft's managed extensions to the C++ language---the "It Just Works" approach. See for details.

New Database Drivers: Interbase and SQLite

Two new database drivers have been added to the SQL module, Interbase and SQLite. The SQLite database is included in the Qt 3.3 distribution and can be enabled by passing -qt-sql-sqlite or -plugin-sql-sqlite to the configure script on Unix. SQLite is an in-process database and does not require a separate database server. The Interbase plugin also works with Firebird, the open source version of Interbase.

Precompiled Headers

The qmake tool in Qt 3.3 allows you to specify precompiled headers for Windows (MSVC), Mac OS X (GCC 3.3), and X11 (GCC 3.4). To use precompiled headers when compiling your Qt application, add PRECOMPILED_HEADER to your project file:


For more information about using precompiled headers, see

Enhancements to the ActiveQt Framework

The ActiveQt framework, first available in Qt 3.1, has been enhanced in lots of ways in Qt 3.3.

Semi-Transparent Windows

Support for semi-transparent top-level widgets on Mac OS X and Windows 2000/XP has been added. To make a widget semi-transparent, call QWidget::setWindowOpacity() with an opacity level between 0.0 and 1.0, for example:


Other Improvements

This document is licensed under the Creative Commons Attribution-Share Alike 2.5 license.

Copyright © 2004 Trolltech Trademarks Qt Quarterly »