summaryrefslogtreecommitdiff
path: root/src/plugins/qmlprofiler/qmlprofilereventview.h
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@digia.com>2013-08-08 13:28:08 +0200
committerChristiaan Janssen <christiaan.janssen@digia.com>2013-08-09 17:19:32 +0200
commit0a3b20f5f99bec75b590aa81ae26aac046efd794 (patch)
tree13cdc00fe9b5a3e5c91cba19950ff4d788ee42f8 /src/plugins/qmlprofiler/qmlprofilereventview.h
parent7764f35107e901e74458847315ffd114199ce26c (diff)
downloadqt-creator-0a3b20f5f99bec75b590aa81ae26aac046efd794.tar.gz
QmlProfiler: reworked
Change-Id: I66a236a024d76e7bef6edfb91ae30b5dd098b76b Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilereventview.h')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilereventview.h96
1 files changed, 29 insertions, 67 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.h b/src/plugins/qmlprofiler/qmlprofilereventview.h
index 2dd0145c2e..747cc613d3 100644
--- a/src/plugins/qmlprofiler/qmlprofilereventview.h
+++ b/src/plugins/qmlprofiler/qmlprofilereventview.h
@@ -33,7 +33,9 @@
#include <QTreeView>
#include <QStandardItemModel>
#include <qmldebug/qmlprofilereventtypes.h>
-#include "qmlprofilerdatamodel.h"
+#include "qmlprofilermodelmanager.h"
+#include "qmlprofilereventsmodelproxy.h"
+#include "qmlprofilertreeview.h"
#include <analyzerbase/ianalyzertool.h>
@@ -43,7 +45,8 @@ namespace QmlProfiler {
namespace Internal {
class QmlProfilerEventsMainView;
-class QmlProfilerEventsParentsAndChildrenView;
+class QmlProfilerEventChildrenView;
+class QmlProfilerEventRelativesView;
enum ItemRole {
EventHashStrRole = Qt::UserRole+1,
@@ -60,10 +63,9 @@ public:
explicit QmlProfilerEventsWidget(QWidget *parent,
QmlProfilerTool *profilerTool,
QmlProfilerViewManager *container,
- QmlProfilerDataModel *profilerDataModel );
+ QmlProfilerModelManager *profilerModelManager );
~QmlProfilerEventsWidget();
- void switchToV8View();
void clear();
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
@@ -76,16 +78,14 @@ public:
void setShowExtendedStatistics(bool show);
bool showExtendedStatistics() const;
- bool isQml() const;
- bool isV8() const;
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
- void showEventInTimeline(int eventId);
+ void eventSelectedByHash(const QString &eventHash);
void resized();
public slots:
- void updateSelectedEvent(int eventId) const;
+ void updateSelectedEvent(const QString &eventHash) const;
void selectBySourceLocation(const QString &filename, int line, int column);
private slots:
@@ -100,44 +100,15 @@ private:
QmlProfilerEventsWidgetPrivate *d;
};
-class QmlProfilerEventsMainView : public QTreeView
+class QmlProfilerEventsMainView : public QmlProfilerTreeView
{
Q_OBJECT
public:
- enum Fields {
- Name,
- Type,
- Percent,
- TotalDuration,
- SelfPercent,
- SelfDuration,
- CallCount,
- TimePerCall,
- MaxTime,
- MinTime,
- MedianTime,
- Details,
-
- MaxFields
- };
-
- enum ViewTypes {
- EventsView,
- CallersView,
- CalleesView,
- V8ProfileView,
-
- MaxViewTypes
- };
-
- explicit QmlProfilerEventsMainView(ViewTypes viewType,
- QWidget *parent,
- QmlProfilerDataModel *dataModel);
+ explicit QmlProfilerEventsMainView(QWidget *parent,
+ QmlProfilerEventsModelProxy *modelProxy);
~QmlProfilerEventsMainView();
void setFieldViewable(Fields field, bool show);
- void setViewType(ViewTypes type);
- ViewTypes viewType() const;
void setShowAnonymousEvents( bool showThem );
QModelIndex selectedItem() const;
@@ -148,30 +119,30 @@ public:
static QString nameForType(int typeNumber);
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
- bool isRangeGlobal(qint64 rangeStart, qint64 rangeEnd) const;
- int selectedEventId() const;
+// int selectedEventId() const;
+ QString selectedEventHash() const;
void setShowExtendedStatistics(bool);
bool showExtendedStatistics() const;
+
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
- void eventSelected(int eventId);
- void showEventInTimeline(int eventId);
+ void eventSelected(const QString &eventHash);
public slots:
void clear();
void jumpToItem(const QModelIndex &index);
- void selectEvent(int eventId);
- void selectEventByLocation(const QString &filename, int line);
+ void selectEvent(const QString &eventHash);
+ void selectEventByLocation(const QString &filename, int line, int column);
void buildModel();
- void changeDetailsForEvent(int eventId, const QString &newString);
private slots:
void profilerDataModelStateChanged();
private:
void setHeaderLabels();
+ void parseModelProxy();
private:
class QmlProfilerEventsMainViewPrivate;
@@ -179,40 +150,31 @@ private:
};
-class QmlProfilerEventsParentsAndChildrenView : public QTreeView
+class QmlProfilerEventRelativesView : public QmlProfilerTreeView
{
Q_OBJECT
public:
- enum SubViewType {
- ParentsView,
- ChildrenView,
- V8ParentsView,
- V8ChildrenView,
- MaxSubtableTypes
- };
-
- explicit QmlProfilerEventsParentsAndChildrenView(SubViewType subtableType,
- QWidget *parent,
- QmlProfilerDataModel *model);
- ~QmlProfilerEventsParentsAndChildrenView();
-
- void setViewType(SubViewType type);
+ explicit QmlProfilerEventRelativesView(QmlProfilerModelManager *modelManager,
+ QmlProfilerEventRelativesModelProxy *modelProxy,
+ QWidget *parent );
+ ~QmlProfilerEventRelativesView();
signals:
- void eventClicked(int eventId);
+ void eventClicked(const QString &eventHash);
public slots:
- void displayEvent(int eventId);
+ void displayEvent(const QString &eventHash);
void jumpToItem(const QModelIndex &);
void clear();
private:
- void rebuildTree(void *profilerDataModel);
+ void rebuildTree(QmlProfilerEventParentsModelProxy::QmlEventRelativesMap eventMap);
void updateHeader();
QStandardItemModel *treeModel();
- QmlProfilerDataModel *m_profilerDataModel;
+// QmlProfilerModelManager *m_profilerModelManager;
- SubViewType m_subtableType;
+ class QmlProfilerEventParentsViewPrivate;
+ QmlProfilerEventParentsViewPrivate *d;
};
} // namespace Internal