このページでは

QShaderKey Class

シェーディング言語、フラグ付きバージョン、およびバリアントを指定します。詳細...

ヘッダー: #include <qshader.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
以下のように: Qt 6.6

パブリック関数

QShaderKey()
QShaderKey(QShader::Source s, const QShaderVersion &sver, QShader::Variant svar = QShader::StandardShader)
void setSource(QShader::Source s)
void setSourceVariant(QShader::Variant svar)
void setSourceVersion(const QShaderVersion &sver)
QShader::Source source() const
QShader::Variant sourceVariant() const
QShaderVersion sourceVersion() const
size_t qHash(const QShaderKey &key, size_t seed = 0)
bool operator!=(const QShaderKey &lhs, const QShaderKey &rhs)
bool operator<(const QShaderKey &lhs, const QShaderKey &rhs)
bool operator==(const QShaderKey &lhs, const QShaderKey &rhs)

詳細な説明

デフォルトで構築された QShaderKey では、source は SpirvShader に、sourceVersion は 100 に設定されています。sourceVariant のデフォルト値は StandardShader です。

注:これは 互換性の保証が限定的な RHI API です。詳細については、QShader を参照してください。

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

[constexpr noexcept default] QShaderKey::QShaderKey()

QShaderKey::QShaderKey(QShader::Source s, const QShaderVersion &sver, QShader::Variant svar = QShader::StandardShader)

シェーダータイプがs 、バージョンがsver 、バリアントがsvar の新しいQShaderKeyを生成します。

void QShaderKey::setSource(QShader::Source s)

シェーダータイプ「s 」を設定します。

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

void QShaderKey::setSourceVariant(QShader::Variant svar)

使用するバリアントの型を `svar` に設定します。

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

void QShaderKey::setSourceVersion(const QShaderVersion &sver)

シェーディング言語のバージョンを設定します。sver 。

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

QShader::Source QShaderKey::source() const

シェーダーのタイプを返します。

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

QShader::Variant QShaderKey::sourceVariant() const

使用するバリアントの型を返します。

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

QShaderVersion QShaderKey::sourceVersion() const

シェーディング言語のバージョンを返します。

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

関連する非メンバー関数

[noexcept] size_t qHash(const QShaderKey &key, size_t seed = 0)

`key` のハッシュ値を返します。計算のシードには `seed ` を使用します。

[noexcept] bool operator!=(const QShaderKey &lhs, const QShaderKey &rhs)

2つのQShaderKey オブジェクトであるlhs とrhs の値が等しい場合はfalse を返し、そうでない場合はtrue を返します。

[noexcept] bool operator<(const QShaderKey &lhs, const QShaderKey &rhs)

lhs がrhs より小さい場合、true を返します。

2つのキーlhs とrhs の間にソート順序を確立します。

[noexcept] bool operator==(const QShaderKey &lhs, const QShaderKey &rhs)

2つのQShaderKey オブジェクトであるlhs とrhs が等しい場合、true を返します。

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