diff options
author | Christian Strømme <christian.stromme@qt.io> | 2018-05-16 12:48:28 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-05-18 07:57:43 +0000 |
commit | 10f87bf805fc0d95723dda14e478793d3b2d1909 (patch) | |
tree | 5061e26ddfd233da8a3cccf12897e2ba40af0a41 /src/runtime/q3dsuippresentation_p.h | |
parent | b841191690c34bd4f1b1e896c60e403d52c691ac (diff) |
Refactor handleSlideChange in the scene manager
Move the relevant code to the slide player, as the implementation
details belongs there.
Also, updating the properties are now done in-place and without extra
heap alloctions, which should make the code more performant as well.
Change-Id: I5cee4ee24a670faf0245d9fda4ad2a7a66734851
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/runtime/q3dsuippresentation_p.h')
-rw-r--r-- | src/runtime/q3dsuippresentation_p.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/runtime/q3dsuippresentation_p.h b/src/runtime/q3dsuippresentation_p.h index 1f73a98..bc4bec3 100644 --- a/src/runtime/q3dsuippresentation_p.h +++ b/src/runtime/q3dsuippresentation_p.h @@ -596,6 +596,8 @@ public: Value }; + using PropertyChanges = QHash<Q3DSGraphObject *, Q3DSPropertyChangeList *>; + Q3DSSlide(); ~Q3DSSlide(); @@ -607,7 +609,7 @@ public: void addObject(Q3DSGraphObject *obj); void removeObject(Q3DSGraphObject *obj); - const QHash<Q3DSGraphObject *, Q3DSPropertyChangeList *> &propertyChanges() const { return m_propChanges; } + const PropertyChanges &propertyChanges() const { return m_propChanges; } void addPropertyChanges(Q3DSGraphObject *target, Q3DSPropertyChangeList *changeList); // changeList ownership transferred void removePropertyChanges(Q3DSGraphObject *target); Q3DSPropertyChangeList *takePropertyChanges(Q3DSGraphObject *target); @@ -679,7 +681,7 @@ private: PlayThrough m_playThrough = Next; QVariant m_playThroughValue; QSet<Q3DSGraphObject *> m_objects; - QHash<Q3DSGraphObject *, Q3DSPropertyChangeList *> m_propChanges; + PropertyChanges m_propChanges; QVector<Q3DSAnimationTrack> m_anims; QVector<Q3DSAction> m_actions; QVector<SlideGraphChangeCallback> m_slideGraphChangeCallbacks; // master only @@ -1994,8 +1996,8 @@ public: static void forAllModels(Q3DSGraphObject *obj, std::function<void(Q3DSModelNode *)> f, bool includeHidden = false); void forAllImages(std::function<void(Q3DSImage *)> f); - void notifyPropertyChanges(const QHash<Q3DSGraphObject *, Q3DSPropertyChangeList *> &changeList) const; - void applyPropertyChanges(const QHash<Q3DSGraphObject *, Q3DSPropertyChangeList *> &changeList) const; + void notifyPropertyChanges(const Q3DSSlide::PropertyChanges &changeList) const; + void applyPropertyChanges(const Q3DSSlide::PropertyChanges &changeList) const; void applySlidePropertyChanges(Q3DSSlide *slide) const; qint64 loadTimeMsecs() const; |