En esta página

QShaderCode Class

Contiene el código fuente o binario de un shader y metadatos adicionales. Más...

Encabezado: #include <qshader.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Desde: Qt 6.6

Funciones públicas

QShaderCode()
QShaderCode(const QByteArray &code, const QByteArray &entry = QByteArray())
QByteArray entryPoint() const
void setEntryPoint(const QByteArray &entry)
void setShader(const QByteArray &code)
QByteArray shader() const
size_t qHash(const QShaderCode &key, size_t seed = 0)
bool operator!=(const QShaderCode &lhs, const QShaderCode &rhs)
bool operator==(const QShaderCode &lhs, const QShaderCode &rhs)

Descripción detallada

Cuando shader() devuelve un valor vacío tras recuperar una instancia de QShaderCode desde QShader, esto indica que no se ha encontrado ningún código de shader para la clave solicitada.

Nota: Se trata de una API de RHI con garantías de compatibilidad limitadas; consulta QShader para obtener más detalles.

Documentación de la función miembro

[constexpr noexcept default] QShaderCode::QShaderCode()

QShaderCode::QShaderCode(const QByteArray &code, const QByteArray &entry = QByteArray())

Crea un nuevo objeto `QShaderCode` con el código fuente del shader especificado code y el nombre del punto entry.

QByteArray QShaderCode::entryPoint() const

Devuelve el nombre del punto de entrada.

Véase también setEntryPoint().

void QShaderCode::setEntryPoint(const QByteArray &entry)

Establece el nombre del punto « entry ».

Véase también entryPoint().

void QShaderCode::setShader(const QByteArray &code)

Establece la fuente del shader o el byte code.

Véase también shader().

QByteArray QShaderCode::shader() const

Devuelve el código fuente o el bytecode del shader.

Véase también setShader().

Elementos no miembros relacionados

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

Devuelve el valor hash de key, utilizando seed como semilla para el cálculo.

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

Devuelve « false » si los valores de los dos objetos « QShaderCode » — lhs y rhs — son iguales; en caso contrario, devuelve « true ».

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

Devuelve « true » si los dos objetos « QShaderCode » lhs y rhs son iguales.

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