forked from qt-creator/qt-creator
QmlProfiler: Sanitize the signal exchange between models a bit
The model manager should only set its state to 'Done' if all models are actually done. When that is the case it can safely emit dataAvailable, too, freeing us of the need to apply a heuristic to the progress percentage. In order to have a unified interface to the completion of model processing an abstract base class for QML and V8 models is introduced. Task-number: QTCREATORBUG-11466 Change-Id: Id89c7ef5e24004baab7f37ee5486b69e7611aee0 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#define QMLPROFILERSIMPLEMODEL_H
|
||||
|
||||
#include "qmlprofiler_global.h"
|
||||
#include "qmlprofilerbasemodel.h"
|
||||
|
||||
#include <qmldebug/qmlprofilereventlocation.h>
|
||||
|
||||
@@ -43,7 +44,7 @@ namespace QmlProfiler {
|
||||
class QmlProfilerModelManager;
|
||||
|
||||
// stores the data from the client as-is
|
||||
class QMLPROFILER_EXPORT QmlProfilerSimpleModel : public QObject
|
||||
class QMLPROFILER_EXPORT QmlProfilerSimpleModel : public QmlProfilerBaseModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -62,7 +63,7 @@ public:
|
||||
qint64 numericData5;
|
||||
};
|
||||
|
||||
explicit QmlProfilerSimpleModel(QObject *parent = 0);
|
||||
explicit QmlProfilerSimpleModel(QmlProfilerModelManager *parent);
|
||||
~QmlProfilerSimpleModel();
|
||||
|
||||
virtual void clear();
|
||||
@@ -72,17 +73,11 @@ public:
|
||||
void addQmlEvent(int type, int bindingType, qint64 startTime, qint64 duration, const QStringList &data, const QmlDebug::QmlEventLocation &location,
|
||||
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
|
||||
qint64 lastTimeMark() const;
|
||||
virtual void complete();
|
||||
|
||||
static QString getHashString(const QmlProfilerSimpleModel::QmlEventData &event);
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
protected:
|
||||
QVector<QmlEventData> eventList;
|
||||
QmlProfilerModelManager *m_modelManager;
|
||||
int m_modelId;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user