このページでは

QOpenGLVersionProfile Class

QOpenGLVersionProfile クラスは、OpenGL コンテキストのバージョン、および該当する場合はプロファイルを表します。詳細...

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

パブリック関数

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)
std::pair<int, int> version() const
QOpenGLVersionProfile &operator=(const QOpenGLVersionProfile &rhs)

詳細な説明

このクラスのオブジェクトを QOpenGLContext::versionFunctions() に渡すことで、OpenGL の特定のバージョンおよびプロファイルに対応する関数オブジェクトを要求することができます。

また、バージョンがプロファイルをサポートしているか、あるいはレガシーバージョンであるかを確認するためのヘルパー関数もいくつか含まれています。

メンバ関数のドキュメント

QOpenGLVersionProfile::QOpenGLVersionProfile()

デフォルトの無効な QOpenGLVersionProfile オブジェクトを作成します。

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

format から取得したバージョンとプロファイルで初期化された QOpenGLVersionProfile オブジェクトを作成します。

QOpenGLVersionProfile::QOpenGLVersionProfile(const QOpenGLVersionProfile &other)

other のコピーを作成します。

[noexcept] QOpenGLVersionProfile::~QOpenGLVersionProfile()

QOpenGLVersionProfile オブジェクトを破棄します。

bool QOpenGLVersionProfile::hasProfiles() const

version() が返す OpenGL バージョンでプロファイルがサポートされている場合、true を返します。プロファイルをサポートしているのは、OpenGL バージョン 3.2 以上のもののみです。

profile() およびversion()も参照してください 。

bool QOpenGLVersionProfile::isLegacyVersion() const

true を返します。これは、version()によって返されるOpenGLのバージョンであり、非推奨の関数を含み、プロファイルをサポートしていません。つまり、OpenGLのバージョンが3.1以下の場合です。

bool QOpenGLVersionProfile::isValid() const

バージョン番号が有効な場合、true を返します。なお、デフォルト構築されたQOpenGLVersionProfile オブジェクトの場合、この関数はfalse を返します。

setVersion() およびversion()も参照してください 。

QSurfaceFormat::OpenGLContextProfile QOpenGLVersionProfile::profile() const

OpenGLプロファイルを返します。このバージョンでプロファイルがサポートされている場合にのみ意味があります。

setProfile()も参照してください 。

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

OpenGLプロファイル「profile 」を設定します。このバージョンでプロファイルがサポートされている場合にのみ意味があります。

profile()も参照してください 。

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

メジャーバージョン番号とマイナーバージョン番号を、それぞれmajorVersion およびminorVersion に設定します。

version()も参照してください 。

std::pair<int, int> QOpenGLVersionProfile::version() const

OpenGLのメジャーバージョン番号とマイナーバージョン番号をそれぞれ表す std::pair<int,int> を返します。

setVersion()も参照してください 。

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

このQOpenGLVersionProfile オブジェクトに、rhs のバージョンとプロファイルを割り当てます。

© 2026 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.