QShaderKey Class
指定着色语言、带标记的版本和变量。更多
头文件: | #include <QShaderKey> |
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 源设置为 SpirvShader,sourceVersion 设置为 100。sourceVariant 默认为 StandardShader。
注: 这是一个 RHI API,具有有限的兼容性保证,详情请参见QShader 。
成员函数文档
[constexpr noexcept]
QShaderKey::QShaderKey()
QShaderKey::QShaderKey(QShader::Source s, const QShaderVersion &sver, QShader::Variant svar = QShader::StandardShader)
构建一个新的 QShaderKey,其着色器类型为s ,版本为sver ,变体为svar 。
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)
如果两个QShaderKey 对象lhs 和rhs 中的值相等,则返回false
;否则返回true
。
[noexcept]
bool operator<(const QShaderKey &lhs, const QShaderKey &rhs)
如果lhs 小于rhs ,则返回 true。
在lhs 和rhs 这两个键之间建立排序顺序。
[noexcept]
bool operator==(const QShaderKey &lhs, const QShaderKey &rhs)
如果两个QShaderKey 对象lhs 和rhs 相等,则返回true
。
© 2025 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.