summaryrefslogtreecommitdiffstats
path: root/src/runtime/api/q3dselement.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-04-23 16:38:54 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-04-27 07:33:12 +0000
commit7ce5b5a07b838b42d88f333e6155b60a4b63e608 (patch)
tree130463d96be8ccfb66bd6773fe2910dee2fe07d8 /src/runtime/api/q3dselement.cpp
parent1883b1af29f56d2d998774fbef3765629db602b0 (diff)
Add getAttribute to Q3DSElement for API symmetry
We added it everywhere elso too, even where it was missing in 1.x, so have it here too. And add something to the example. Change-Id: Ie82ee80807384f9cc1f00064af5e593f3f534ca6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/runtime/api/q3dselement.cpp')
-rw-r--r--src/runtime/api/q3dselement.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/api/q3dselement.cpp b/src/runtime/api/q3dselement.cpp
index 27a8751..ae119ae 100644
--- a/src/runtime/api/q3dselement.cpp
+++ b/src/runtime/api/q3dselement.cpp
@@ -76,6 +76,15 @@ void Q3DSElement::setElementPath(const QString &elementPath)
}
}
+QVariant Q3DSElement::getAttribute(const QString &attributeName) const
+{
+ Q_D(const Q3DSElement);
+ if (d->presentation && !d->elementPath.isEmpty())
+ return d->presentation->getAttribute(d->elementPath, attributeName);
+
+ return QVariant();
+}
+
void Q3DSElement::setAttribute(const QString &attributeName, const QVariant &value)
{
Q_D(Q3DSElement);