QOpenGLVersionProfile Class

Die Klasse QOpenGLVersionProfile stellt die Version und ggf. das Profil eines OpenGL-Kontextes dar. Mehr...

Kopfzeile: #include <QOpenGLVersionProfile>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpenGL)
target_link_libraries(mytarget PRIVATE Qt6::OpenGL)
qmake: QT += opengl

Öffentliche Funktionen

QOpenGLVersionProfile()
QOpenGLVersionProfile(const QSurfaceFormat &format)
QOpenGLVersionProfile(const QOpenGLVersionProfile &other)
~QOpenGLVersionProfile()
bool hasProfiles() const
bool isLegacyVersion() const
bool isValid() const
QSurfaceFormat::OpenGLContextProfile profile() const
void setProfile(QSurfaceFormat::OpenGLContextProfile profile)
void setVersion(int majorVersion, int minorVersion)
QPair<int, int> version() const
QOpenGLVersionProfile &operator=(const QOpenGLVersionProfile &rhs)

Detaillierte Beschreibung

Ein Objekt dieser Klasse kann an QOpenGLContext::versionFunctions() übergeben werden, um ein Funktionsobjekt für eine bestimmte Version und ein bestimmtes Profil von OpenGL anzufordern.

Sie enthält auch einige Hilfsfunktionen, um zu prüfen, ob eine Version Profile unterstützt oder eine Legacy-Version ist.

Dokumentation der Mitgliedsfunktionen

QOpenGLVersionProfile::QOpenGLVersionProfile()

Erzeugt ein standardmäßig ungültiges QOpenGLVersionProfile Objekt.

[explicit] QOpenGLVersionProfile::QOpenGLVersionProfile(const QSurfaceFormat &format)

Erzeugt ein QOpenGLVersionProfile-Objekt, das mit der Version und dem Profil aus format initialisiert wird.

QOpenGLVersionProfile::QOpenGLVersionProfile(const QOpenGLVersionProfile &other)

Konstruiert eine Kopie von other.

[noexcept] QOpenGLVersionProfile::~QOpenGLVersionProfile()

Zerstört das Objekt QOpenGLVersionProfile.

bool QOpenGLVersionProfile::hasProfiles() const

Gibt true zurück, wenn Profile von der OpenGL-Version unterstützt werden, die von version() zurückgegeben wird. Nur OpenGL-Versionen >= 3.2 unterstützen Profile.

Siehe auch profile() und version().

bool QOpenGLVersionProfile::isLegacyVersion() const

Gibt true zurück, wenn die von version() zurückgegebene OpenGL-Version veraltete Funktionen enthält und keine Profile unterstützt, d.h. wenn die OpenGL-Version <= 3.1 ist.

bool QOpenGLVersionProfile::isValid() const

Gibt true zurück, wenn die Versionsnummer gültig ist. Beachten Sie, dass diese Funktion bei einem standardmäßig konstruierten QOpenGLVersionProfile Objekt false zurückgibt.

Siehe auch setVersion() und version().

QSurfaceFormat::OpenGLContextProfile QOpenGLVersionProfile::profile() const

Gibt das OpenGL-Profil zurück. Macht nur Sinn, wenn Profile von dieser Version unterstützt werden.

Siehe auch setProfile().

void QOpenGLVersionProfile::setProfile(QSurfaceFormat::OpenGLContextProfile profile)

Setzt das OpenGL-Profil profile. Macht nur Sinn, wenn Profile von dieser Version unterstützt werden.

Siehe auch profile().

void QOpenGLVersionProfile::setVersion(int majorVersion, int minorVersion)

Setzt die Haupt- und Nebenversionsnummern auf majorVersion bzw. minorVersion.

Siehe auch version().

QPair<int, int> QOpenGLVersionProfile::version() const

Gibt ein QPair<int,int> zurück, wobei die Komponenten die Haupt- bzw. Nebenversionsnummern von OpenGL darstellen.

Siehe auch setVersion().

QOpenGLVersionProfile &QOpenGLVersionProfile::operator=(const QOpenGLVersionProfile &rhs)

Weist diesem QOpenGLVersionProfile Objekt die Version und das Profil von rhs zu.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.