aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/pixmapcachemodel.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-06-03 16:57:37 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-06-08 08:48:59 +0000
commit6de290a188fc8fbdb9b39ae0fbc1e95e058314fb (patch)
tree58223c49eb1502192d335f42c338554fe6dd27f7 /src/plugins/qmlprofiler/pixmapcachemodel.h
parenta0f956f0509a68d7eaec718bed294661bca49996 (diff)
QmlProfiler: Add tests for pixmap cache model
Change-Id: Ic3114f6cd205434e2a489112d070300a3c842352 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/pixmapcachemodel.h')
-rw-r--r--src/plugins/qmlprofiler/pixmapcachemodel.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.h b/src/plugins/qmlprofiler/pixmapcachemodel.h
index bf0626caccc..cdbfee49bbc 100644
--- a/src/plugins/qmlprofiler/pixmapcachemodel.h
+++ b/src/plugins/qmlprofiler/pixmapcachemodel.h
@@ -44,14 +44,18 @@ public:
ToBeCached, // After determining the pixmap is to be cached but before knowing its size
Cached, // After caching a pixmap or determining the size of a ToBeCached pixmap
Uncacheable, // If loading failed without ToBeCached or after a corrupt pixmap has been uncached
- Corrupt // If after ToBeCached we learn that loading failed
+ Corrupt, // If after ToBeCached we learn that loading failed
+
+ MaximumCacheState
};
enum LoadState {
Initial,
Loading,
Finished,
- Error
+ Error,
+
+ MaximumLoadState
};
struct PixmapState {
@@ -105,11 +109,15 @@ public:
QVariantMap details(int index) const override;
-protected:
void loadEvent(const QmlEvent &event, const QmlEventType &type) override;
void finalize() override;
void clear() override;
+#ifdef WITH_TESTS
+ LoadState loadState(int index) const;
+ CacheState cacheState(int index) const;
+#endif
+
private:
void computeMaxCacheSize();
void resizeUnfinishedLoads();