QMaterial Class

(Qt3DRender::QMaterial)

Provides an abstract class that should be the base of all Material component classes in a scene. More...

Header: #include <QMaterial>
qmake: QT += 3drender
Instantiated By: Material
Inherits: Qt3DCore::QComponent

Properties

  • effect : Qt3DRender::QEffect *

Public Functions

QMaterial(Qt3DCore::QNode *parent = nullptr)
void addParameter(QParameter *parameter)
QEffect *effect() const
QVector<QParameter *> parameters() const
void removeParameter(QParameter *parameter)

Public Slots

void setEffect(QEffect *effect)

Signals

void effectChanged(QEffect *effect)

Protected Functions

QMaterial(QMaterialPrivate &dd, Qt3DCore::QNode *parent = nullptr)

Detailed Description

Provides an abstract class that should be the base of all Material component classes in a scene.

QMaterial provides a way to specify the rendering of an Entity. Any aspect can define its own subclass of QMaterial so that a Material can be used to describe a visual element; for example, the way sound should reflect off an element, the temperature of a surface, and so on.

See also QEffect, QMesh, and QComponent.

Property Documentation

effect : Qt3DRender::QEffect *

Specifies the effect to be used with the material

Access functions:

QEffect *effect() const
void setEffect(QEffect *effect)

Notifier signal:

void effectChanged(QEffect *effect)

Member Function Documentation

QMaterial::QMaterial(Qt3DCore::QNode *parent = nullptr)

Constructs a new QMaterial with the specified parent.

[protected] QMaterial::QMaterial(QMaterialPrivate &dd, Qt3DCore::QNode *parent = nullptr)

Copy constructor.

void QMaterial::addParameter(QParameter *parameter)

Add parameter to the Materials parameter.

QEffect *QMaterial::effect() const

Returns the effect used by the Material.

Note: Getter function for property effect.

See also setEffect().

QVector<QParameter *> QMaterial::parameters() const

Returns a vector of the materials current parameters

void QMaterial::removeParameter(QParameter *parameter)

Remove parameter from the Material parameters.

[slot] void QMaterial::setEffect(QEffect *effect)

Sets the effect to be used with the Material.

Note: Setter function for property effect.

See also effect().