Qt 6 是努力使框架更高效，且更易于使用的结果。
为兼容每个发行的所有公共 API，我们试着维护二进制和源代码。但是，为使 Qt 成为更优框架，一些改变是不可避免的。
In this topic we summarize those changes in Qt GUI, and provide guidance to handle them.
Implicit construction of a QBitmap from a QPixmap is no longer supported. The constructor and assignment operator have been made explicit and marked as deprecated. Use the new static factory function fromPixmap 代替。
QKeyCombination is a new class for storing a combination of a key with an optional modifier. It should be used as a replacement for combining values from the Qt::Key enum with a modifier in a type-safe way.
We recommend migrating code that currently uses operator+() to combine a key and modifiers, as future C++ standards are likely to declare arithmetic operations between unrelated enumeration types as illegal. Use operator|(), and change APIs that expect an
to expect a
Existing APIs that expect an
for a key combination can be called using
QFontDatabase class has now only static member functions. The constructor has been deprecated. Instead of e.g.
The numerical values of the
enumerator have been changed to be in line with OpenType weight values.
() expects an enum value instead of an
, and code that calls the setter with an integer will fail to compile. To continue to use old integer values, use QFont::setLegacyWeight().
setRange() method is no longer marked as virtual.
With the introduction of Qt RHI as the rendering foundation in Qt, most classes prefixed by
have been moved into the
More details can be found in the Qt OpenGL porting guide .
One notable exception is the class QOpenGLContext , which still resides in Qt GUI.
In addition, the class QOpenGLWidget has been moved to a new module, named Qt OpenGL Widgets.
On Windows, ANGLE, a third-party OpenGL ES to Direct 3D translator, is no longer included in Qt. This means
and the environment variable
no longer have any effect. In
dynamic OpenGL builds
there is no automatic fallback to ANGLE in case OpenGL proper fails to initialize. For
based applications using OpenGL directly, for example via
, this means that OpenGL proper is the only option at run time. However, the alternative of using a pure software OpenGL implementation, such as Mesa llvmpipe that is shipped with the pre-built Qt packages, is still available. For Qt Quick and Qt Quick 3D applications, Qt 6 introduces support for Direct 3D 11, Vulkan, and Metal, in addition to OpenGL. On Windows the default choice is Direct 3D, therefore the removal of ANGLE is alleviated by having support for graphics APIs other than OpenGL as well.