diff --git a/src/plugins/qmlprofiler/qmlprofiler.pro b/src/plugins/qmlprofiler/qmlprofiler.pro index cb6bb5f86c9b70e5c4a285abe10c3a7b592310ab..8b2ec8aef51b56dec15488650abdff7c56ccb51f 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.pro +++ b/src/plugins/qmlprofiler/qmlprofiler.pro @@ -5,70 +5,70 @@ QT += network qml quick include(../../qtcreatorplugin.pri) SOURCES += \ - qmlprofilerplugin.cpp \ - qmlprofilertool.cpp \ - qmlprofilerengine.cpp \ - qmlprofilerattachdialog.cpp \ + abstracttimelinemodel.cpp \ localqmlprofilerrunner.cpp \ - qmlprofilereventview.cpp \ - qv8profilereventview.cpp \ + qmlprofileranimationsmodel.cpp \ + qmlprofilerattachdialog.cpp \ + qmlprofilerbasemodel.cpp \ + qmlprofilerclientmanager.cpp \ + qmlprofilerdatamodel.cpp \ qmlprofilerdetailsrewriter.cpp \ - qmlprofilertraceview.cpp \ - timelinerenderer.cpp \ + qmlprofilerengine.cpp \ + qmlprofilereventsmodelproxy.cpp \ + qmlprofilereventview.cpp \ + qmlprofilermodelmanager.cpp \ + qmlprofilernotesmodel.cpp \ + qmlprofilerplugin.cpp \ + qmlprofilerrangemodel.cpp \ + qmlprofilerruncontrolfactory.cpp \ qmlprofilerstatemanager.cpp \ - qv8profilerdatamodel.cpp \ - qmlprofilerclientmanager.cpp \ - qmlprofilerviewmanager.cpp \ qmlprofilerstatewidget.cpp \ - qmlprofilerruncontrolfactory.cpp \ - qmlprofilermodelmanager.cpp \ - qmlprofilereventsmodelproxy.cpp \ - qmlprofilertimelinemodelproxy.cpp \ - qmlprofilertreeview.cpp \ + qmlprofilertool.cpp \ qmlprofilertracefile.cpp \ - abstracttimelinemodel.cpp \ - timelinemodelaggregator.cpp \ - qmlprofilerpainteventsmodelproxy.cpp \ + qmlprofilertraceview.cpp \ + qmlprofilertreeview.cpp \ + qmlprofilerviewmanager.cpp \ + qv8profilerdatamodel.cpp \ + qv8profilereventview.cpp \ sortedtimelinemodel.cpp \ - qmlprofilerbasemodel.cpp \ - qmlprofilerdatamodel.cpp \ - notesmodel.cpp \ + timelinemodelaggregator.cpp \ + timelinerenderer.cpp \ timelinezoomcontrol.cpp HEADERS += \ - qmlprofilerconstants.h \ - qmlprofiler_global.h \ - qmlprofilerplugin.h \ - qmlprofilertool.h \ - qmlprofilerengine.h \ - qmlprofilerattachdialog.h \ abstractqmlprofilerrunner.h \ + abstracttimelinemodel.h \ + abstracttimelinemodel_p.h \ localqmlprofilerrunner.h \ - qmlprofilereventview.h \ - qv8profilereventview.h \ + qmlprofiler_global.h \ + qmlprofileranimationsmodel.h \ + qmlprofilerattachdialog.h \ + qmlprofilerbasemodel.h \ + qmlprofilerbasemodel_p.h \ + qmlprofilerclientmanager.h \ + qmlprofilerconstants.h \ + qmlprofilerdatamodel.h \ qmlprofilerdetailsrewriter.h \ - qmlprofilertraceview.h \ - timelinerenderer.h \ + qmlprofilerengine.h \ + qmlprofilereventsmodelproxy.h \ + qmlprofilereventview.h \ + qmlprofilermodelmanager.h \ + qmlprofilernotesmodel.h \ + qmlprofilerplugin.h \ + qmlprofilerrangemodel.h \ + qmlprofilerruncontrolfactory.h \ qmlprofilerstatemanager.h \ - qv8profilerdatamodel.h \ - qmlprofilerclientmanager.h \ - qmlprofilerviewmanager.h \ qmlprofilerstatewidget.h \ - qmlprofilerruncontrolfactory.h \ - qmlprofilermodelmanager.h \ - qmlprofilereventsmodelproxy.h \ - qmlprofilertimelinemodelproxy.h \ - qmlprofilertreeview.h \ + qmlprofilertool.h \ qmlprofilertracefile.h \ - abstracttimelinemodel.h \ - timelinemodelaggregator.h \ - qmlprofilerpainteventsmodelproxy.h \ + qmlprofilertraceview.h \ + qmlprofilertreeview.h \ + qmlprofilerviewmanager.h \ + qv8profilerdatamodel.h \ + qv8profilereventview.h \ sortedtimelinemodel.h \ - qmlprofilerbasemodel.h \ - abstracttimelinemodel_p.h \ - qmlprofilerdatamodel.h \ - qmlprofilerbasemodel_p.h \ - notesmodel.h \ + timelinemodelaggregator.h \ + timelinerenderer.h \ timelinezoomcontrol.h RESOURCES += \ diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 184cd9a08761228b382dfa5b72b6239e68dfb27d..67f01cb424b6f1afa87b4fe221be1bd4319d9694 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -23,9 +23,8 @@ QtcPlugin { "abstractqmlprofilerrunner.h", "abstracttimelinemodel.h", "abstracttimelinemodel_p.h", "abstracttimelinemodel.cpp", "localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h", - "notesmodel.cpp", - "notesmodel.h", "qmlprofiler_global.h", + "qmlprofileranimationsmodel.h", "qmlprofileranimationsmodel.cpp", "qmlprofilerattachdialog.cpp", "qmlprofilerattachdialog.h", "qmlprofilerbasemodel.cpp", "qmlprofilerbasemodel.h", "qmlprofilerbasemodel_p.h", "qmlprofilerclientmanager.cpp", "qmlprofilerclientmanager.h", @@ -36,12 +35,12 @@ QtcPlugin { "qmlprofilereventsmodelproxy.cpp", "qmlprofilereventsmodelproxy.h", "qmlprofilereventview.cpp", "qmlprofilereventview.h", "qmlprofilermodelmanager.cpp", "qmlprofilermodelmanager.h", - "qmlprofilerpainteventsmodelproxy.h", "qmlprofilerpainteventsmodelproxy.cpp", + "qmlprofilernotesmodel.cpp", "qmlprofilernotesmodel.h", "qmlprofilerplugin.cpp", "qmlprofilerplugin.h", "qmlprofilerruncontrolfactory.cpp", "qmlprofilerruncontrolfactory.h", "qmlprofilerstatemanager.cpp", "qmlprofilerstatemanager.h", "qmlprofilerstatewidget.cpp", "qmlprofilerstatewidget.h", - "qmlprofilertimelinemodelproxy.cpp", "qmlprofilertimelinemodelproxy.h", + "qmlprofilerrangemodel.cpp", "qmlprofilerrangemodel.h", "qmlprofilertool.cpp", "qmlprofilertool.h", "qmlprofilertracefile.cpp", "qmlprofilertracefile.h", "qmlprofilertraceview.cpp", "qmlprofilertraceview.h", diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp similarity index 83% rename from src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp rename to src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp index c29e2d38018fa3f77ac381d1e0a35806ff8f77a6..147cb21f3d583cb8a90aab17990280afb6c5484b 100644 --- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp @@ -28,7 +28,7 @@ ** ****************************************************************************/ -#include "qmlprofilerpainteventsmodelproxy.h" +#include "qmlprofileranimationsmodel.h" #include "qmlprofilermodelmanager.h" #include "qmlprofilerdatamodel.h" #include "abstracttimelinemodel_p.h" @@ -46,49 +46,49 @@ namespace QmlProfiler { namespace Internal { -class PaintEventsModelProxy::PaintEventsModelProxyPrivate : public AbstractTimelineModelPrivate +class QmlProfilerAnimationsModel::QmlProfilerAnimationsModelPrivate : public AbstractTimelineModelPrivate { public: - QVector<PaintEventsModelProxy::QmlPaintEventData> data; + QVector<QmlProfilerAnimationsModel::QmlPaintEventData> data; int maxGuiThreadAnimations; int maxRenderThreadAnimations; int rowFromThreadId(QmlDebug::AnimationThread threadId) const; private: - Q_DECLARE_PUBLIC(PaintEventsModelProxy) + Q_DECLARE_PUBLIC(QmlProfilerAnimationsModel) }; -PaintEventsModelProxy::PaintEventsModelProxy(QObject *parent) - : AbstractTimelineModel(new PaintEventsModelProxyPrivate, +QmlProfilerAnimationsModel::QmlProfilerAnimationsModel(QObject *parent) + : AbstractTimelineModel(new QmlProfilerAnimationsModelPrivate, tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileAnimations)), QmlDebug::Event, QmlDebug::MaximumRangeType, parent) { - Q_D(PaintEventsModelProxy); + Q_D(QmlProfilerAnimationsModel); d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; } -quint64 PaintEventsModelProxy::features() const +quint64 QmlProfilerAnimationsModel::features() const { return 1 << QmlDebug::ProfileAnimations; } -void PaintEventsModelProxy::clear() +void QmlProfilerAnimationsModel::clear() { - Q_D(PaintEventsModelProxy); + Q_D(QmlProfilerAnimationsModel); d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; d->data.clear(); AbstractTimelineModel::clear(); } -bool PaintEventsModelProxy::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const +bool QmlProfilerAnimationsModel::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const { return AbstractTimelineModel::accepted(event) && event.detailType== QmlDebug::AnimationFrame; } -void PaintEventsModelProxy::loadData() +void QmlProfilerAnimationsModel::loadData() { - Q_D(PaintEventsModelProxy); + Q_D(QmlProfilerAnimationsModel); clear(); QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel(); if (simpleModel->isEmpty()) @@ -149,21 +149,21 @@ void PaintEventsModelProxy::loadData() /////////////////// QML interface -int PaintEventsModelProxy::PaintEventsModelProxyPrivate::rowFromThreadId( +int QmlProfilerAnimationsModel::QmlProfilerAnimationsModelPrivate::rowFromThreadId( QmlDebug::AnimationThread threadId) const { return (threadId == QmlDebug::GuiThread || maxGuiThreadAnimations == 0) ? 1 : 2; } -int PaintEventsModelProxy::row(int index) const +int QmlProfilerAnimationsModel::row(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); return d->rowFromThreadId(d->data[index].threadId); } -int PaintEventsModelProxy::rowMaxValue(int rowNumber) const +int QmlProfilerAnimationsModel::rowMaxValue(int rowNumber) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); switch (rowNumber) { case 1: return d->maxGuiThreadAnimations > 0 ? d->maxGuiThreadAnimations : @@ -175,15 +175,15 @@ int PaintEventsModelProxy::rowMaxValue(int rowNumber) const } } -int PaintEventsModelProxy::selectionId(int index) const +int QmlProfilerAnimationsModel::selectionId(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); return d->data[index].threadId; } -QColor PaintEventsModelProxy::color(int index) const +QColor QmlProfilerAnimationsModel::color(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); double fpsFraction = d->data[index].framerate / 60.0; if (fpsFraction > 1.0) fpsFraction = 1.0; @@ -192,9 +192,9 @@ QColor PaintEventsModelProxy::color(int index) const return colorByFraction(fpsFraction); } -float PaintEventsModelProxy::relativeHeight(int index) const +float QmlProfilerAnimationsModel::relativeHeight(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); const QmlPaintEventData &data = d->data[index]; // Add some height to the events if we're far from the scale threshold of 2 * DefaultRowHeight. @@ -207,9 +207,9 @@ float PaintEventsModelProxy::relativeHeight(int index) const d->maxRenderThreadAnimations); } -QVariantList PaintEventsModelProxy::labels() const +QVariantList QmlProfilerAnimationsModel::labels() const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); QVariantList result; if (!d->hidden && d->maxGuiThreadAnimations > 0) { @@ -231,9 +231,9 @@ QVariantList PaintEventsModelProxy::labels() const return result; } -QVariantMap PaintEventsModelProxy::details(int index) const +QVariantMap QmlProfilerAnimationsModel::details(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); QVariantMap result; result.insert(QStringLiteral("displayName"), displayName()); diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h similarity index 88% rename from src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h rename to src/plugins/qmlprofiler/qmlprofileranimationsmodel.h index d520bfb7c51c96a5f091a802ab40b73e75ff7db5..92fb8d430170e515f68aded484e4bb2addf70634 100644 --- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h +++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h @@ -29,8 +29,8 @@ ****************************************************************************/ -#ifndef QMLPROFILERPAINTEVENTSMODELPROXY_H -#define QMLPROFILERPAINTEVENTSMODELPROXY_H +#ifndef QMLPROFILERANIMATIONSMODEL_H +#define QMLPROFILERANIMATIONSMODEL_H #include <QObject> #include "abstracttimelinemodel.h" @@ -49,7 +49,7 @@ class QmlProfilerModelManager; namespace Internal { -class PaintEventsModelProxy : public AbstractTimelineModel +class QmlProfilerAnimationsModel : public AbstractTimelineModel { Q_OBJECT public: @@ -60,7 +60,7 @@ public: QmlDebug::AnimationThread threadId; }; - PaintEventsModelProxy(QObject *parent = 0); + QmlProfilerAnimationsModel(QObject *parent = 0); int rowMaxValue(int rowNumber) const; @@ -81,11 +81,11 @@ protected: void clear(); private: - class PaintEventsModelProxyPrivate; - Q_DECLARE_PRIVATE(PaintEventsModelProxy) + class QmlProfilerAnimationsModelPrivate; + Q_DECLARE_PRIVATE(QmlProfilerAnimationsModel) }; } } -#endif +#endif // QMLPROFILERANIMATIONSMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp index 9bda889b76ba0b4606f5b2a000e7258434cf400e..694ede70fbaede5794cd52a09bb8d99e9f8b2866 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp @@ -31,7 +31,7 @@ #include "qmlprofilerdatamodel.h" #include "qmlprofilerbasemodel_p.h" #include "qmlprofilermodelmanager.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include <qmldebug/qmlprofilereventtypes.h> #include <utils/qtcassert.h> #include <QUrl> diff --git a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp index b371d13f2a30e4ae4419b2f261504b66c1d80ea7..a86462660906428e8d6f5780b37a8e3d70604121 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp @@ -138,7 +138,7 @@ void QmlProfilerEventsModelProxy::dataChanged() void QmlProfilerEventsModelProxy::notesChanged(int typeIndex) { - const NotesModel *notesModel = d->modelManager->notesModel(); + const QmlProfilerNotesModel *notesModel = d->modelManager->notesModel(); if (typeIndex == -1) { d->notes.clear(); for (int noteId = 0; noteId < notesModel->count(); ++noteId) { diff --git a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h index f5e6146c57477f6f4e9d19c6ec8997f98beeaad0..4654734d5813caecb9549a9c157128130c179a66 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h +++ b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h @@ -33,7 +33,7 @@ #define QMLPROFILEREVENTSMODELPROXY_H #include "qmlprofilerdatamodel.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include <QObject> #include <qmldebug/qmlprofilereventtypes.h> #include <qmldebug/qmlprofilereventlocation.h> diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp index 09e8a0b5893fcba87e3d3ba06c0255f24de9cf5b..18c3b152b07457882f36c4ed9202bc92aba83575 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp @@ -32,7 +32,7 @@ #include "qmlprofilerdatamodel.h" #include "qv8profilerdatamodel.h" #include "qmlprofilertracefile.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include <utils/qtcassert.h> @@ -171,7 +171,7 @@ public: QmlProfilerDataModel *model; QV8ProfilerDataModel *v8Model; - NotesModel *notesModel; + QmlProfilerNotesModel *notesModel; QmlProfilerDataState *dataState; QmlProfilerTraceTime *traceTime; @@ -198,7 +198,7 @@ QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *fin d->v8Model = new QV8ProfilerDataModel(finder, this); d->dataState = new QmlProfilerDataState(this, this); d->traceTime = new QmlProfilerTraceTime(this); - d->notesModel = new NotesModel(this); + d->notesModel = new QmlProfilerNotesModel(this); d->notesModel->setModelManager(this); } @@ -222,7 +222,7 @@ QV8ProfilerDataModel *QmlProfilerModelManager::v8Model() const return d->v8Model; } -NotesModel *QmlProfilerModelManager::notesModel() const +QmlProfilerNotesModel *QmlProfilerModelManager::notesModel() const { return d->notesModel; } diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h index bb1f190623f30d75ab292febd4ad2ad245c4fa38..b942b0f726f0e424f05d9264747d5622a08a855d 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h @@ -43,7 +43,7 @@ namespace QmlProfiler { class QmlProfilerModelManager; class QmlProfilerDataModel; class QV8ProfilerDataModel; -class NotesModel; +class QmlProfilerNotesModel; namespace Internal { @@ -119,7 +119,7 @@ public: QmlProfilerTraceTime *traceTime() const; QmlProfilerDataModel *qmlModel() const; QV8ProfilerDataModel *v8Model() const; - NotesModel *notesModel() const; + QmlProfilerNotesModel *notesModel() const; bool isEmpty() const; int count() const; diff --git a/src/plugins/qmlprofiler/notesmodel.cpp b/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp similarity index 81% rename from src/plugins/qmlprofiler/notesmodel.cpp rename to src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp index 57fb4867009cd914038980d915f3a834132eef66..96641ff2b19a073c58f745a17e0974ae9b4ec9bd 100644 --- a/src/plugins/qmlprofiler/notesmodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp @@ -28,32 +28,33 @@ ** ****************************************************************************/ -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" namespace QmlProfiler { -NotesModel::NotesModel(QObject *parent) : QObject(parent), m_modelManager(0), m_modified(false) +QmlProfilerNotesModel::QmlProfilerNotesModel(QObject *parent) : QObject(parent), m_modelManager(0), + m_modified(false) { } -int NotesModel::count() const +int QmlProfilerNotesModel::count() const { return m_data.count(); } -void NotesModel::setModelManager(QmlProfilerModelManager *modelManager) +void QmlProfilerNotesModel::setModelManager(QmlProfilerModelManager *modelManager) { m_modelManager = modelManager; } -void NotesModel::addTimelineModel(const AbstractTimelineModel *timelineModel) +void QmlProfilerNotesModel::addTimelineModel(const AbstractTimelineModel *timelineModel) { connect(timelineModel, &AbstractTimelineModel::destroyed, - this, &NotesModel::removeTimelineModel); + this, &QmlProfilerNotesModel::removeTimelineModel); m_timelineModels.insert(timelineModel->modelId(), timelineModel); } -int NotesModel::typeId(int index) const +int QmlProfilerNotesModel::typeId(int index) const { const Note ¬e = m_data[index]; auto it = m_timelineModels.find(note.timelineModel); @@ -62,22 +63,22 @@ int NotesModel::typeId(int index) const return it.value()->typeId(note.timelineIndex); } -QString NotesModel::text(int index) const +QString QmlProfilerNotesModel::text(int index) const { return m_data[index].text; } -int NotesModel::timelineModel(int index) const +int QmlProfilerNotesModel::timelineModel(int index) const { return m_data[index].timelineModel; } -int NotesModel::timelineIndex(int index) const +int QmlProfilerNotesModel::timelineIndex(int index) const { return m_data[index].timelineIndex; } -QVariantList NotesModel::byTypeId(int selectedType) const +QVariantList QmlProfilerNotesModel::byTypeId(int selectedType) const { QVariantList ret; for (int noteId = 0; noteId < count(); ++noteId) { @@ -87,7 +88,7 @@ QVariantList NotesModel::byTypeId(int selectedType) const return ret; } -QVariantList NotesModel::byTimelineModel(int timelineModel) const +QVariantList QmlProfilerNotesModel::byTimelineModel(int timelineModel) const { QVariantList ret; for (int noteId = 0; noteId < count(); ++noteId) { @@ -97,7 +98,7 @@ QVariantList NotesModel::byTimelineModel(int timelineModel) const return ret; } -int NotesModel::get(int timelineModel, int timelineIndex) const +int QmlProfilerNotesModel::get(int timelineModel, int timelineIndex) const { for (int noteId = 0; noteId < count(); ++noteId) { const Note ¬e = m_data[noteId]; @@ -108,7 +109,7 @@ int NotesModel::get(int timelineModel, int timelineIndex) const return -1; } -int NotesModel::add(int timelineModel, int timelineIndex, const QString &text) +int QmlProfilerNotesModel::add(int timelineModel, int timelineIndex, const QString &text) { const AbstractTimelineModel *model = m_timelineModels[timelineModel]; int typeId = model->range(timelineIndex).typeId; @@ -119,7 +120,7 @@ int NotesModel::add(int timelineModel, int timelineIndex, const QString &text) return m_data.count() - 1; } -void NotesModel::update(int index, const QString &text) +void QmlProfilerNotesModel::update(int index, const QString &text) { Note ¬e = m_data[index]; if (text != note.text) { @@ -129,7 +130,7 @@ void NotesModel::update(int index, const QString &text) } } -void NotesModel::remove(int index) +void QmlProfilerNotesModel::remove(int index) { Note ¬e = m_data[index]; int noteType = typeId(index); @@ -140,12 +141,12 @@ void NotesModel::remove(int index) emit changed(noteType, timelineModel, timelineIndex); } -bool NotesModel::isModified() const +bool QmlProfilerNotesModel::isModified() const { return m_modified; } -void NotesModel::removeTimelineModel(QObject *timelineModel) +void QmlProfilerNotesModel::removeTimelineModel(QObject *timelineModel) { for (auto i = m_timelineModels.begin(); i != m_timelineModels.end();) { if (i.value() == timelineModel) @@ -155,7 +156,7 @@ void NotesModel::removeTimelineModel(QObject *timelineModel) } } -int NotesModel::add(int typeId, qint64 start, qint64 duration, const QString &text) +int QmlProfilerNotesModel::add(int typeId, qint64 start, qint64 duration, const QString &text) { int timelineModel = -1; int timelineIndex = -1; @@ -188,14 +189,14 @@ int NotesModel::add(int typeId, qint64 start, qint64 duration, const QString &te return m_data.count() - 1; } -void NotesModel::clear() +void QmlProfilerNotesModel::clear() { m_data.clear(); m_modified = false; emit changed(-1, -1, -1); } -void NotesModel::loadData() +void QmlProfilerNotesModel::loadData() { m_data.clear(); const QVector<QmlProfilerDataModel::QmlEventNoteData> ¬es = @@ -208,7 +209,7 @@ void NotesModel::loadData() emit changed(-1, -1, -1); } -void NotesModel::saveData() +void QmlProfilerNotesModel::saveData() { QVector<QmlProfilerDataModel::QmlEventNoteData> notes; for (int i = 0; i < count(); ++i) { diff --git a/src/plugins/qmlprofiler/notesmodel.h b/src/plugins/qmlprofiler/qmlprofilernotesmodel.h similarity index 96% rename from src/plugins/qmlprofiler/notesmodel.h rename to src/plugins/qmlprofiler/qmlprofilernotesmodel.h index 0722e4ef8a4f12caabcf9da7e4d2c9df417d6190..65f331fb4c0806165a5108fdf5ff7887e12eab53 100644 --- a/src/plugins/qmlprofiler/notesmodel.h +++ b/src/plugins/qmlprofiler/qmlprofilernotesmodel.h @@ -37,7 +37,7 @@ #include <QHash> namespace QmlProfiler { -class QMLPROFILER_EXPORT NotesModel : public QObject { +class QMLPROFILER_EXPORT QmlProfilerNotesModel : public QObject { Q_OBJECT public: struct Note { @@ -49,7 +49,7 @@ public: int timelineIndex; }; - NotesModel(QObject *parent); + QmlProfilerNotesModel(QObject *parent); int count() const; void setModelManager(QmlProfilerModelManager *modelManager); diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp similarity index 83% rename from src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp rename to src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp index da9fec71a95609abaad1e119aee44b02b432cbc7..552c17c86a6179943739924dcd5e29ef75ce4589 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp @@ -28,7 +28,7 @@ ** ****************************************************************************/ -#include "qmlprofilertimelinemodelproxy.h" +#include "qmlprofilerrangemodel.h" #include "qmlprofilermodelmanager.h" #include "qmlprofilerdatamodel.h" #include "abstracttimelinemodel_p.h" @@ -45,7 +45,7 @@ namespace QmlProfiler { namespace Internal { -class RangeTimelineModel::RangeTimelineModelPrivate : public AbstractTimelineModelPrivate +class QmlProfilerRangeModel::QmlProfilerRangeModelPrivate : public AbstractTimelineModelPrivate { public: // convenience functions @@ -56,35 +56,35 @@ public: QVector<QmlRangeEventStartInstance> data; QVector<int> expandedRowTypes; private: - Q_DECLARE_PUBLIC(RangeTimelineModel) + Q_DECLARE_PUBLIC(QmlProfilerRangeModel) }; -RangeTimelineModel::RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *parent) - : AbstractTimelineModel(new RangeTimelineModelPrivate, categoryLabel(rangeType), +QmlProfilerRangeModel::QmlProfilerRangeModel(QmlDebug::RangeType rangeType, QObject *parent) + : AbstractTimelineModel(new QmlProfilerRangeModelPrivate, categoryLabel(rangeType), QmlDebug::MaximumMessage, rangeType, parent) { - Q_D(RangeTimelineModel); + Q_D(QmlProfilerRangeModel); d->expandedRowTypes << -1; } -quint64 RangeTimelineModel::features() const +quint64 QmlProfilerRangeModel::features() const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); return 1ULL << QmlDebug::featureFromRangeType(d->rangeType); } -void RangeTimelineModel::clear() +void QmlProfilerRangeModel::clear() { - Q_D(RangeTimelineModel); + Q_D(QmlProfilerRangeModel); d->expandedRowTypes.clear(); d->expandedRowTypes << -1; d->data.clear(); AbstractTimelineModel::clear(); } -void RangeTimelineModel::loadData() +void QmlProfilerRangeModel::loadData() { - Q_D(RangeTimelineModel); + Q_D(QmlProfilerRangeModel); clear(); QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel(); if (simpleModel->isEmpty()) @@ -126,9 +126,9 @@ void RangeTimelineModel::loadData() d->modelManager->modelProxyCountUpdated(d->modelId, 1, 1); } -void RangeTimelineModel::RangeTimelineModelPrivate::computeNestingContracted() +void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeNestingContracted() { - Q_Q(RangeTimelineModel); + Q_Q(QmlProfilerRangeModel); int i; int eventCount = q->count(); @@ -157,9 +157,9 @@ void RangeTimelineModel::RangeTimelineModelPrivate::computeNestingContracted() } } -void RangeTimelineModel::RangeTimelineModelPrivate::computeExpandedLevels() +void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeExpandedLevels() { - Q_Q(RangeTimelineModel); + Q_Q(QmlProfilerRangeModel); QHash<int, int> eventRow; int eventCount = q->count(); for (int i = 0; i < eventCount; i++) { @@ -173,9 +173,9 @@ void RangeTimelineModel::RangeTimelineModelPrivate::computeExpandedLevels() expandedRowCount = expandedRowTypes.size(); } -void RangeTimelineModel::RangeTimelineModelPrivate::findBindingLoops() +void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::findBindingLoops() { - Q_Q(RangeTimelineModel); + Q_Q(QmlProfilerRangeModel); if (rangeType != QmlDebug::Binding && rangeType != QmlDebug::HandlingSignal) return; @@ -210,35 +210,35 @@ void RangeTimelineModel::RangeTimelineModelPrivate::findBindingLoops() /////////////////// QML interface -QString RangeTimelineModel::categoryLabel(QmlDebug::RangeType rangeType) +QString QmlProfilerRangeModel::categoryLabel(QmlDebug::RangeType rangeType) { return QCoreApplication::translate("MainView", QmlProfilerModelManager::featureName(QmlDebug::featureFromRangeType(rangeType))); } -int RangeTimelineModel::row(int index) const +int QmlProfilerRangeModel::row(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); if (d->expanded) return d->data[index].displayRowExpanded; else return d->data[index].displayRowCollapsed; } -int RangeTimelineModel::bindingLoopDest(int index) const +int QmlProfilerRangeModel::bindingLoopDest(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); return d->data[index].bindingLoopHead; } -QColor RangeTimelineModel::color(int index) const +QColor QmlProfilerRangeModel::color(int index) const { return colorBySelectionId(index); } -QVariantList RangeTimelineModel::labels() const +QVariantList QmlProfilerRangeModel::labels() const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); QVariantList result; if (d->expanded && !d->hidden) { @@ -257,9 +257,9 @@ QVariantList RangeTimelineModel::labels() const return result; } -QVariantMap RangeTimelineModel::details(int index) const +QVariantMap QmlProfilerRangeModel::details(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); QVariantMap result; int id = selectionId(index); const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = @@ -273,9 +273,9 @@ QVariantMap RangeTimelineModel::details(int index) const return result; } -QVariantMap RangeTimelineModel::location(int index) const +QVariantMap QmlProfilerRangeModel::location(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); QVariantMap result; int id = selectionId(index); @@ -289,9 +289,9 @@ QVariantMap RangeTimelineModel::location(int index) const return result; } -bool RangeTimelineModel::isSelectionIdValid(int typeId) const +bool QmlProfilerRangeModel::isSelectionIdValid(int typeId) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); if (typeId < 0) return false; const QmlProfilerDataModel::QmlEventTypeData &type = @@ -301,9 +301,9 @@ bool RangeTimelineModel::isSelectionIdValid(int typeId) const return true; } -int RangeTimelineModel::selectionIdForLocation(const QString &filename, int line, int column) const +int QmlProfilerRangeModel::selectionIdForLocation(const QString &filename, int line, int column) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); // if this is called from v8 view, we don't have the column number, it will be -1 const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = d->modelManager->qmlModel()->getEventTypes(); diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h similarity index 89% rename from src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h rename to src/plugins/qmlprofiler/qmlprofilerrangemodel.h index 746208df91cb8edede85b4f07ae32a5cb1227e12..841a6089f0d7a945b70cf9699418535f40caef78 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h +++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h @@ -29,8 +29,8 @@ ****************************************************************************/ -#ifndef QMLPROFILERTIMELINEMODELPROXY_H -#define QMLPROFILERTIMELINEMODELPROXY_H +#ifndef QMLPROFILERRANGEMODEL_H +#define QMLPROFILERRANGEMODEL_H #include "abstracttimelinemodel.h" #include <qmldebug/qmlprofilereventtypes.h> @@ -44,7 +44,7 @@ class QmlProfilerModelManager; namespace Internal { -class RangeTimelineModel : public AbstractTimelineModel +class QmlProfilerRangeModel : public AbstractTimelineModel { Q_OBJECT public: @@ -61,7 +61,7 @@ public: int bindingLoopHead; }; - RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *parent = 0); + QmlProfilerRangeModel(QmlDebug::RangeType rangeType, QObject *parent = 0); static QString categoryLabel(QmlDebug::RangeType categoryIndex); quint64 features() const; @@ -82,11 +82,11 @@ protected: void clear(); private: - class RangeTimelineModelPrivate; - Q_DECLARE_PRIVATE(RangeTimelineModel) + class QmlProfilerRangeModelPrivate; + Q_DECLARE_PRIVATE(QmlProfilerRangeModel) }; } } -#endif +#endif // QMLPROFILERRANGEMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 5da9e75a7d451f44c158088375bb9291ea86a5ee..8758d7b81b1bf3a57b20877f6b8666d5b41277ee 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -38,7 +38,7 @@ #include "qmlprofilermodelmanager.h" #include "qmlprofilerdetailsrewriter.h" #include "timelinerenderer.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include <analyzerbase/analyzermanager.h> #include <analyzerbase/analyzerruncontrol.h> diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index bc1d4b1ebb3cec10555baa18bfcac32e4bc56f76..93f54804a6ddc53c6c772c2b8ab360d0f2008147 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -32,7 +32,6 @@ #include "qmlprofilertool.h" #include "qmlprofilerstatemanager.h" #include "qmlprofilermodelmanager.h" -#include "qmlprofilertimelinemodelproxy.h" #include "timelinemodelaggregator.h" // Needed for the load&save actions in the context menu diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp index b2270d4fef79aaa61e58d8a9ece8662721358739..8300b327190fb49208608229bc409b5237afcc4c 100644 --- a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp +++ b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp @@ -30,10 +30,10 @@ #include "timelinemodelaggregator.h" -#include "qmlprofilertimelinemodelproxy.h" -#include "qmlprofilerpainteventsmodelproxy.h" +#include "qmlprofilerrangemodel.h" +#include "qmlprofileranimationsmodel.h" #include "qmlprofilerplugin.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include <QStringList> #include <QVariant> @@ -85,12 +85,12 @@ void TimelineModelAggregator::setModelManager(QmlProfilerModelManager *modelMana addModel(timelineModel); } - PaintEventsModelProxy *paintEventsModelProxy = new PaintEventsModelProxy(this); + QmlProfilerAnimationsModel *paintEventsModelProxy = new QmlProfilerAnimationsModel(this); paintEventsModelProxy->setModelManager(modelManager); addModel(paintEventsModelProxy); for (int i = 0; i < QmlDebug::MaximumRangeType; ++i) { - RangeTimelineModel *rangeModel = new RangeTimelineModel((QmlDebug::RangeType)i, this); + QmlProfilerRangeModel *rangeModel = new QmlProfilerRangeModel((QmlDebug::RangeType)i, this); rangeModel->setModelManager(modelManager); addModel(rangeModel); } @@ -133,7 +133,7 @@ int TimelineModelAggregator::modelIndexFromManagerIndex(int modelManagerIndex) c return d->modelManagerIndexMapping[modelManagerIndex]; } -NotesModel *TimelineModelAggregator::notes() const +QmlProfilerNotesModel *TimelineModelAggregator::notes() const { return d->modelManager->notesModel(); } @@ -334,7 +334,7 @@ void TimelineModelAggregator::setNoteText(int noteId, const QString &text) void TimelineModelAggregator::setNoteText(int modelIndex, int index, const QString &text) { int managerId = d->modelList[modelIndex]->modelId(); - NotesModel *notesModel = notes(); + QmlProfilerNotesModel *notesModel = notes(); int noteId = notesModel->get(managerId, index); if (noteId == -1) { if (text.length() > 0) diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.h b/src/plugins/qmlprofiler/timelinemodelaggregator.h index 4896ccf26902ef6e45d856ce56fb082367fcde83..7b63ff90da2b0b62d292b1faa7f4bd2c13ff5a80 100644 --- a/src/plugins/qmlprofiler/timelinemodelaggregator.h +++ b/src/plugins/qmlprofiler/timelinemodelaggregator.h @@ -53,7 +53,7 @@ public: QVariantList models() const; int modelIndexFromManagerIndex(int modelManagerIndex) const; - Q_INVOKABLE NotesModel *notes() const; + Q_INVOKABLE QmlProfilerNotesModel *notes() const; Q_INVOKABLE int count(int modelIndex) const; void clear(); Q_INVOKABLE int modelCount() const; diff --git a/src/plugins/qmlprofiler/timelinerenderer.cpp b/src/plugins/qmlprofiler/timelinerenderer.cpp index 31ffc1afaaa6fa08245a875102759f65b9a49cb3..124eca0351cc1be56121ca0d8c9b09c6c43fe374 100644 --- a/src/plugins/qmlprofiler/timelinerenderer.cpp +++ b/src/plugins/qmlprofiler/timelinerenderer.cpp @@ -29,7 +29,7 @@ ****************************************************************************/ #include "timelinerenderer.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include <QQmlContext> #include <QQmlProperty> @@ -365,7 +365,7 @@ void TimelineRenderer::drawNotes(QPainter *p) static const int annotationSpace = 4; static const int shadowOffset = 2; - NotesModel *notes = m_profilerModelProxy->notes(); + QmlProfilerNotesModel *notes = m_profilerModelProxy->notes(); for (int i = 0; i < notes->count(); ++i) { int managerIndex = notes->timelineModel(i); if (managerIndex == -1) diff --git a/src/plugins/qmlprofiler/timelinerenderer.h b/src/plugins/qmlprofiler/timelinerenderer.h index d2b56865b8361a8212c1f5c88c4a75874a12f54b..684a3d69470124b1d03de76112944d29f0ca33e9 100644 --- a/src/plugins/qmlprofiler/timelinerenderer.h +++ b/src/plugins/qmlprofiler/timelinerenderer.h @@ -33,7 +33,6 @@ #include <QQuickPaintedItem> #include <QJSValue> -#include "qmlprofilertimelinemodelproxy.h" #include "timelinezoomcontrol.h" #include "timelinemodelaggregator.h"