Today we released the Alpha of Qt 5, the first major release since the Qt Project went live. A lot of people have worked hard to make this release happen. A large amount of work and features that went into this alpha have been coming from people not working for Nokia. It’s great to see that the project has become a place where many people meet and together push Qt forward.
The main purpose of the Qt 5 Alpha release is to get feedback that helps us make the coming releases better. For the Alpha we focus on the delivering the Qt Essential modules, which forms the foundation of the functionality Qt 5 will offer.
The alpha can be downloaded from http://qt-project.org/wiki/Qt-5-Alpha. Note that the alpha release is a source-only release without binaries to download, so you need to build the binaries yourselves. Build instructions can be found at http://qt-project.org/wiki/Qt-5-Alpha-building-instructions
We have now been working for around 9 months on Qt 5, following the ideas I outlined in a blog in May last year. The blog talked about a couple of objectives we had for Qt 5, and I’d like to reflect a bit on what we achieved.
There was one basic vision driving a lot of the Qt 5 work:
“Qt 5 should be the foundation for a new way of developing applications. While offering all of the power of native Qt using C++, the focus should shift to a model, where C++ is mainly used to implement modular backend functionality for Qt Quick.”
I can say that we came a good way closer to this vision with Qt 5.0. The model is working nicely on the embedded side of Qt where UIs are full screen. On the desktop, we have laid most of the foundations required for this model, but it’ll take us until 5.1 or 5.2 to really take this into use.
Developing in the open
We wanted to develop Qt 5 in the open, with a strong community around it. Since the launch of qt-project.org, we have seen a vibrant community forming there, and many of the patches and new features we will have in Qt 5 are coming from the community.
Four big architectural changes
Then we had set out to do four major changes to Qt’s internal architecture:
- Base all Qt ports on Qt Platform Abstraction layer (QPA) – Make it easier to port Qt to other windowing systems and devices
With QPA we have fundamentally changed how Qt integrates with the windowing system of the underlying OS. QPA was introduced in Qt 4.8 as a replacement for QWS/Qt Embedded, but is now used exclusively for all platforms. This move created a lot of work and forced us to rewrite a very large part of pour platform dependent code. But it also helped us create a much cleaner architecture where the platform dependent code is nicely abstracted. We can see that the new abstraction makes it significantly easier to write integration with new windowing systems, and the backends that are being written for QNX, Android and iOS prove this.
- Re-architect our graphics stack – Increase performance versus Qt 4, using Qt Quick and OpenGL (ES) 2.0
Qt 5 introduces a new graphics architecture for Qt Quick, using a Scenegraph on top of OpenGL. This requires OpenGL (ES) 2.0 at the minimum to work. QtGui now contains a set of QOpenGL* classes, that replace the old QGL* classes (they are still available for compatibility). We also introduced a new QGuiApplication class that is more lightweight than QApplication and a QWindow class for handling top level windows on the screen.The QWidget based stack continues to work as in Qt 4.x, based on QPainter. QPainter does however support less backends than it used to. It is now limited to SW rasterization (Raster backend) for drawing to the screen, pixmaps and images, an OpenGL backend for GL surfaces and a backend for PDF generation and printing. The platform dependent backends using X11 or CoreGraphics are gone.This allows us to introduce the new graphics architecture for the long term while keeping full compatibility with Qt 4.x on the QWidget side.
- Modular repository structure for increased flexibility and to meet the merge of desktop and mobile – add /remove user specific modules as needed and a full integration of the Qt mobility APIs
This is mainly an internal housekeeping item, that won’t be directly visible to developers using Qt. But the modularization of the Qt repositories makes it easier for us to move the different parts of Qt forward in a more independent way. This will become increasingly important now that Qt 5 is stabilizing and once we release 5.0 and start keeping binary compatibility.The modularization is not yet fully done, esp. the qtbase repository still contains many modules that should be separated. So this work will most likely continue after 5.0 is out.The modularization of Qt also makes it a lot easier to integrate contributions in form of 3rd party modules to Qt. It also responds to the trend of having different requirements on laptops and tablets/mobiles with regard to especially mobile features such as locations, sensors etc.In Qt 5 we will see the Qt mobility APIs as an integrated part of Qt – some of them as part of the group of modules that are seen to be essential for Qt = “Qt Essentials”. By offering the modular approach, other modules can be added in a simple way, and we are already today sure that Qt5 will offer a richer feature list than any earlier Qt version. Please notice that this alpha release is focused on Qt Essentials.
- Separate all QWidget related functionality into its own library
By separating QWidgets into a separate repository, we secure a continued use of QWidgets for those that desire, but also a path to a model where all UIs are being done in QML and Qt Quick. Separating the QWidget based functionality into its own library is therefore a good measure to achieve a clean architecture in Qt 5 in the long term.
The announcement of these changes created a lot of response, and we have already addressed a lot of the common questions about Qt 5 and these architectural changes earlier.
In addition to the architectural changes, Qt 5 also offers a lot of new functionality. I’d just like to highlight a couple of them here, you can find a detailed list with descriptions on our wiki.
- Qt Core
Many new features have been added to QtCore. We now have a QStandardPaths class giving you the standard locations for things such as media and documents on your platform. A JSON parser and speed optimized binary format for JSON are included. We have added support for Mimetype recognition, both on extension and file content. A new compile time checked signal/slot connection syntax has been added and we have a completely new Perl compatible regular expression engine included.Many of our data structures have been rewritten and optimized for better performance. We also added C++11 support where it makes sense. But Qt continues to compile and work with a C++98 compliant compiler.
- Qt Gui
All QWidget based classes have been separated out into the QtWidgets library. QtGui has gained support for top level surfaces through the QWindow class, and now has builtin OpenGL support.
- Qt Network
We added support for DNS lookups and removed the QHttp and QFtp classes (they are available standalone for those that need them). Lots of smaller improvements.
- Qt Widgets
Got ported over to the new QPA architecture and should work as you are used to from Qt 4.x.
- Qt Quick
- Qt 3D and Qt Location
Some additional modules have been added to the set of Qt Essentials, most notably Qt 3D to integrate 3d content with Qt and Qt Location giving access to GPS, Maps and other location based services.
- Qt WebKit
The WebKit C++ APIs have not changed since Qt 4.x, but Qt Webkit got updated to a newer version from webkit.org giving us many improvements and better HTML 5 compliance. Compilation is currently disabled on Windows for this alpha, as building it right now is rather complex. We’re working on having this re-enabled and fully working for the beta.
Porting from Qt 4.x to Qt 5
There is a binary and to a smaller extent source compatibility break between Qt 4.x and Qt 5. We have however worked hard to make an easy and smooth transition of existing code to Qt 5 possible. As an example we currently have Qt Creator compiling and running against Qt 4.x and Qt 5 using the same code base.
If you want to try out your own project against Qt 5, you can find detailed porting instructions here.
Please also note that there is no immediate need to port your app to Qt 5, as Qt 4.8 is still there and supported by the community and companies such as Digia for some time to come. But we firmly believe that Qt 5 will offer enough benefits to consider moving.
As you can see a lot of things have happened since the work on Qt 5.0 started. I am very happy with what we have achieved so far. You can now all help us finalizing Qt 5 by downloading the alpha, trying it out and giving us feedback.
All feedback should go to the qt development list (firstname.lastname@example.org, see also lists.qt-project.org), or simply reported as bug reports in our bug tracking system. Any patches and bug fixes are of course also highly welcome, please submit these to codereview.qt-project.org.
The Alpha is the first step towards a final release of Qt 5, and focus from now on will be fully on ironing out the remaining issues so that we can deliver a final Qt 5.0 to you as soon as possible.
There have been too many people involved in getting to this point to mention them all, but I’d like to say thanks to every one who has contributed in some form to this release.