aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-06-24 11:53:19 +0200
committerUlf Hermann <ulf.hermann@digia.com>2014-07-02 12:20:10 +0300
commit7eca9fbc4205cc1e1c31c04674e9b9672f2b73ce (patch)
tree1952c1f8d2eb84604425c05310f9c366395250b0
parent7f0b2b40879ad83825f8d03ca771059c7b3bd152 (diff)
Add scale to memory usage and pixmap cache models
Change-Id: I69cb67a97b0bb3407f509db01ec2d4b9acd177db Reviewed-by: Kai Koehne <kai.koehne@digia.com>
-rw-r--r--plugins/qmlprofilerextension/memoryusagemodel.cpp9
-rw-r--r--plugins/qmlprofilerextension/memoryusagemodel.h1
-rw-r--r--plugins/qmlprofilerextension/pixmapcachemodel.cpp12
-rw-r--r--plugins/qmlprofilerextension/pixmapcachemodel.h1
4 files changed, 21 insertions, 2 deletions
diff --git a/plugins/qmlprofilerextension/memoryusagemodel.cpp b/plugins/qmlprofilerextension/memoryusagemodel.cpp
index 6b48d45c1e..64a6aa44f8 100644
--- a/plugins/qmlprofilerextension/memoryusagemodel.cpp
+++ b/plugins/qmlprofilerextension/memoryusagemodel.cpp
@@ -54,6 +54,13 @@ int MemoryUsageModel::rowCount() const
return isEmpty() ? 1 : 3;
}
+int MemoryUsageModel::rowMaxValue(int rowNumber) const
+{
+ Q_D(const MemoryUsageModel);
+ Q_UNUSED(rowNumber);
+ return d->maxSize;
+}
+
int MemoryUsageModel::getEventRow(int index) const
{
Q_D(const MemoryUsageModel);
@@ -78,7 +85,7 @@ QColor MemoryUsageModel::getColor(int index) const
float MemoryUsageModel::getHeight(int index) const
{
Q_D(const MemoryUsageModel);
- return qMin(1.0f, (float)d->range(index).size / (float)d->maxSize * 0.85f + 0.15f);
+ return qMin(1.0f, (float)d->range(index).size / (float)d->maxSize);
}
const QVariantList MemoryUsageModel::getLabels() const
diff --git a/plugins/qmlprofilerextension/memoryusagemodel.h b/plugins/qmlprofilerextension/memoryusagemodel.h
index ce7fdb8b74..c256b02590 100644
--- a/plugins/qmlprofilerextension/memoryusagemodel.h
+++ b/plugins/qmlprofilerextension/memoryusagemodel.h
@@ -43,6 +43,7 @@ public:
MemoryUsageModel(QObject *parent = 0);
int rowCount() const;
+ int rowMaxValue(int rowNumber) const;
int getEventRow(int index) const;
int getEventId(int index) const;
diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp
index c66055aa0c..ec4da50f10 100644
--- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp
+++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp
@@ -103,6 +103,16 @@ int PixmapCacheModel::rowCount() const
return d->collapsedRowCount;
}
+int PixmapCacheModel::rowMaxValue(int rowNumber) const
+{
+ Q_D(const PixmapCacheModel);
+ if (rowNumber == 1) {
+ return d->maxCacheSize;
+ } else {
+ return AbstractTimelineModel::rowMaxValue(rowNumber);
+ }
+}
+
int PixmapCacheModel::getEventRow(int index) const
{
Q_D(const PixmapCacheModel);
@@ -131,7 +141,7 @@ float PixmapCacheModel::getHeight(int index) const
{
Q_D(const PixmapCacheModel);
if (d->range(index).pixmapEventType == PixmapCacheCountChanged)
- return 0.15 + (float)d->range(index).cacheSize * 0.85 / (float)d->maxCacheSize;
+ return (float)d->range(index).cacheSize / (float)d->maxCacheSize;
else
return 1.0f;
}
diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.h b/plugins/qmlprofilerextension/pixmapcachemodel.h
index 688be42a1c..888a5f66ed 100644
--- a/plugins/qmlprofilerextension/pixmapcachemodel.h
+++ b/plugins/qmlprofilerextension/pixmapcachemodel.h
@@ -56,6 +56,7 @@ public:
PixmapCacheModel(QObject *parent = 0);
int rowCount() const;
+ int rowMaxValue(int rowNumber) const;
int getEventRow(int index) const;
Q_INVOKABLE int getEventId(int index) const;