forked from qt-creator/qt-creator
QmlProfiler: Add extra metadata to notes
This way we can improve the heuristic used for mapping notes to timeline events, by taking the row into account. Also, by marking notes as loaded when loading them we avoid accidentally dropping them by restricting to ranges. Change-Id: I031389880571805788c910728ee89333a5cd4727 Task-number: QTCREATORBUG-16542 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
@@ -32,26 +32,32 @@ namespace QmlProfiler {
|
||||
class QmlNote {
|
||||
|
||||
public:
|
||||
QmlNote(int typeIndex = -1, qint64 startTime = -1, qint64 duration = 0,
|
||||
QmlNote(int typeIndex = -1, int collapsedRow = -1, qint64 startTime = -1, qint64 duration = 0,
|
||||
const QString &text = QString()) :
|
||||
m_typeIndex(typeIndex), m_startTime(startTime), m_duration(duration), m_text(text)
|
||||
m_typeIndex(typeIndex), m_collapsedRow(collapsedRow), m_startTime(startTime),
|
||||
m_duration(duration), m_text(text), m_loaded(false)
|
||||
{}
|
||||
|
||||
int typeIndex() const { return m_typeIndex; }
|
||||
int collapsedRow() const { return m_collapsedRow; }
|
||||
qint64 startTime() const { return m_startTime; }
|
||||
qint64 duration() const { return m_duration; }
|
||||
QString text() const { return m_text; }
|
||||
bool loaded() const { return m_loaded; }
|
||||
|
||||
void setText(const QString &text) { m_text = text; }
|
||||
void setLoaded(bool loaded) { m_loaded = loaded; }
|
||||
|
||||
private:
|
||||
friend QDataStream &operator>>(QDataStream &stream, QmlNote ¬e);
|
||||
friend QDataStream &operator<<(QDataStream &stream, const QmlNote ¬e);
|
||||
|
||||
int m_typeIndex;
|
||||
int m_collapsedRow;
|
||||
qint64 m_startTime;
|
||||
qint64 m_duration;
|
||||
QString m_text;
|
||||
bool m_loaded;
|
||||
};
|
||||
|
||||
bool operator==(const QmlNote ¬e1, const QmlNote ¬e2);
|
||||
|
||||
Reference in New Issue
Block a user