On this page

QCCustomBrush Class

QCCustomBrush is a brush with custom shaders. More...

Header: #include <QCCustomBrush>
Inherits: QCBrush

Public Functions

QCCustomBrush()
QCCustomBrush(const QString &fragmentShader, const QString &vertexShader)
QCCustomBrush(const QCCustomBrush &brush)
QCCustomBrush(QCCustomBrush &&other)
virtual ~QCCustomBrush()
void setData1(const QVector4D &data)
void setData2(const QVector4D &data)
void setData3(const QVector4D &data)
void setData4(const QVector4D &data)
void setFragmentShader(const QString &fragmentShader)
void setTimeRunning(bool running)
void setVertexShader(const QString &vertexShader)
void swap(QCCustomBrush &other)
bool timeRunning() const
QVariant operator QVariant() const
bool operator!=(const QCCustomBrush &brush) const
QCCustomBrush &operator=(QCCustomBrush &&other)
QCCustomBrush &operator=(const QCCustomBrush &brush)
bool operator==(const QCCustomBrush &brush) const

Reimplemented Public Functions

virtual QCBrush::BrushType type() const override

Detailed Description

QCCustomBrush is a stroke/fill brush with custom vertex and fragment shaders.

Member Function Documentation

QCCustomBrush::QCCustomBrush()

Constructs a default custom brush.

QCCustomBrush::QCCustomBrush(const QString &fragmentShader, const QString &vertexShader)

Constructs a custom brush. The fragment shader is fragmentShader and vertex shader is vertexShader.

[noexcept] QCCustomBrush::QCCustomBrush(const QCCustomBrush &brush)

Constructs a custom brush that is a copy of the given brush.

[constexpr noexcept] QCCustomBrush::QCCustomBrush(QCCustomBrush &&other)

Move-constructs a new QCCustomBrush from other.

[virtual noexcept] QCCustomBrush::~QCCustomBrush()

Destroys the custom brush.

void QCCustomBrush::setData1(const QVector4D &data)

Sets the uniform data1 value to data. This allows setting custom data into shaders.

void QCCustomBrush::setData2(const QVector4D &data)

Sets the uniform data2 value to data. This allows setting custom data into shaders.

void QCCustomBrush::setData3(const QVector4D &data)

Sets the uniform data3 value to data. This allows setting custom data into shaders.

void QCCustomBrush::setData4(const QVector4D &data)

Sets the uniform data4 value to data. This allows setting custom data into shaders.

void QCCustomBrush::setFragmentShader(const QString &fragmentShader)

Sets the custom brush to use fragmentShader. This must be path to a valid qsb file.

void QCCustomBrush::setTimeRunning(bool running)

Sets the time running state to running. When this is true, the shader uniform iTime value is animated to get the current animation running time. The default value is false.

See also timeRunning().

void QCCustomBrush::setVertexShader(const QString &vertexShader)

Sets the custom brush to use vertexShader. This must be path to a valid qsb file.

[noexcept] void QCCustomBrush::swap(QCCustomBrush &other)

Swaps this other with other. This operation is very fast and never fails.

bool QCCustomBrush::timeRunning() const

Returns true if the time is running.

See also setTimeRunning().

[override virtual] QCBrush::BrushType QCCustomBrush::type() const

Reimplements: QCBrush::type() const.

Returns the type of brush, QCBrush::BrushType::Custom.

QVariant QCCustomBrush::operator QVariant() const

Returns the custom brush as a QVariant.

bool QCCustomBrush::operator!=(const QCCustomBrush &brush) const

Returns true if the custom brush is different from the given brush; otherwise false.

See also operator==().

[noexcept] QCCustomBrush &QCCustomBrush::operator=(QCCustomBrush &&other)

Move-assigns other to this QCCustomBrush instance.

[noexcept] QCCustomBrush &QCCustomBrush::operator=(const QCCustomBrush &brush)

Assigns the given brush to this custom brush and returns a reference to this custom brush.

bool QCCustomBrush::operator==(const QCCustomBrush &brush) const

Returns true if the custom brush is equal to the given brush; otherwise false.

See also operator!=().

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