PySide6.QtOpenGL.QOpenGLVersionProfile¶
- class QOpenGLVersionProfile¶
The
QOpenGLVersionProfileclass represents the version and if applicable the profile of an OpenGL context. More…Synopsis¶
Methods¶
def
__init__()def
hasProfiles()def
isValid()def
__ne__()def
__eq__()def
profile()def
setProfile()def
setVersion()def
version()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
An object of this class can be passed to QOpenGLContext::versionFunctions() to request a functions object for a specific version and profile of OpenGL.
It also contains some helper functions to check if a version supports profiles or is a legacy version.
- __init__()¶
Creates a default invalid
QOpenGLVersionProfileobject.- __init__(other)
- Parameters:
other –
QOpenGLVersionProfile
Constructs a copy of
other.- __init__(format)
- Parameters:
format –
QSurfaceFormat
Creates a
QOpenGLVersionProfileobject initialised with the version and profile fromformat.- hasProfiles()¶
- Return type:
bool
Returns
trueif profiles are supported by the OpenGL version returned byversion(). Only OpenGL versions >= 3.2 support profiles.- isLegacyVersion()¶
- Return type:
bool
Returns
trueis the OpenGL version returned byversion()contains deprecated functions and does not support profiles i.e. if the OpenGL version is <= 3.1.- isValid()¶
- Return type:
bool
Returns
trueif the version number is valid. Note that for a default constructedQOpenGLVersionProfileobject this function will returnfalse.See also
- __ne__(rhs)¶
- Parameters:
rhs –
QOpenGLVersionProfile- Return type:
bool
- __eq__(rhs)¶
- Parameters:
rhs –
QOpenGLVersionProfile- Return type:
bool
- profile()¶
- Return type:
Returns the OpenGL profile. Only makes sense if profiles are supported by this version.
See also
- setProfile(profile)¶
- Parameters:
profile –
OpenGLContextProfile
Sets the OpenGL profile
profile. Only makes sense if profiles are supported by this version.See also
- setVersion(majorVersion, minorVersion)¶
- Parameters:
majorVersion – int
minorVersion – int
Sets the major and minor version numbers to
majorVersionandminorVersionrespectively.See also
- version()¶
- Return type:
.std.pairint,int
Returns a std::pair<int,int> where the components represent the major and minor OpenGL version numbers respectively.
See also