QShaderProgram Class | Qt 3D 5.6

Qt 5.6 | Qt 3D | C++ Classes | QShaderProgram

Qt 5.6.2 Reference Documentation

# QShaderProgram Class

(Qt3DRender::QShaderProgram)

Inherits: | Qt3DCore::QNode

- List of all members, including inherited members

## Public Types

enum | ShaderType { Vertex, Fragment, TessellationControl, TessellationEvaluation, Geometry, Compute }

## Properties

- computeShaderCode : QByteArray
- fragmentShaderCode : QByteArray
- geometryShaderCode : QByteArray

- tessellationControlShaderCode : QByteArray
- tessellationEvaluationShaderCode : QByteArray
- vertexShaderCode : QByteArray

- 2 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject

## Public Functions

| QShaderProgram(Qt3DCore::QNode *parent = Q_NULLPTR)
| ~QShaderProgram()
QByteArray | computeShaderCode() const
QByteArray | fragmentShaderCode() const
QByteArray | geometryShaderCode() const
void | setShaderCode(ShaderType type, const QByteArray &shaderCode)
QByteArray | shaderCode(ShaderType type) const
QByteArray | tessellationControlShaderCode() const
QByteArray | tessellationEvaluationShaderCode() const
QByteArray | vertexShaderCode() const

- 6 public functions inherited from Qt3DCore::QNode
- 31 public functions inherited from QObject

## Public Slots

void | setComputeShaderCode(const QByteArray &computeShaderCode)
void | setFragmentShaderCode(const QByteArray &fragmentShaderCode)
void | setGeometryShaderCode(const QByteArray &geometryShaderCode)
void | setTessellationControlShaderCode(const QByteArray &tessellationControlShaderCode)
void | setTessellationEvaluationShaderCode(const QByteArray &tessellationEvaluationShaderCode)
void | setVertexShaderCode(const QByteArray &vertexShaderCode)

- 2 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject

## Signals

void | computeShaderCodeChanged(const QByteArray &computeShaderCode)
void | fragmentShaderCodeChanged(const QByteArray &fragmentShaderCode)
void | geometryShaderCodeChanged(const QByteArray &geometryShaderCode)
void | tessellationControlShaderCodeChanged(const QByteArray &tessellationControlShaderCode)
void | tessellationEvaluationShaderCodeChanged(const QByteArray &tessellationEvaluationShaderCode)
void | vertexShaderCodeChanged(const QByteArray &vertexShaderCode)

- 2 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject

## Static Public Members

QByteArray | loadSource(const QUrl &sourceUrl)

- 10 static public members inherited from QObject

## Protected Functions

| QShaderProgram(QShaderProgramPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR)
void | copy(const Qt3DCore::QNode *ref)

- 3 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject

### Additional Inherited Members

- 1 public variable inherited from QObject
- 2 protected variables inherited from QObject
- 1 static protected member inherited from Qt3DCore::QNode

## Member Type Documentation

### enum QShaderProgram::ShaderType

## Property Documentation

### computeShaderCode : QByteArray

Access functions:

QByteArray | computeShaderCode() const
void | setComputeShaderCode(const QByteArray &computeShaderCode)

Notifier signal:

void | computeShaderCodeChanged(const QByteArray &computeShaderCode)

### fragmentShaderCode : QByteArray

Access functions:

QByteArray | fragmentShaderCode() const
void | setFragmentShaderCode(const QByteArray &fragmentShaderCode)

Notifier signal:

void | fragmentShaderCodeChanged(const QByteArray &fragmentShaderCode)

### geometryShaderCode : QByteArray

Access functions:

QByteArray | geometryShaderCode() const
void | setGeometryShaderCode(const QByteArray &geometryShaderCode)

Notifier signal:

void | geometryShaderCodeChanged(const QByteArray &geometryShaderCode)

### tessellationControlShaderCode : QByteArray

Access functions:

QByteArray | tessellationControlShaderCode() const
void | setTessellationControlShaderCode(const QByteArray &tessellationControlShaderCode)

Notifier signal:

void | tessellationControlShaderCodeChanged(const QByteArray &tessellationControlShaderCode)

### tessellationEvaluationShaderCode : QByteArray

Access functions:

QByteArray | tessellationEvaluationShaderCode() const
void | setTessellationEvaluationShaderCode(const QByteArray &tessellationEvaluationShaderCode)

Notifier signal:

void | tessellationEvaluationShaderCodeChanged(const QByteArray &tessellationEvaluationShaderCode)

### vertexShaderCode : QByteArray

Access functions:

QByteArray | vertexShaderCode() const
void | setVertexShaderCode(const QByteArray &vertexShaderCode)

Notifier signal:

void | vertexShaderCodeChanged(const QByteArray &vertexShaderCode)

## Member Function Documentation

### QShaderProgram::QShaderProgram(Qt3DCore::QNode *parent = Q_NULLPTR)

Default constructs an instance of QShaderProgram.

### `[protected]` QShaderProgram::QShaderProgram(QShaderProgramPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR)

Copy constructor.

### QShaderProgram::~QShaderProgram()

Destroys the instance of QShaderProgram.

### `[protected]` void QShaderProgram::copy(const Qt3DCore::QNode *ref)

### `[static]` QByteArray QShaderProgram::loadSource(const QUrl &sourceUrl)

### void QShaderProgram::setShaderCode(ShaderType type, const QByteArray &shaderCode)

See also shaderCode().

### QByteArray QShaderProgram::shaderCode(ShaderType type) const

See also setShaderCode().