IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Changes to Qt GUI

Migrate Qt GUI to Qt 6.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Changes to Qt GUI▲

Qt 6 is a result of the conscious effort to make the framework more efficient and easy to use.

We try to maintain binary and source compatibility for all the public APIs in each release. But some changes were inevitable in an effort to make Qt a better framework.

In this topic we summarize those changes in Qt GUI, and provide guidance to handle them.

Kernel classes▲

 

The QBitmap class▲

Implicit construction of a https:// from a https:// is no longer supported. The constructor and assignment operator have been made explicit and marked as deprecated. Use the new static factory function https:// instead.

The QCursor class▲

Implicit construction of a https:// from a https:// is no longer supported, the constructor has been made explicit.

The QKeyCombination class▲

https:// 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 https:// 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 int to expect a https:// instead.

Existing APIs that expect an int for a key combination can be called using https://().

Text classes▲

 

The QFontDatabase class▲

The https:// class has now only static member functions. The constructor has been deprecated. Instead of e.g.

 
Sélectionnez
const QStringList fontFamilies = QFontDatabase().families();

use

 
Sélectionnez
const QStringList fontFamilies = QFontDatabase::families();

The QFont class▲

The numerical values of the https:// enumerator have been changed to be in line with OpenType weight values. https://() expects an enum value instead of an int, and code that calls the setter with an integer will fail to compile. To continue to use old integer values, use QFont::setLegacyWeight().

Painting classes▲

See the porting guide for https:// for information about https:// and other printing related classes.

Utility classes▲

 

QIntValidator and QDoubleValidator▲

The https://() method is no longer marked as virtual.

OpenGL classes▲

With the introduction of Qt RHI as the rendering foundation in Qt, most classes prefixed by QOpenGL have been moved into the https:// module.

More details can be found in https://.

One notable exception is the class https://, which still resides in Qt GUI.

In addition, the class https:// has been moved to a new module, named Qt OpenGL Widgets.

The QOpenGLContext class▲

The QOpenGLContext::versionFunctions() function is replaced by https://(). https:// is a public class now, part of the https:// module.

ANGLE▲

On Windows, ANGLE, a third-party OpenGL ES to Direct 3D translator, is no longer included in Qt. This means https:// and the environment variable QT_OPENGL=angle no longer have any effect. In dynamic OpenGL builds there is no automatic fallback to ANGLE in case OpenGL proper fails to initialize. For https:// or https:// based applications using OpenGL directly, for example via https://, 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.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.