Commit 10d942e2 authored by Ulf Hermann's avatar Ulf Hermann Committed by Ulf Hermann
Browse files

QmlProfiler: Split AbstractTimelineModel in two classes



We need a general purpose TimelineModel and a specialized
QmlProfilerTimelineModel.

Change-Id: I2da02d65efa11e160cab5fa9f8a21075beb0e2bf
Reviewed-by: default avatarKai Koehne <kai.koehne@theqtcompany.com>
parent af84726c
...@@ -5,7 +5,6 @@ QT += network qml quick ...@@ -5,7 +5,6 @@ QT += network qml quick
include(../../qtcreatorplugin.pri) include(../../qtcreatorplugin.pri)
SOURCES += \ SOURCES += \
abstracttimelinemodel.cpp \
localqmlprofilerrunner.cpp \ localqmlprofilerrunner.cpp \
qmlprofileranimationsmodel.cpp \ qmlprofileranimationsmodel.cpp \
qmlprofilerattachdialog.cpp \ qmlprofilerattachdialog.cpp \
...@@ -23,6 +22,7 @@ SOURCES += \ ...@@ -23,6 +22,7 @@ SOURCES += \
qmlprofilerruncontrolfactory.cpp \ qmlprofilerruncontrolfactory.cpp \
qmlprofilerstatemanager.cpp \ qmlprofilerstatemanager.cpp \
qmlprofilerstatewidget.cpp \ qmlprofilerstatewidget.cpp \
qmlprofilertimelinemodel.cpp \
qmlprofilertimelinemodelfactory.cpp \ qmlprofilertimelinemodelfactory.cpp \
qmlprofilertool.cpp \ qmlprofilertool.cpp \
qmlprofilertracefile.cpp \ qmlprofilertracefile.cpp \
...@@ -31,14 +31,13 @@ SOURCES += \ ...@@ -31,14 +31,13 @@ SOURCES += \
qmlprofilerviewmanager.cpp \ qmlprofilerviewmanager.cpp \
qv8profilerdatamodel.cpp \ qv8profilerdatamodel.cpp \
qv8profilereventview.cpp \ qv8profilereventview.cpp \
timelinemodel.cpp \
timelinemodelaggregator.cpp \ timelinemodelaggregator.cpp \
timelinerenderer.cpp \ timelinerenderer.cpp \
timelinezoomcontrol.cpp timelinezoomcontrol.cpp
HEADERS += \ HEADERS += \
abstractqmlprofilerrunner.h \ abstractqmlprofilerrunner.h \
abstracttimelinemodel.h \
abstracttimelinemodel_p.h \
localqmlprofilerrunner.h \ localqmlprofilerrunner.h \
qmlprofiler_global.h \ qmlprofiler_global.h \
qmlprofileranimationsmodel.h \ qmlprofileranimationsmodel.h \
...@@ -59,6 +58,7 @@ HEADERS += \ ...@@ -59,6 +58,7 @@ HEADERS += \
qmlprofilerruncontrolfactory.h \ qmlprofilerruncontrolfactory.h \
qmlprofilerstatemanager.h \ qmlprofilerstatemanager.h \
qmlprofilerstatewidget.h \ qmlprofilerstatewidget.h \
qmlprofilertimelinemodel.h \
qmlprofilertimelinemodelfactory.h \ qmlprofilertimelinemodelfactory.h \
qmlprofilertool.h \ qmlprofilertool.h \
qmlprofilertracefile.h \ qmlprofilertracefile.h \
...@@ -67,6 +67,8 @@ HEADERS += \ ...@@ -67,6 +67,8 @@ HEADERS += \
qmlprofilerviewmanager.h \ qmlprofilerviewmanager.h \
qv8profilerdatamodel.h \ qv8profilerdatamodel.h \
qv8profilereventview.h \ qv8profilereventview.h \
timelinemodel.h \
timelinemodel_p.h \
timelinemodelaggregator.h \ timelinemodelaggregator.h \
timelinerenderer.h \ timelinerenderer.h \
timelinezoomcontrol.h timelinezoomcontrol.h
......
...@@ -21,7 +21,6 @@ QtcPlugin { ...@@ -21,7 +21,6 @@ QtcPlugin {
name: "General" name: "General"
files: [ files: [
"abstractqmlprofilerrunner.h", "abstractqmlprofilerrunner.h",
"abstracttimelinemodel.h", "abstracttimelinemodel_p.h", "abstracttimelinemodel.cpp",
"localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h", "localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h",
"qmlprofiler_global.h", "qmlprofiler_global.h",
"qmlprofileranimationsmodel.h", "qmlprofileranimationsmodel.cpp", "qmlprofileranimationsmodel.h", "qmlprofileranimationsmodel.cpp",
...@@ -41,6 +40,7 @@ QtcPlugin { ...@@ -41,6 +40,7 @@ QtcPlugin {
"qmlprofilerstatemanager.cpp", "qmlprofilerstatemanager.h", "qmlprofilerstatemanager.cpp", "qmlprofilerstatemanager.h",
"qmlprofilerstatewidget.cpp", "qmlprofilerstatewidget.h", "qmlprofilerstatewidget.cpp", "qmlprofilerstatewidget.h",
"qmlprofilerrangemodel.cpp", "qmlprofilerrangemodel.h", "qmlprofilerrangemodel.cpp", "qmlprofilerrangemodel.h",
"qmlprofilertimelinemodel.cpp", "qmlprofilertimelinemodel.h",
"qmlprofilertimelinemodelfactory.cpp", "qmlprofilertimelinemodelfactory.h", "qmlprofilertimelinemodelfactory.cpp", "qmlprofilertimelinemodelfactory.h",
"qmlprofilertool.cpp", "qmlprofilertool.h", "qmlprofilertool.cpp", "qmlprofilertool.h",
"qmlprofilertracefile.cpp", "qmlprofilertracefile.h", "qmlprofilertracefile.cpp", "qmlprofilertracefile.h",
...@@ -49,6 +49,7 @@ QtcPlugin { ...@@ -49,6 +49,7 @@ QtcPlugin {
"qmlprofilerviewmanager.cpp", "qmlprofilerviewmanager.h", "qmlprofilerviewmanager.cpp", "qmlprofilerviewmanager.h",
"qv8profilerdatamodel.cpp", "qv8profilerdatamodel.h", "qv8profilerdatamodel.cpp", "qv8profilerdatamodel.h",
"qv8profilereventview.h", "qv8profilereventview.cpp", "qv8profilereventview.h", "qv8profilereventview.cpp",
"timelinemodel.cpp", "timelinemodel.h", "timelinemodel_p.h",
"timelinemodelaggregator.cpp", "timelinemodelaggregator.h", "timelinemodelaggregator.cpp", "timelinemodelaggregator.h",
"timelinerenderer.cpp", "timelinerenderer.h", "timelinerenderer.cpp", "timelinerenderer.h",
"timelinezoomcontrol.cpp", "timelinezoomcontrol.h" "timelinezoomcontrol.cpp", "timelinezoomcontrol.h"
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "qmlprofileranimationsmodel.h" #include "qmlprofileranimationsmodel.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "abstracttimelinemodel_p.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QCoreApplication> #include <QCoreApplication>
...@@ -47,10 +46,10 @@ namespace QmlProfiler { ...@@ -47,10 +46,10 @@ namespace QmlProfiler {
namespace Internal { namespace Internal {
QmlProfilerAnimationsModel::QmlProfilerAnimationsModel(QmlProfilerModelManager *manager, QmlProfilerAnimationsModel::QmlProfilerAnimationsModel(QmlProfilerModelManager *manager,
QObject *parent) QObject *parent) :
: AbstractTimelineModel(manager, QmlProfilerTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileAnimations)), tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileAnimations)),
QmlDebug::Event, QmlDebug::MaximumRangeType, parent) QmlDebug::Event, QmlDebug::MaximumRangeType, parent)
{ {
m_maxGuiThreadAnimations = m_maxRenderThreadAnimations = 0; m_maxGuiThreadAnimations = m_maxRenderThreadAnimations = 0;
announceFeatures(1 << QmlDebug::ProfileAnimations); announceFeatures(1 << QmlDebug::ProfileAnimations);
...@@ -60,12 +59,12 @@ void QmlProfilerAnimationsModel::clear() ...@@ -60,12 +59,12 @@ void QmlProfilerAnimationsModel::clear()
{ {
m_maxGuiThreadAnimations = m_maxRenderThreadAnimations = 0; m_maxGuiThreadAnimations = m_maxRenderThreadAnimations = 0;
m_data.clear(); m_data.clear();
AbstractTimelineModel::clear(); QmlProfilerTimelineModel::clear();
} }
bool QmlProfilerAnimationsModel::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const bool QmlProfilerAnimationsModel::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const
{ {
return AbstractTimelineModel::accepted(event) && return QmlProfilerTimelineModel::accepted(event) &&
event.detailType== QmlDebug::AnimationFrame; event.detailType== QmlDebug::AnimationFrame;
} }
...@@ -149,7 +148,7 @@ int QmlProfilerAnimationsModel::rowMaxValue(int rowNumber) const ...@@ -149,7 +148,7 @@ int QmlProfilerAnimationsModel::rowMaxValue(int rowNumber) const
case 2: case 2:
return m_maxRenderThreadAnimations; return m_maxRenderThreadAnimations;
default: default:
return AbstractTimelineModel::rowMaxValue(rowNumber); return QmlProfilerTimelineModel::rowMaxValue(rowNumber);
} }
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define QMLPROFILERANIMATIONSMODEL_H #define QMLPROFILERANIMATIONSMODEL_H
#include <QObject> #include <QObject>
#include "abstracttimelinemodel.h" #include "qmlprofilertimelinemodel.h"
#include <qmldebug/qmlprofilereventtypes.h> #include <qmldebug/qmlprofilereventtypes.h>
#include <qmldebug/qmlprofilereventlocation.h> #include <qmldebug/qmlprofilereventlocation.h>
//#include <QHash> //#include <QHash>
...@@ -49,7 +49,7 @@ class QmlProfilerModelManager; ...@@ -49,7 +49,7 @@ class QmlProfilerModelManager;
namespace Internal { namespace Internal {
class QmlProfilerAnimationsModel : public AbstractTimelineModel class QmlProfilerAnimationsModel : public QmlProfilerTimelineModel
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -47,9 +47,9 @@ void QmlProfilerNotesModel::setModelManager(QmlProfilerModelManager *modelManage ...@@ -47,9 +47,9 @@ void QmlProfilerNotesModel::setModelManager(QmlProfilerModelManager *modelManage
m_modelManager = modelManager; m_modelManager = modelManager;
} }
void QmlProfilerNotesModel::addTimelineModel(const AbstractTimelineModel *timelineModel) void QmlProfilerNotesModel::addTimelineModel(const QmlProfilerTimelineModel *timelineModel)
{ {
connect(timelineModel, &AbstractTimelineModel::destroyed, connect(timelineModel, &QmlProfilerTimelineModel::destroyed,
this, &QmlProfilerNotesModel::removeTimelineModel); this, &QmlProfilerNotesModel::removeTimelineModel);
m_timelineModels.insert(timelineModel->modelId(), timelineModel); m_timelineModels.insert(timelineModel->modelId(), timelineModel);
} }
...@@ -111,7 +111,7 @@ int QmlProfilerNotesModel::get(int timelineModel, int timelineIndex) const ...@@ -111,7 +111,7 @@ int QmlProfilerNotesModel::get(int timelineModel, int timelineIndex) const
int QmlProfilerNotesModel::add(int timelineModel, int timelineIndex, const QString &text) int QmlProfilerNotesModel::add(int timelineModel, int timelineIndex, const QString &text)
{ {
const AbstractTimelineModel *model = m_timelineModels[timelineModel]; const QmlProfilerTimelineModel *model = m_timelineModels[timelineModel];
int typeId = model->typeId(timelineIndex); int typeId = model->typeId(timelineIndex);
Note note = { text, timelineModel, timelineIndex }; Note note = { text, timelineModel, timelineIndex };
m_data << note; m_data << note;
...@@ -162,7 +162,7 @@ int QmlProfilerNotesModel::add(int typeId, qint64 start, qint64 duration, const ...@@ -162,7 +162,7 @@ int QmlProfilerNotesModel::add(int typeId, qint64 start, qint64 duration, const
int timelineIndex = -1; int timelineIndex = -1;
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = const QVector<QmlProfilerDataModel::QmlEventTypeData> &types =
m_modelManager->qmlModel()->getEventTypes(); m_modelManager->qmlModel()->getEventTypes();
foreach (const AbstractTimelineModel *model, m_timelineModels) { foreach (const QmlProfilerTimelineModel *model, m_timelineModels) {
if (model->accepted(types[typeId])) { if (model->accepted(types[typeId])) {
for (int i = model->firstIndex(start); i <= model->lastIndex(start + duration); ++i) { for (int i = model->firstIndex(start); i <= model->lastIndex(start + duration); ++i) {
if (i < 0) if (i < 0)
...@@ -237,7 +237,7 @@ void QmlProfilerNotesModel::saveData() ...@@ -237,7 +237,7 @@ void QmlProfilerNotesModel::saveData()
if (it == m_timelineModels.end()) if (it == m_timelineModels.end())
continue; continue;
const AbstractTimelineModel *model = it.value(); const QmlProfilerTimelineModel *model = it.value();
QmlProfilerDataModel::QmlEventNoteData save = { QmlProfilerDataModel::QmlEventNoteData save = {
model->typeId(note.timelineIndex), model->startTime(note.timelineIndex), model->typeId(note.timelineIndex), model->startTime(note.timelineIndex),
model->duration(note.timelineIndex), note.text model->duration(note.timelineIndex), note.text
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#ifndef NOTESMODEL_H #ifndef NOTESMODEL_H
#define NOTESMODEL_H #define NOTESMODEL_H
#include "abstracttimelinemodel.h" #include "qmlprofilertimelinemodel.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include <QList> #include <QList>
#include <QHash> #include <QHash>
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
int count() const; int count() const;
void setModelManager(QmlProfilerModelManager *modelManager); void setModelManager(QmlProfilerModelManager *modelManager);
void addTimelineModel(const AbstractTimelineModel *timelineModel); void addTimelineModel(const QmlProfilerTimelineModel *timelineModel);
Q_INVOKABLE int typeId(int index) const; Q_INVOKABLE int typeId(int index) const;
Q_INVOKABLE QString text(int index) const; Q_INVOKABLE QString text(int index) const;
...@@ -86,7 +86,7 @@ private slots: ...@@ -86,7 +86,7 @@ private slots:
protected: protected:
QmlProfilerModelManager *m_modelManager; QmlProfilerModelManager *m_modelManager;
QList<Note> m_data; QList<Note> m_data;
QHash<int, const AbstractTimelineModel *> m_timelineModels; QHash<int, const QmlProfilerTimelineModel *> m_timelineModels;
bool m_modified; bool m_modified;
int add(int typeId, qint64 startTime, qint64 duration, const QString &text); int add(int typeId, qint64 startTime, qint64 duration, const QString &text);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "qmlprofilerruncontrolfactory.h" #include "qmlprofilerruncontrolfactory.h"
#include "qmlprofilertool.h" #include "qmlprofilertool.h"
#include "abstracttimelinemodel.h" #include "qmlprofilertimelinemodel.h"
#include <analyzerbase/analyzermanager.h> #include <analyzerbase/analyzermanager.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
...@@ -103,7 +103,7 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown() ...@@ -103,7 +103,7 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
return SynchronousShutdown; return SynchronousShutdown;
} }
QList<AbstractTimelineModel *> QmlProfilerPlugin::getModels(QmlProfilerModelManager *manager) const QList<QmlProfilerTimelineModel *> QmlProfilerPlugin::getModels(QmlProfilerModelManager *manager) const
{ {
return factory->create(manager); return factory->create(manager);
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "qmlprofilertimelinemodelfactory.h" #include "qmlprofilertimelinemodelfactory.h"
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include "abstracttimelinemodel.h" #include "qmlprofilertimelinemodel.h"
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
static bool debugOutput; static bool debugOutput;
static QmlProfilerPlugin *instance; static QmlProfilerPlugin *instance;
QList<AbstractTimelineModel *> getModels(QmlProfilerModelManager *manager) const; QList<QmlProfilerTimelineModel *> getModels(QmlProfilerModelManager *manager) const;
private: private:
QmlProfilerTimelineModelFactory *factory; QmlProfilerTimelineModelFactory *factory;
......
...@@ -46,8 +46,8 @@ namespace Internal { ...@@ -46,8 +46,8 @@ namespace Internal {
QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager, QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager,
QmlDebug::RangeType range, QObject *parent) QmlDebug::RangeType range, QObject *parent) :
: AbstractTimelineModel(manager, categoryLabel(range), QmlDebug::MaximumMessage, range, parent) QmlProfilerTimelineModel(manager, categoryLabel(range), QmlDebug::MaximumMessage, range, parent)
{ {
m_expandedRowTypes << -1; m_expandedRowTypes << -1;
announceFeatures(1ULL << QmlDebug::featureFromRangeType(rangeType())); announceFeatures(1ULL << QmlDebug::featureFromRangeType(rangeType()));
...@@ -58,7 +58,7 @@ void QmlProfilerRangeModel::clear() ...@@ -58,7 +58,7 @@ void QmlProfilerRangeModel::clear()
m_expandedRowTypes.clear(); m_expandedRowTypes.clear();
m_expandedRowTypes << -1; m_expandedRowTypes << -1;
m_data.clear(); m_data.clear();
AbstractTimelineModel::clear(); QmlProfilerTimelineModel::clear();
} }
void QmlProfilerRangeModel::loadData() void QmlProfilerRangeModel::loadData()
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#ifndef QMLPROFILERRANGEMODEL_H #ifndef QMLPROFILERRANGEMODEL_H
#define QMLPROFILERRANGEMODEL_H #define QMLPROFILERRANGEMODEL_H
#include "abstracttimelinemodel.h" #include "qmlprofilertimelinemodel.h"
#include <qmldebug/qmlprofilereventtypes.h> #include <qmldebug/qmlprofilereventtypes.h>
#include <qmldebug/qmlprofilereventlocation.h> #include <qmldebug/qmlprofilereventlocation.h>
#include <QVariantList> #include <QVariantList>
...@@ -44,7 +44,7 @@ class QmlProfilerModelManager; ...@@ -44,7 +44,7 @@ class QmlProfilerModelManager;
namespace Internal { namespace Internal {
class QmlProfilerRangeModel : public AbstractTimelineModel class QmlProfilerRangeModel : public QmlProfilerTimelineModel
{ {
Q_OBJECT Q_OBJECT
public: public:
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "qmlprofilertimelinemodel.h"
namespace QmlProfiler {
QmlProfilerTimelineModel::QmlProfilerTimelineModel(QmlProfilerModelManager *modelManager,
const QString &displayName,
QmlDebug::Message message,
QmlDebug::RangeType rangeType, QObject *parent) :
TimelineModel(modelManager->registerModelProxy(), displayName, parent), m_message(message),
m_rangeType(rangeType), m_modelManager(modelManager)
{
connect(modelManager->qmlModel(), &QmlProfilerDataModel::changed,
this, &QmlProfilerTimelineModel::dataChanged);
}
QmlDebug::RangeType QmlProfilerTimelineModel::rangeType() const
{
return m_rangeType;
}
QmlDebug::Message QmlProfilerTimelineModel::message() const
{
return m_message;
}
bool QmlProfilerTimelineModel::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const
{
return (event.rangeType == m_rangeType && event.message == m_message);
}
bool QmlProfilerTimelineModel::handlesTypeId(int typeIndex) const
{
if (typeIndex < 0)
return false;
return accepted(modelManager()->qmlModel()->getEventTypes().at(typeIndex));
}
void QmlProfilerTimelineModel::clear()
{
TimelineModel::clear();
updateProgress(0, 1);
}
QmlProfilerModelManager *QmlProfilerTimelineModel::modelManager() const
{
return m_modelManager;
}
void QmlProfilerTimelineModel::updateProgress(qint64 count, qint64 max) const
{
m_modelManager->modelProxyCountUpdated(modelId(), count, max);
}
void QmlProfilerTimelineModel::announceFeatures(quint64 features) const
{
m_modelManager->announceFeatures(modelId(), features);
}
void QmlProfilerTimelineModel::dataChanged()
{
switch (m_modelManager->state()) {
case QmlProfilerDataState::ProcessingData:
loadData();
emit emptyChanged();
break;
case QmlProfilerDataState::ClearingData:
clear();
break;
default:
break;
}
}
int QmlProfilerTimelineModel::bindingLoopDest(int index) const
{
Q_UNUSED(index);
return -1;
}
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QMLPROFILERTIMELINEMODEL_H
#define QMLPROFILERTIMELINEMODEL_H
#include "timelinemodel.h"
namespace QmlProfiler {
class QMLPROFILER_EXPORT QmlProfilerTimelineModel : public TimelineModel {
Q_OBJECT
Q_PROPERTY(QmlDebug::RangeType rangeType READ rangeType CONSTANT)
Q_PROPERTY(QmlDebug::Message message READ message CONSTANT)
Q_PROPERTY(QmlProfilerModelManager *modelManager READ modelManager CONSTANT)
public:
QmlProfilerTimelineModel(QmlProfilerModelManager *modelManager, const QString &displayName,
QmlDebug::Message message, QmlDebug::RangeType rangeType,
QObject *parent);
QmlProfilerModelManager *modelManager() const;
QmlDebug::RangeType rangeType() const;
QmlDebug::Message message() const;
virtual bool accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const;
bool handlesTypeId(int typeId) const;
Q_INVOKABLE virtual int bindingLoopDest(int index) const;
virtual void loadData() = 0;
void clear();
private slots:
void dataChanged();
protected:
void updateProgress(qint64 count, qint64 max) const;