BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Qt 6 Improves QML, Adopts C++17, and More

Qt 6 Improves QML, Adopts C++17, and More

This item in japanese

Qt 6 is a new major release of Qt, the free and open-source, cross-platform toolkit for creating GUI apps that powers Linux's KDE desktop environment. While striving to keep full source compatibility, Qt 6 brings many changes, including improved QML, a new graphic architecture, C++17 support, improved tooling, and more.

Qt 6 keeps its adherence to the usual Qt tenets, including cross-platform support, scalability across multiple form factors, maintainability and compatibility with previous versions.

According to The Qt Company, which currently develops and supports commercially Qt, QML was, along with Qt Quick, one of most rapidly growing parts of Qt. So, the company took the chance of a major release to start working on what it calls "next-generation QML". In Qt 6.0 landed some preparatory work, including property/bindings in QtCore, to pave the way to further QML development in future minor releases. The actual plan for QML includes support for strong typing, better integration between QObject and QML by removing duplicated data structures, efficient compilation to C++, etc. These changes should also affect performance by eliminating unnecessary overhead.

On the graphics front, Qt 6 also brings a number of changes to prepare for moving away from OpenGL, which is now deprecated in favour of Vulkan for Linux and Metal on the Apple platform. To this aim, Qt 6 introduces a new layer encapsulating the graphics API, thus making it possible in future to work seamlessly with heterogeneous lower-level APIs. Additionally, to make it easier to mix 2D and 3D content, Qt 6 introduces Qt Quick 3D, which extends Qt Quick with 3D capabilities. Qt Quick 3D also improves support for glTF2, improves its renderer and resource management, and brings official support for iOS.

Qt Quick now offers better support for native styling of UI elements, thus enabling native look and feel. Work to extend the number of native controls is ongoing and new controls will be added in future minor releases of Qt 6, including switch and range slider controls.

As mentioned, Qt 6 makes C++17 a requirement in order to adopt its more advanced language features. Considering that Qt 5 was based on C++98, this represents a big leap forward, opening the way to providing support for modern C++ syntax in Qt 6 API.

C++ offers a lot more functionality out of the box that wasn’t available when we did Qt 5. Our goal with Qt 6 has to be to better integrate with this functionality, without losing backward compatibility.

Last but not least, Qt 6 officially adopts CMake as its build system, due to its wide availability and extended support by the community. Qt old build system, qmake, will not be phased out yet, but the recommendation is using CMake for new projects.

Although Qt 6 strives to be backward-compatible with Qt 5, you may want to read the official porting guide to understand the extent of changes required to port an existing program.

Rate this Article

Adoption
Style

BT