2013-06-19 15:12:32 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2013-06-20 12:34:02 +02:00
|
|
|
** Copyright (C) 2013 Digia Plc
|
|
|
|
|
** All rights reserved.
|
|
|
|
|
** For any questions to Digia, please use contact form at http://qt.digia.com <http://qt.digia.com/>
|
2013-06-19 15:12:32 +02:00
|
|
|
**
|
2013-06-20 12:34:02 +02:00
|
|
|
** This file is part of the Qt Enterprise Qt Quick Profiler Add-on.
|
2013-06-19 15:12:32 +02:00
|
|
|
**
|
2013-06-20 12:34:02 +02:00
|
|
|
** Licensees holding valid Qt Enterprise licenses may use this file in
|
|
|
|
|
** accordance with the Qt Enterprise License Agreement provided with the
|
2013-06-19 15:12:32 +02:00
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2013-06-20 12:34:02 +02:00
|
|
|
** a written agreement between you and Digia.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please use
|
|
|
|
|
** contact form at http://qt.digia.com <http://qt.digia.com/>
|
2013-06-19 15:12:32 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef PIXMAPCACHEMODEL_H
|
|
|
|
|
#define PIXMAPCACHEMODEL_H
|
|
|
|
|
|
2013-12-04 18:53:45 +01:00
|
|
|
#include "qmlprofiler/qmlprofilertimelinemodelproxy.h"
|
2014-02-14 16:34:22 +01:00
|
|
|
#include "qmlprofiler/singlecategorytimelinemodel.h"
|
2013-06-19 15:12:32 +02:00
|
|
|
#include "qmlprofiler/qmlprofilersimplemodel.h"
|
|
|
|
|
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QColor>
|
|
|
|
|
|
2013-06-24 14:17:43 +02:00
|
|
|
namespace QmlProfilerExtension {
|
2013-06-19 15:12:32 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-02-14 16:34:22 +01:00
|
|
|
class PixmapCacheModel : public QmlProfiler::SingleCategoryTimelineModel
|
2013-06-19 15:12:32 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
struct PixmapCacheEvent {
|
|
|
|
|
int eventId;
|
|
|
|
|
int pixmapEventType;
|
|
|
|
|
int urlIndex;
|
|
|
|
|
qint64 cacheSize;
|
|
|
|
|
int rowNumberExpanded;
|
|
|
|
|
int rowNumberCollapsed;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum PixmapEventType {
|
|
|
|
|
PixmapSizeKnown,
|
|
|
|
|
PixmapReferenceCountChanged,
|
|
|
|
|
PixmapCacheCountChanged,
|
|
|
|
|
PixmapLoadingStarted,
|
|
|
|
|
PixmapLoadingFinished,
|
|
|
|
|
PixmapLoadingError,
|
|
|
|
|
|
|
|
|
|
MaximumPixmapEventType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
PixmapCacheModel(QObject *parent = 0);
|
|
|
|
|
|
|
|
|
|
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
|
|
|
|
|
|
|
|
|
int getEventRow(int index) const;
|
|
|
|
|
Q_INVOKABLE int getEventId(int index) const;
|
|
|
|
|
Q_INVOKABLE QColor getColor(int index) const;
|
|
|
|
|
Q_INVOKABLE float getHeight(int index) const;
|
|
|
|
|
|
|
|
|
|
Q_INVOKABLE const QVariantList getLabelsForCategory(int category) const;
|
|
|
|
|
|
|
|
|
|
Q_INVOKABLE const QVariantList getEventDetails(int index) const;
|
2013-07-10 16:47:16 +02:00
|
|
|
|
2013-06-19 15:12:32 +02:00
|
|
|
void loadData();
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
class PixmapCacheModelPrivate;
|
2014-02-14 16:34:22 +01:00
|
|
|
Q_DECLARE_PRIVATE(PixmapCacheModel)
|
2013-06-19 15:12:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2013-06-24 14:17:43 +02:00
|
|
|
} // namespace QmlProfilerExtension
|
2013-06-19 15:12:32 +02:00
|
|
|
|
|
|
|
|
#endif // PIXMAPCACHEMODEL_H
|