QmlProfiler: Load the timeline model data event by event

All the models do the same thing when loading the data: They iterate
the list of events, determine for each one if they accept it, and if
so, they load it. After the list has been fully loaded, they do some
finalization. This can be centralized, and ultimately we won't need to
expose the central QVector<QmlEvent> for that anymore.

Change-Id: Ia82facfdc3968200bbec323a02f2fcc02ac44e9e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Ulf Hermann
2016-04-26 13:23:35 +02:00
parent 67378a7928
commit 5ba6f04d4b
16 changed files with 460 additions and 496 deletions

View File

@@ -64,16 +64,18 @@ public:
QVariantList labels() const;
QVariantMap details(int index) const;
bool accepted(const QmlEventType &event) const;
protected:
void loadData();
void clear();
bool accepted(const QmlEventType &event) const override;
void loadEvent(const QmlEvent &event, const QmlEventType &type) override;
void finalize() override;
void clear() override;
private:
QVector<QmlProfilerAnimationsModel::QmlPaintEventData> m_data;
int m_maxGuiThreadAnimations;
int m_maxRenderThreadAnimations;
int m_maxGuiThreadAnimations = 0;
int m_maxRenderThreadAnimations = 0;
qint64 m_minNextStartTimes[2] = {0, 0};
int rowFromThreadId(int threadId) const;
};