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
Inherited By:

Qt3DRender::QDiffuseMapMaterial, Qt3DRender::QDiffuseSpecularMapMaterial, Qt3DRender::QGoochMaterial, Qt3DRender::QNormalDiffuseMapMaterial, Qt3DRender::QNormalDiffuseSpecularMapMaterial, Qt3DRender::QPerVertexColorMaterial, Qt3DRender::QPhongAlphaMaterial, and Qt3DRender::QPhongMaterial

Properties

  • effect : Qt3DRender::QEffect *

Public Functions

QMaterial(Qt3DCore::QNode *parent = Q_NULLPTR)
~QMaterial()
void addParameter(QParameter *parameter)
QEffect * effect() const
QList<QParameter *> parameters() const
void removeParameter(QParameter *parameter)
void setTextureParameter(QString name, QAbstractTextureProvider *tex)
TextureDict textureValues() const

Public Slots

void setEffect(QEffect *effect)

Signals

void effectChanged(QEffect *effect)

Protected Functions

QMaterial(QMaterialPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR)
void copy(const Qt3DCore::QNode *ref)

Additional Inherited Members

Detailed Description

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

QAbstractMaterial provide a way to specify the rendering of an Entity. Any aspect can define its own subclass of QAbstractMaterial 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 *

Access functions:

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

Notifier signal:

void effectChanged(QEffect *effect)

Member Function Documentation

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

Default constructs an instance of QMaterial.

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

Copy constructor.

QMaterial::~QMaterial()

Destroys the instance of QMaterial.

void QMaterial::addParameter(QParameter *parameter)

[protected] void QMaterial::copy(const Qt3DCore::QNode *ref)

QEffect *QMaterial::effect() const

Returns the effect used by the Material.

Note: Getter function for property effect.

See also setEffect().

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

void QMaterial::removeParameter(QParameter *parameter)

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

Sets the effect to be used with the Material.

Note: Setter function for property effect.

See also effect().

void QMaterial::setTextureParameter(QString name, QAbstractTextureProvider *tex)

TextureDict QMaterial::textureValues() const

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/archives/qt-5.6/qt3drender-qmaterial.html