A look at Qt 5.1

published at 06.07.2013 16:56 by Jens Weller
Save to Instapaper Pocket

This week Qt5.1 was released, which has become much more than a bug fix release, Qt5.1 brings the technical previews for Android and iOS plus some new features of Qt Quick. With Qt5.1 the 5.x branch of Qt is ready for production, and with 5.2 expected at the end of 2013, ready to rollout to Android and iOS. I have previously blogged about Qt5, and especially about its multimedia module for playing mp3 or recording videos. The multimedia section of Qt has no major update for this version.

So whats new in Qt5.1?

QML and Qt Quick have become major citizens in Qt, so with every further update, their support will be improved and extended. But I'll get later to the improvements for Qt Quick. And Qt Creator 2.7.2 is bundled with the release. Also the technical previews for Android and iOS require an extra download, they are not bundled with the standard Qt SDK.

QSerialPort

With this version of Qt, reading from the serial port is now fully supported, and there is an QIODevice for doing so: QSerialPort. It is supported on all major platforms, and with QSerialPortInfo you can retrieve further information about the hardware your application is running on. QSerialPortInfo::availablePorts() will give you a list of the available serial ports on your machine. What still is missing is Bluetooth support for Qt, there is an Add-on, but it seems not to be maintained currently.

Qt Sensors

With this release, Qt starts to support sensors on the platforms Android, iOS, Mer and BlackBerry10. This module is compatible to the old Qt Mobility Sensors 1.2 package. Qt Sensors supports various different input sensors, such as accelerometer, ambient light, compass, gyroscope, light sensor, magnetometer, proximity, rotation or tap and tilt sensors. QSensor is the base class, which offers the base implementation of the concrete sensors. With QSensorFilter and QSensorReader one can filter and read sensor data.

Combining Qt Quick and QWidget

QWidget is now able to embed instances of Qt Quick Views and QWindows, which are the base for 2d Windows now in Qt. QWidget itself does not derive from QWindow. With QWidget::createWindowContainer() now QWindow derived classes such as QQuickView or a QWindow using QOpenGLContext can be integrated into a QWidget hierarchy.

Qt5.1 additions

A number of new additions has come to Qt with Version 5.1. So has SHA3 support been added to QCryptographicHash, QMessageAuthenticationCode added for HMAC support. The OpenGL support has been further improved. QNetwork can now reuse OpenSSL sessions, making connections to servers faster, also certificate checking has been improved. Also the dependency to Perl for building Qt has been removed, with the exception of the webkit modules.

New Stuff in Qt Quick

With Qt5.1, there a couple of new things in Qt Quick. First, Qt Quick has now dialogs, which I think is important especially for the desktop. Also, with this release Qt Quick Controls are fully supported. Qt Quick Controls are what QWidgets have been to Qt. There is finally a way to do UI in QML without using rectangles and making your own buttons. Also with this version, a few new views (SplitView, ScrollView, TableView)have been added to QtQuick. Also new is a platform property, which exposes the current platform to QtQuick, possible values are:

Also the Standard Dialogs will be supported starting with this release, for now its ColorDialog and FileDialog. More Dialogs will be added. Also, the new Qt Quick Layouts allow for dynamic resizing and layouting of QtQuick Applications.

Support for Android and iOS

There is a lot of excitement for the support of Android and iOS as mobile platforms. Still, both have their limitations, on iOS for example it is very hard to get QtQuick running, as an App can not bring its own JIT with it. Hence QtQuick 2 will not be available to iOS in this release. The core functionality of Qt with networking, OpenGL and QtCore plus QtQuick 1 is supported on both platforms. Also a set of "commonly used" Sensors is supported on iOS and Android. It is possible to launch and debug your application from QtCreator for Android, iOS will require XCode to launch your application. Not sure about debugging, as I'm not a XCode user.

Join the Meeting C++ patreon community!
This and other posts on Meeting C++ are enabled by my supporters on patreon!