Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QOpenGLVersionProfile Class Reference

\inmodule QtOpenGL More...

#include <qopenglversionprofile.h>

+ Collaboration diagram for QOpenGLVersionProfile:

Public Member Functions

 QOpenGLVersionProfile ()
 Creates a default invalid QOpenGLVersionProfile object.
 
 QOpenGLVersionProfile (const QSurfaceFormat &format)
 Creates a QOpenGLVersionProfile object initialised with the version and profile from format.
 
 QOpenGLVersionProfile (const QOpenGLVersionProfile &other)
 Constructs a copy of other.
 
 ~QOpenGLVersionProfile ()
 Destroys the QOpenGLVersionProfile object.
 
QOpenGLVersionProfileoperator= (const QOpenGLVersionProfile &rhs)
 Assigns the version and profile of rhs to this QOpenGLVersionProfile object.
 
QPair< int, int > version () const
 Returns a QPair<int,int> where the components represent the major and minor OpenGL version numbers respectively.
 
void setVersion (int majorVersion, int minorVersion)
 Sets the major and minor version numbers to majorVersion and minorVersion respectively.
 
QSurfaceFormat::OpenGLContextProfile profile () const
 Returns the OpenGL profile.
 
void setProfile (QSurfaceFormat::OpenGLContextProfile profile)
 Sets the OpenGL profile profile.
 
bool hasProfiles () const
 Returns true if profiles are supported by the OpenGL version returned by version().
 
bool isLegacyVersion () const
 Returns true is the OpenGL version returned by version() contains deprecated functions and does not support profiles i.e.
 
bool isValid () const
 Returns true if the version number is valid.
 

Friends

bool operator== (const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
 
bool operator!= (const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
 

Detailed Description

\inmodule QtOpenGL

Since
5.1

The QOpenGLVersionProfile class represents the version and if applicable the profile of an OpenGL context.

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.

Definition at line 19 of file qopenglversionprofile.h.

Constructor & Destructor Documentation

◆ QOpenGLVersionProfile() [1/3]

QOpenGLVersionProfile::QOpenGLVersionProfile ( )

Creates a default invalid QOpenGLVersionProfile object.

Definition at line 41 of file qopenglversionprofile.cpp.

◆ QOpenGLVersionProfile() [2/3]

QOpenGLVersionProfile::QOpenGLVersionProfile ( const QSurfaceFormat & format)
explicit

Creates a QOpenGLVersionProfile object initialised with the version and profile from format.

Definition at line 50 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::majorVersion, QOpenGLVersionProfilePrivate::minorVersion, and QOpenGLVersionProfilePrivate::profile.

◆ QOpenGLVersionProfile() [3/3]

QOpenGLVersionProfile::QOpenGLVersionProfile ( const QOpenGLVersionProfile & other)

Constructs a copy of other.

Definition at line 61 of file qopenglversionprofile.cpp.

References other().

+ Here is the call graph for this function:

◆ ~QOpenGLVersionProfile()

QOpenGLVersionProfile::~QOpenGLVersionProfile ( )

Destroys the QOpenGLVersionProfile object.

Definition at line 70 of file qopenglversionprofile.cpp.

Member Function Documentation

◆ hasProfiles()

bool QOpenGLVersionProfile::hasProfiles ( ) const

Returns true if profiles are supported by the OpenGL version returned by version().

Only OpenGL versions >= 3.2 support profiles.

See also
profile(), version()

Definition at line 135 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::majorVersion, and QOpenGLVersionProfilePrivate::minorVersion.

Referenced by createFunctions(), and QOpenGLVersionFunctionsFactory::get().

+ Here is the caller graph for this function:

◆ isLegacyVersion()

bool QOpenGLVersionProfile::isLegacyVersion ( ) const

Returns true is the OpenGL version returned by version() contains deprecated functions and does not support profiles i.e.

if the OpenGL version is <= 3.1.

Definition at line 145 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::majorVersion, and QOpenGLVersionProfilePrivate::minorVersion.

Referenced by QOpenGLVersionFunctionsFactory::get().

+ Here is the caller graph for this function:

◆ isValid()

bool QOpenGLVersionProfile::isValid ( ) const

Returns true if the version number is valid.

Note that for a default constructed QOpenGLVersionProfile object this function will return false.

See also
setVersion(), version()

Definition at line 156 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::majorVersion, and QOpenGLVersionProfilePrivate::minorVersion.

Referenced by QOpenGLVersionFunctionsFactory::get(), and operator<<().

+ Here is the caller graph for this function:

◆ operator=()

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

Assigns the version and profile of rhs to this QOpenGLVersionProfile object.

Definition at line 78 of file qopenglversionprofile.cpp.

◆ profile()

QSurfaceFormat::OpenGLContextProfile QOpenGLVersionProfile::profile ( ) const

Returns the OpenGL profile.

Only makes sense if profiles are supported by this version.

See also
setProfile()

Definition at line 113 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::profile.

Referenced by createFunctions(), QOpenGLVersionFunctionsFactory::get(), operator<<(), and setProfile().

+ Here is the caller graph for this function:

◆ setProfile()

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

Sets the OpenGL profile profile.

Only makes sense if profiles are supported by this version.

See also
profile()

Definition at line 124 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::profile, and profile().

+ Here is the call graph for this function:

◆ setVersion()

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

Sets the major and minor version numbers to majorVersion and minorVersion respectively.

See also
version()

Definition at line 102 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::majorVersion, and QOpenGLVersionProfilePrivate::minorVersion.

◆ version()

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

Returns a QPair<int,int> where the components represent the major and minor OpenGL version numbers respectively.

See also
setVersion()

Definition at line 92 of file qopenglversionprofile.cpp.

References QOpenGLVersionProfilePrivate::majorVersion, QOpenGLVersionProfilePrivate::minorVersion, and qMakePair().

Referenced by createFunctions(), QOpenGLVersionFunctionsFactory::get(), and operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const QOpenGLVersionProfile & lhs,
const QOpenGLVersionProfile & rhs )
friend

Definition at line 49 of file qopenglversionprofile.h.

◆ operator==

bool operator== ( const QOpenGLVersionProfile & lhs,
const QOpenGLVersionProfile & rhs )
friend

Definition at line 42 of file qopenglversionprofile.h.


The documentation for this class was generated from the following files: