summaryrefslogtreecommitdiff
path: root/src/plugins/qmlprofiler/qmlprofilereventview.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-06-13 16:34:30 +0200
committerUlf Hermann <ulf.hermann@digia.com>2014-06-17 16:26:06 +0200
commitfea6580c82936cbeec69038f9184f30944e659c8 (patch)
treee93922d57619b0e01d198c59365ab45d08a91bf3 /src/plugins/qmlprofiler/qmlprofilereventview.h
parentb0d79542b858e0089b42f7b8c810d476a4a6b80e (diff)
downloadqt-creator-fea6580c82936cbeec69038f9184f30944e659c8.tar.gz
QmlProfiler: get rid of hash strings
Using strings to identify equal events is terribly inefficient. By keeping a global list of event types we can assign each event a numerical type index and use that to compare them. We can also avoid excessive string copying and data duplication by referring to the global type list where event type information is needed. Task-number: QTCREATORBUG-11823 Change-Id: I837bd5d0f5395b0003002ef8dd278fb27679c65d Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilereventview.h')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilereventview.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.h b/src/plugins/qmlprofiler/qmlprofilereventview.h
index 22ee7cdd95..95651d9b6d 100644
--- a/src/plugins/qmlprofiler/qmlprofilereventview.h
+++ b/src/plugins/qmlprofiler/qmlprofilereventview.h
@@ -48,7 +48,7 @@ class QmlProfilerEventChildrenView;
class QmlProfilerEventRelativesView;
enum ItemRole {
- EventHashStrRole = Qt::UserRole+1,
+ EventTypeIndexRole = Qt::UserRole+1,
FilenameRole = Qt::UserRole+2,
LineRole = Qt::UserRole+3,
ColumnRole = Qt::UserRole+4,
@@ -85,11 +85,11 @@ public:
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
- void eventSelectedByHash(const QString &eventHash);
+ void eventSelectedByTypeIndex(int typeIndex);
void resized();
public slots:
- void updateSelectedEvent(const QString &eventHash) const;
+ void updateSelectedEvent(int typeIndex) const;
void selectBySourceLocation(const QString &filename, int line, int column);
private slots:
@@ -122,7 +122,7 @@ public:
static QString nameForType(QmlDebug::RangeType typeNumber);
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
- QString selectedEventHash() const;
+ int selectedTypeIndex() const;
void setShowExtendedStatistics(bool);
bool showExtendedStatistics() const;
@@ -130,12 +130,12 @@ public:
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
- void eventSelected(const QString &eventHash);
+ void eventSelected(int typeIndex);
public slots:
void clear();
void jumpToItem(const QModelIndex &index);
- void selectEvent(const QString &eventHash);
+ void selectEvent(int typeIndex);
void selectEventByLocation(const QString &filename, int line, int column);
void buildModel();
@@ -163,15 +163,15 @@ public:
~QmlProfilerEventRelativesView();
signals:
- void eventClicked(const QString &eventHash);
+ void eventClicked(int typeIndex);
public slots:
- void displayEvent(const QString &eventHash);
+ void displayEvent(int typeIndex);
void jumpToItem(const QModelIndex &);
void clear();
private:
- void rebuildTree(QmlProfilerEventParentsModelProxy::QmlEventRelativesMap eventMap);
+ void rebuildTree(const QmlProfilerEventParentsModelProxy::QmlEventRelativesMap &eventMap);
void updateHeader();
QStandardItemModel *treeModel();