1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DRENDER_QPARAMETER_H
5#define QT3DRENDER_QPARAMETER_H
6
7#include <QtCore/QVariant>
8#include <Qt3DCore/qnode.h>
9#include <Qt3DRender/qt3drender_global.h>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DRender {
14
15class QParameterPrivate;
16class QAbstractTexture;
17
18class Q_3DRENDERSHARED_EXPORT QParameter : public Qt3DCore::QNode
19{
20 Q_OBJECT
21 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
22 Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
23
24public:
25 explicit QParameter(Qt3DCore::QNode *parent = nullptr);
26 explicit QParameter(const QString &name, const QVariant& value, Qt3DCore::QNode *parent = nullptr);
27 explicit QParameter(const QString &name, QAbstractTexture *texture, Qt3DCore::QNode *parent = nullptr);
28 ~QParameter();
29
30 QString name() const;
31 QVariant value() const;
32
33public Q_SLOTS:
34 void setName(const QString &name);
35 void setValue(const QVariant &dv);
36
37Q_SIGNALS:
38 void valueChanged(const QVariant &value);
39 void nameChanged(const QString &name);
40
41protected:
42 QParameter(QParameterPrivate &dd, Qt3DCore::QNode *parent = nullptr);
43
44private:
45 Q_DECLARE_PRIVATE(QParameter)
46};
47
48} // namespace Qt3DRender
49
50QT_END_NAMESPACE
51
52#endif // QT3DRENDER_PARAMETER_H
53

source code of qt3d/src/render/materialsystem/qparameter.h