New Features in Qt 6.2
New & Restored Modules
- Added QtQuick.Dialogs module. This provides native dialogs with Qt Quick fallbacks for platforms where Qt does not have native dialogs. Currently FileDialog and FontDialog are available, with more to be added in future versions.
The following additional modules are available, that were not present in 6.1:
- Qt RemoteObjects
- The Qt RemoteObjects module has been ported to Qt 6 and the CMake build system.
- Qt SerialBus
- The Qt SerialBus module has been ported to Qt 6 and the CMake build system.
- The QCanBusFactory has been removed and QCanBusFactoryV2 was renamed to QCanBusFactory.
- QModbusRtuSerialSlave and QModbusRtuSerialMaster have been renamed to QModbusRtuSerialServer and QModbusRtuSerialClient and the new names shall be used in new code.
- Qt WebSockets
- The Qt WebSockets module has been ported to Qt 6 and the CMake build system.
- Qt WebChannel
- The Qt WebChannel module has been ported to Qt 6 and the CMake build system.
- QWebChannel properties are now bindable.
- The property update interval of QWebChannel can be configured. It still defaults to 50ms.
- QWebChannel supports property updates for BINDABLE properties. However, the client side does not provide a generic callback mechanism if the host property does not have a NOTIFY signal.
- Signals from objects living in a different thread are now handled correctly (QTBUG-51366)
- Qt WebEngine
- The Qt WebEngine module has been ported to Qt 6 and the CMake build system.
- The Qt WebEngine submodule for Qt Quick has been renamed from QtWebEngine to QtWebEngineQuick
- Several classes have been moved from QtWebEngineWidgets to QtWebEngineCore including QWebEnginePage
- Some functionality previously only accessible by deriving from QWebEnginePage can now be accessed using synchronous signals.
- Qt WebView
- The Qt WebView module has been ported to Qt 6 and the CMake build system.
- Qt Positioning
- The Qt Positioning module has been ported to Qt 6 and the CMake build system.
- Many of the properties are now bindable.
- Rename QGeoPolygon::path() to QGeoPolygon::perimeter.
- QGeoLocation now uses QGeoShape instead of QGeoRectangle as a bounding area.
- The error() signal in multiple positioning classes is renamed to errorOccurred().
- QGeoPositionInfoSourceFactoryV2 is removed, and QGeoPositionInfoSourceFactory now supports custom parameters for the created objects.
- NMEA support is redesigned. The serialnmea plugin is renamed to nmea and now supports reading the input stream from a TCP socket or a raw file. The nmeaSource property is removed.
New Features (within existing modules)
- QFlags::test(Any)Flag(s) methods.
- QHashSeed, to control hashing (seeds are now size_t); this shall replace qGlobalQHashSeed and qSetGlobalQHashSeed.
- PRIxQTDATATYPE macros to facilitate printf()-style formatting without casts or warnings.
- A permissions API to QCoreApplication (for things like access to camera, file system, network on devices).
- Many properties are now bindable.
- Grapheme clusters can now handle emojis.
- UNC paths and network shares on Windows are now handled consistently.
- QCalendar now supports construction from the ID of a custom backend.
- QChar, QPoint and QPointF are now primitive, rather than merely relocatable.
- QCoreApplication's exit() is now, like quit(), a slot (as the documentation has long claimed); same for QEventLoop and QThread.
- QDateTime now takes account of time-zones throughout time_t's range (in so far as the platform supplies such information), rather than artificially limiting the range to 1970–2037.
- QFlags has fleshed out its value-type behavior (and is now used more systematically).
- QList (hence also QVector) is now, when building for C++20, a contiguous_iterator satisfying contiguous_range.
- QLocalSocket::waitFor*() now support duplex operation on Windows (like they already did on Unix).
- QLockFile's methods now have std::chrono overloads (and avoid needless conversion between UTC and local time).
- QString can now be built from char8_t (when available).
- QThreadPool's thread priority is now configurable; and the threads share the pool's name, if it has one.
… and there's been lots of tidy-up, bug-fixing and improvements to documentation.
- Floating point image formats added to QImage for both 16-bit and 32-bit floats.
- Converting RGB images to, or painting RGB colors onto, grayscale images is now gamma corrected and produces in the luminance values of the input color space.
- Added support for selecting cells in a TableView by assigning it a ItemSelectionModel
- New control added: SelectionRectangle. This control can be used to select cells in a TableView by using a styled selection rectangle.
- TLS backends, that were previously (Qt 6.1) converted into plugin-like classes, now moved out of QtNetwork and became real plugins.
- Several TLS backends may co-exist at runtime, for example, OpenSSL and Schannel, or OpenSSL and SecureTransport.
- Introduced isBehindCaptivePortal, a new property that can be used to see if the user is connected to a network with a captive portal.
- More marker shapes are available to pick from in QScatterSeries and QLegend.
- Added Light marker feature to QXYSeries and QLegend. This is a lighter weight rendering of points.
- Added ability to select points in a series via method calls to QXYSeries and QBarSet.
- Added ability to set a color or use a custom light marker to be used for selected points in QXYSeries.
- Added ability to set a color to be used for selected bars in QBarSet.
- Added a feature to display the best fit line of QXYSeries through new methods added to QXYSeries.
- Added ability to customize the look of individual points in a series to QXYSeries. The feature allows one to set points visibility, points label visibility and points size.
- Added method “sizeBy” to QXYSeries that adjusts size of the points in the series according to passed values.
- Added method “colorBy” to QXYSeries that adjusts color of the points in series according to passed values and gradient.
- Added a new axis class QColorAxis to support colorBy feature, displaying a color scale.
- Added ability to disable label truncation in axes.
- Improved performance by caching recently used text bounds.
- Added interactive support to QLegend via a setInteractive method. Once enabled, allows the legend to be detached on double-click, and once detached, dragged and resized on the chart. Legend can then be automatically attached to an edge of the chart by dragging it off of the edge.
- Added attachedToChartChanged signal to QLegend.
- Updated legend example.
Boot to Qt
Changes in Installer
When creating Qt 6, we retain as much compatibility with Qt 5 as possible, but some changes were inevitable to make Qt a better framework. To make it easier to port to Qt 6, we have created a Porting guide to summarize those changes and provide guidance to handle them. In the guide, you can find links to articles about changes that may affect your application and help you transitioning from Qt 5 to Qt 6.