Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼


Qt 5 Beta: A Developer's Tour

Qt 4.0 was released in June 2005, a full seven years ago. During that time, Qt has evolved a lot, making it better suited for mobile development. However, it was obvious that major changes were needed to better address the different needs of the Qt community and to finally make Qt a first-class citizen on mobile devices. The vision of Qt 5 was communicated in a blog post by Qt Chief Maintainer Lars Knoll in May 2011 — make better use of the GPU, allowing the creation of smoother and more fluid applications, even with limited resources, using Qt Quick and JavaScript as the primary building blocks. Even though Qt Quick provided a good development experience as of Qt 4.7, some fundamental changes were needed to ensure smooth, large-scale Qt Quick-based applications on embedded devices with limited resources. Additional important aspects of the vision were to provide better integration with Web content into any Qt application, but at the same time, acknowledge that some complexities and the amount of code needed to be reduced.

Development of Qt 5

Earlier versions of Qt were mostly developed in-house at Nokia (and previously, Trolltech). But since the launch of qt-project.org, a vibrant community has been participating in development of Qt 5 and many features and patches in Qt 5 (including supported platforms) have been done by the community.

The Qt Project governs the open source development of Qt. It allows anybody wanting to contribute to join the effort through a meritocratic structure of approvers and maintainers. All development is driven by the people contributing to the project.

Architectural Changes

In Qt 5, following major changes were accomplished:

All ports of Qt are based on the Qt Platform abstraction layer (QPA). QPA is the platform abstraction layer for Qt 5 and replaces QWS and the platform ports from Qt 4. Benefits of using QPA are that the architecture is much cleaner where platform dependent code is abstracted and the new abstraction makes it much easier to integrate Qt with new windowing systems.

New graphics architecture. Qt 5 introduces a new graphics architecture for Qt Quick using Scenegraph on top of OpenGL. OpenGL (ES) 2.0 is mandated for this to work. The new architecture makes it easier to integrate OpenGL-based content, such as shader effects, with Qt Quick-based applications. The QWidget-based stack continues to work as in Qt 4.x (based on QPainter), but supported back-ends have been limited to SW rasterization, pixmaps, and images, an OpenGL backend for GL surface,s and a backend for PDF generation and printing. X11 and CoreGraphics are no longer supported.

Modular repository structure. This enables more independent development of Qt modules, but also makes it easier to integrate contributions in the form of third-party modules to Qt. Modularization is also important because it also responds the need to have different requirements supported on desktops and tablets/mobiles.

All QWidget-related functionality is separated into its own library. A continued use of QWidgets is secured, but at the same time,it helps to have a clean architecture in Qt 5 to continue evolution of Qt Quick. Qt Widgets are also ported on top of QPA.

The Structure of Qt 5

Figure 1.

Modules have been split into Qt Essential Modules and Qt Add-on Modules. Essential modules are mandatory in all platforms. Add-on modules can be included optionally in Qt enabled platforms. Add-on modules can roughly be divided into following categories:

  • Modules that are provided for Qt 4.x compatibility
  • Modules that have been part of previous Qt mobility releases
  • Modules that are useful on a limited number of platforms like Qt D-Bus
  • Modules that are potential candidates to be part of Qt Essential modules in some future Qt release.

Essential Modules in Qt 5 are:

  • Qt Core: Contains core non-GUI functionality. All modules in Qt rely on this module.
  • Qt GUI: Extends QtCore with GUI functionality. Includes OpenGL.
  • Qt Multimedia: Provides audio, video, radio, and camera functionality. Requires GStreamer on Linux.
  • Qt Network: Provides classes to make network programming easier and more portable.
  • Qt Qml: qml and Javascript language module for Qt.
  • Qt Quick: Declarative framework for building highly dynamic, custom user interfaces.
  • Qt SQL: Qt support for SQL databases.
  • Qt Test: Classes for unit testing Qt applications and libraries. Note: Needed for conformance testing but not required to be included in the release. No compatibility promised.
  • Qt WebKit: A new WebKit- based implementation and a new QML API. See the Qt WebKit Widgets in the add-on modules.

You may notice that some modules from Qt 4.8 are no longer part of the essential modules like Qt XML, Qt SVG, QtOpenGL, etc. They have been moved to add-on modules in Qt.

Add-on Modules are:

  • Qt 3D: A set of APIs to make 3D graphics programming easy and declarative.
  • Qt Bluetooth: C++ and QML APIs for platforms using Bluetooth wireless technology.
  • Qt Contacts: C++ and QML APIs for accessing addressbook/contact databases.
  • Qt Concurrent: High level APIs for writing multi-threaded programs.
  • Qt D-Bus: UNIX-only library that you can use to perform Inter-Process Communication using the D-Bus protocol.
  • Qt Graphical Effects: Design neutral visual effects for Qt Quick 2.0.
  • Qt Image Formats: A set of plugins for additional image formats (TIFF, MNG, TGA, WBMP)
  • Qt JS Backend: A copy of V8 with additional changes needed for Qt. Used internally by Qt Qml. No public API is offered.
  • Qt Location: Provides location positioning, mapping, navigation, and place search via QML and C++ interfaces. NMEA backend for positioning.
  • Qt OpenGL: Classes that make it easy to use OpenGL in Qt applications. Provided to ease porting from Qt 4.x. For new code, use the QOpenGL classes in QtGui.
  • Qt Organizer: C++ and QML APIs for accessing organizer events (todos, events, etc.)
  • Qt Print Support: Classes to make printing easier and portable.
  • Qt Publish and Subscribe: Qt Publish and Subscribe.
  • Qt Quick 1: Classes from Qt 4 's QtDeclarative module. Provided for Qt 4.x compatibility. For new code, use the Qt Quick module.
  • Qt Script: Classes for making Qt applications scriptable. Provided for Qt 4.x compatibility, for new code use the QJS* classes in the Qt Qml module.
  • Qt Script Tools: Additional components for applications that use Qt Script.
  • Qt Sensors: Access to sensors via QML and C++ interfaces.
  • Qt Service Framework: Framework allowing clients to discover and instantiate arbitrary services.
  • Qt SVG: Classes for displaying and creating SVG files.
  • Qt System Info: Classes to discover system-related information and capabilities.
  • Qt Tools: Includes Qt CLucene, Qt Designer, Qt Help, and Qt UI Tools
  • Qt Versit: Part of a collection of Personal Information Management APIs providing a library to convert QContacts to and from vCard files etc.
  • Qt Wayland: Linux only. Replacement for the removed QWS functionality. Includes Qt Compositor API (server) and Wayland platform plugin (clients).
  • Qt WebKit Widgets: WebKit1 and QWidget based APIs from Qt 4.
  • Qt Widgets: Extends Qt Gui with C++ widget functionality.
  • Qt XML: C++ implementations of SAX and DOM. Deprecated, use QXmlStreamReader/Writer for new functionality.
  • Qt XML Patterns: Support for XPath, XQuery, XSLT and XML Schema validation.

These Qt Add-Ons module are a preliminary list and new ones might be added based on demand.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.