summaryrefslogtreecommitdiffstats
path: root/src/core/aspects/qaspectfactory_p.h
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2015-12-01 13:11:04 +0100
committerKevin Ottens <kevin.ottens@kdab.com>2015-12-01 14:24:05 +0000
commit25737a39a63e7295650975c1359b9868461018ad (patch)
tree7b6c5aa524f51f91be3cbdd3e970fa5ad0244cb6 /src/core/aspects/qaspectfactory_p.h
parentbb2e5c6ec62f9bc23cea2c67f129fe1f7873b1be (diff)
QAspectFactory can now also give registered name of an aspect
Change-Id: I8f89eefb06e20943f7abb82d461b5e90fd9799f9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/aspects/qaspectfactory_p.h')
-rw-r--r--src/core/aspects/qaspectfactory_p.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/aspects/qaspectfactory_p.h b/src/core/aspects/qaspectfactory_p.h
index f42010d1a..590860db1 100644
--- a/src/core/aspects/qaspectfactory_p.h
+++ b/src/core/aspects/qaspectfactory_p.h
@@ -55,6 +55,7 @@
QT_BEGIN_NAMESPACE
+class QMetaObject;
class QObject;
namespace Qt3DCore {
@@ -74,17 +75,24 @@ public:
QAspectFactory &operator=(QAspectFactory &&other) Q_DECL_NOTHROW
{
m_factories.swap(other.m_factories);
+ m_aspectNames.swap(other.m_aspectNames);
return *this;
}
#endif
- inline void swap(QAspectFactory &other) Q_DECL_NOTHROW { m_factories.swap(other.m_factories); }
+ inline void swap(QAspectFactory &other) Q_DECL_NOTHROW
+ {
+ m_factories.swap(other.m_factories);
+ m_aspectNames.swap(other.m_aspectNames);
+ }
QStringList availableFactories() const;
QAbstractAspect *createAspect(const QString &aspect, QObject *parent = 0) const;
+ QString aspectName(QAbstractAspect *aspect) const;
private:
QHash<QString, QAspectFactory::CreateFunction> m_factories;
+ QHash<const QMetaObject*, QString> m_aspectNames;
};
} // namespace Qt3DCore