QShaderKey Class

Specifies the shading language, the version with flags, and the variant. More...

Header: #include <QShaderKey>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.6

Public Functions

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)

Detailed Description

A default constructed QShaderKey has source set to SpirvShader and sourceVersion set to 100. sourceVariant defaults to StandardShader.

Note: This is a RHI API with limited compatibility guarantees, see QShader for details.

Member Function Documentation

[constexpr noexcept] QShaderKey::QShaderKey()

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

Constructs a new QShaderKey with shader type s, version sver, and variant svar.

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

Sets the shader type s.

See also source().

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

Sets the type of variant to use to svar.

See also sourceVariant().

void QShaderKey::setSourceVersion(const QShaderVersion &sver)

Sets the shading language version sver.

See also sourceVersion().

QShader::Source QShaderKey::source() const

Returns the shader type.

See also setSource().

QShader::Variant QShaderKey::sourceVariant() const

Returns the type of the variant to use.

See also setSourceVariant().

QShaderVersion QShaderKey::sourceVersion() const

Returns the shading language version.

See also setSourceVersion().

Related Non-Members

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

Returns the hash value for key, using seed to seed the calculation.

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

Returns false if the values in the two QShaderKey objects lhs and rhs are equal; otherwise returns true.

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

Returns true if lhs is smaller than rhs.

Establishes a sorting order between the two keys lhs and rhs.

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

Returns true if the two QShaderKey objects lhs and rhs are equal.

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