diff options
author | Määttä Antti <antti.maatta@qt.io> | 2019-02-05 15:31:46 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2019-03-12 12:11:08 +0000 |
commit | db433e6b7b543a54865c770fd4ca15160e44b2c7 (patch) | |
tree | 68fb6c56f7d6b2fee91975733ee94c06698eeae0 /src/runtime/q3dsuippresentation_p.h | |
parent | 63ec9f17ed1cf4da27015244f97bb161e51949ce (diff) |
Implement delayed image loading and slide resource list
Task-number: QT3DS-2664
Change-Id: I5310329fbf6e4e07cade28ae68161081ddf77f3c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/runtime/q3dsuippresentation_p.h')
-rw-r--r-- | src/runtime/q3dsuippresentation_p.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/runtime/q3dsuippresentation_p.h b/src/runtime/q3dsuippresentation_p.h index de1be1e..fde8233 100644 --- a/src/runtime/q3dsuippresentation_p.h +++ b/src/runtime/q3dsuippresentation_p.h @@ -406,8 +406,14 @@ public: State state() const { return m_state; } + virtual void listResources(QSet<QString> &resources) const + { + Q_UNUSED(resources); + } protected: void destroyGraph(); + void listCustomPropertyResources(QSet<QString> &resources, const QMap<QString, + Q3DSMaterial::PropertyElement> &meta) const; QByteArray m_id; QString m_name; @@ -739,6 +745,23 @@ public: Q3DSPropertyChange setPlayThrough(PlayThrough v); Q3DSPropertyChange setPlayThroughValue(const QVariant &v); + void generateResourceSet(Q3DSUipPresentation *presentation); + QSet<QUrl> resourceSet() const { return m_resources; } + + void setUnloadSlide(bool unload) + { + m_unload = unload; + } + void setActive(bool active) + { + m_active = active; + // The slide must be explicitly unloaded by the user every time + if (active) + m_unload = false; + } + bool unloadSlide() const { return m_unload; } + bool active() const { return m_active; } + private: Q_DISABLE_COPY(Q3DSSlide) template<typename V> void setProps(const V &attrs, PropSetFlags flags); @@ -756,6 +779,9 @@ private: QVector<Q3DSAction> m_actions; QVector<SlideGraphChangeCallback> m_slideGraphChangeCallbacks; // master only QVector<SlideObjectChangeCallback> m_slideObjectChangeCallbacks; + QSet<QUrl> m_resources; + bool m_unload = false; + bool m_active = false; friend class Q3DSUipParser; friend class Q3DSGraphObject; @@ -842,6 +868,8 @@ public: Q3DSPropertyChange setCustomImage(const QImage &v); // alternative setter QImage customImage() const { return m_customImage; } + void listResources(QSet<QString> &resources) const override; + private: Q_DISABLE_COPY(Q3DSImage) template<typename V> void setProps(const V &attrs, PropSetFlags flags); @@ -1956,6 +1984,10 @@ public: const Q3DSCustomMaterial *material() const { return &m_material; } + void listResources(QSet<QString> &resources) const override + { + listCustomPropertyResources(resources, m_material.properties()); + } private: Q_DISABLE_COPY(Q3DSCustomMaterialInstance) template<typename V> void setProps(const V &attrs, PropSetFlags flags); @@ -2005,6 +2037,11 @@ public: const Q3DSEffect *effect() const { return &m_effect; } + void listResources(QSet<QString> &resources) const override + { + listCustomPropertyResources(resources, m_effect.properties()); + } + private: Q_DISABLE_COPY(Q3DSEffectInstance) template<typename V> void setProps(const V &attrs, PropSetFlags flags); @@ -2200,6 +2237,8 @@ public: void addImplicitPropertyChanges(); QHash<QString, bool> &imageTransparencyHash(); + QUrl imageUrl(const QString &sourcePath); + private: Q_DISABLE_COPY(Q3DSUipPresentation) |