diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-09 10:21:55 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-09 12:24:02 +0200 |
commit | 994b476562c0f526833d0f61a3196d3f81c9c736 (patch) | |
tree | 8452d7d642e525392576505ec63634a5b4fa872b /src/render/backend/entity_p.h | |
parent | 39d0041f15601cee499c959702b004cbd721bed9 (diff) |
Use QList instead of QVector in render
Use list-initialization.
Task-number: QTBUG-84469
Change-Id: I826450646fc3c7118cae49c22a28058f47770e13
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/backend/entity_p.h')
-rw-r--r-- | src/render/backend/entity_p.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/render/backend/entity_p.h b/src/render/backend/entity_p.h index 0d4a9d980..3c2f9c2b5 100644 --- a/src/render/backend/entity_p.h +++ b/src/render/backend/entity_p.h @@ -57,7 +57,7 @@ #include <Qt3DRender/private/handle_types_p.h> #include <Qt3DCore/private/qentity_p.h> #include <Qt3DCore/private/qhandle_p.h> -#include <QVector> +#include <QList> QT_BEGIN_NAMESPACE @@ -101,8 +101,8 @@ public: void removeFromParentChildHandles(); void appendChildHandle(HEntity childHandle); void removeChildHandle(HEntity childHandle) { m_childrenHandles.removeOne(childHandle); } - const QVector<HEntity> &childrenHandles() const { return m_childrenHandles; } - QVector<Entity *> children() const; + const QList<HEntity> &childrenHandles() const { return m_childrenHandles; } + QList<Entity *> children() const; bool hasChildren() const { return !m_childrenHandles.empty(); } void traverse(const std::function<void(Entity *)> &operation); void traverse(const std::function<void(const Entity *)> &operation) const; @@ -134,9 +134,9 @@ public: } template<class Backend> - QVector<Qt3DCore::QHandle<Backend> > componentsHandle() const + QList<Qt3DCore::QHandle<Backend>> componentsHandle() const { - return QVector<Qt3DCore::QHandle<Backend> >(); + return { }; } template<class Backend> @@ -157,13 +157,13 @@ public: template<class Backend> Qt3DCore::QNodeId componentUuid() const { - return Qt3DCore::QNodeId(); + return { }; } template<class Backend> - QVector<Qt3DCore::QNodeId> componentsUuid() const + QList<Qt3DCore::QNodeId> componentsUuid() const { - return QVector<Qt3DCore::QNodeId>(); + return { }; } template<typename T> @@ -185,7 +185,7 @@ private: NodeManagers *m_nodeManagers; HEntity m_handle; HEntity m_parentHandle; - QVector<HEntity > m_childrenHandles; + QList<HEntity> m_childrenHandles; HMatrix m_worldTransform; QSharedPointer<Sphere> m_localBoundingVolume; @@ -196,12 +196,12 @@ private: Qt3DCore::QNodeId m_transformComponent; Qt3DCore::QNodeId m_materialComponent; Qt3DCore::QNodeId m_cameraComponent; - QVector<Qt3DCore::QNodeId> m_layerComponents; - QVector<Qt3DCore::QNodeId> m_levelOfDetailComponents; - QVector<Qt3DCore::QNodeId> m_rayCasterComponents; - QVector<Qt3DCore::QNodeId> m_shaderDataComponents; - QVector<Qt3DCore::QNodeId> m_lightComponents; - QVector<Qt3DCore::QNodeId> m_environmentLightComponents; + QList<Qt3DCore::QNodeId> m_layerComponents; + QList<Qt3DCore::QNodeId> m_levelOfDetailComponents; + QList<Qt3DCore::QNodeId> m_rayCasterComponents; + QList<Qt3DCore::QNodeId> m_shaderDataComponents; + QList<Qt3DCore::QNodeId> m_lightComponents; + QList<Qt3DCore::QNodeId> m_environmentLightComponents; Qt3DCore::QNodeId m_geometryRendererComponent; Qt3DCore::QNodeId m_pickingProxyComponent; Qt3DCore::QNodeId m_objectPickerComponent; @@ -233,7 +233,7 @@ private: #define ENTITY_COMPONENT_LIST_TEMPLATE_SPECIALIZATION(Type, Handle) \ /* Handle */ \ template<> \ - Q_3DRENDERSHARED_PRIVATE_EXPORT QVector<Handle> Entity::componentsHandle<Type>() const; \ + Q_3DRENDERSHARED_PRIVATE_EXPORT QList<Handle> Entity::componentsHandle<Type>() const; \ /* Component */ \ template<> \ Q_3DRENDERSHARED_PRIVATE_EXPORT std::vector<Type *> Entity::renderComponents<Type>() const; \ @@ -264,10 +264,10 @@ private: #define ENTITY_COMPONENT_LIST_TEMPLATE_IMPL(Type, Handle, Manager, variable) \ /* Handle */ \ template<> \ - QVector<Handle> Entity::componentsHandle<Type>() const \ + QList<Handle> Entity::componentsHandle<Type>() const \ { \ Manager *manager = m_nodeManagers->manager<Type, Manager>(); \ - QVector<Handle> entries; \ + QList<Handle> entries; \ entries.reserve(variable.size()); \ for (const QNodeId id : variable) \ entries.push_back(manager->lookupHandle(id)); \ |