| 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 | #include "qfilterkey.h" |
| 5 | #include "qfilterkey_p.h" |
| 6 | #include <private/qnode_p.h> |
| 7 | |
| 8 | QT_BEGIN_NAMESPACE |
| 9 | |
| 10 | namespace Qt3DRender { |
| 11 | |
| 12 | |
| 13 | QFilterKeyPrivate::QFilterKeyPrivate() |
| 14 | : QNodePrivate() |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | /*! |
| 19 | \class Qt3DRender::QFilterKey |
| 20 | \inmodule Qt3DRender |
| 21 | \inherits Qt3DCore::QNode |
| 22 | \since 5.5 |
| 23 | \brief The QFilterKey class provides storage for filter keys and their values. |
| 24 | |
| 25 | Filter keys are used by QTechnique and QRenderPass to specify at which stage of rendering the |
| 26 | technique or the render pass is used. |
| 27 | |
| 28 | \note QFilterKey node can not be disabled. |
| 29 | */ |
| 30 | |
| 31 | /*! |
| 32 | \qmltype FilterKey |
| 33 | \nativetype Qt3DRender::QFilterKey |
| 34 | \inherits Node |
| 35 | \inqmlmodule Qt3D.Render |
| 36 | \since 5.5 |
| 37 | \brief Stores filter keys and their values. |
| 38 | |
| 39 | A FilterKey is a storage type for filter key and value pair. |
| 40 | Filter keys are used by Technique and RenderPass to specify at which stage of rendering the |
| 41 | technique or the render pass is used. |
| 42 | |
| 43 | \note FilterKey node can not be disabled. |
| 44 | */ |
| 45 | |
| 46 | QFilterKey::QFilterKey(QNode *parent) |
| 47 | : QNode(*new QFilterKeyPrivate, parent) |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | QFilterKey::~QFilterKey() |
| 52 | { |
| 53 | } |
| 54 | |
| 55 | void QFilterKey::setValue(const QVariant &value) |
| 56 | { |
| 57 | Q_D(QFilterKey); |
| 58 | if (value != d->m_value) { |
| 59 | d->m_value = value; |
| 60 | emit valueChanged(value); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | void QFilterKey::setName(const QString &name) |
| 65 | { |
| 66 | Q_D(QFilterKey); |
| 67 | if (name != d->m_name) { |
| 68 | d->m_name = name; |
| 69 | emit nameChanged(name); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | /*! |
| 74 | \property Qt3DRender::QFilterKey::value |
| 75 | |
| 76 | Holds the value of the filter key. |
| 77 | */ |
| 78 | |
| 79 | /*! |
| 80 | \qmlproperty variant FilterKey::value |
| 81 | |
| 82 | Holds the value of the filter key. |
| 83 | */ |
| 84 | |
| 85 | QVariant QFilterKey::value() const |
| 86 | { |
| 87 | Q_D(const QFilterKey); |
| 88 | return d->m_value; |
| 89 | } |
| 90 | |
| 91 | /*! |
| 92 | \property Qt3DRender::QFilterKey::name |
| 93 | |
| 94 | Holds the name of the filter key. |
| 95 | */ |
| 96 | |
| 97 | /*! |
| 98 | \qmlproperty string FilterKey::name |
| 99 | |
| 100 | Holds the name of the filter key. |
| 101 | */ |
| 102 | |
| 103 | QString QFilterKey::name() const |
| 104 | { |
| 105 | Q_D(const QFilterKey); |
| 106 | return d->m_name; |
| 107 | } |
| 108 | |
| 109 | } // namespace Qt3DRender |
| 110 | |
| 111 | QT_END_NAMESPACE |
| 112 | |
| 113 | #include "moc_qfilterkey.cpp" |
| 114 | |