1 #ifndef PROFILETABLEMODEL_H
2 #define PROFILETABLEMODEL_H
4 #include <QAbstractTableModel>
5 #include "trace_profiler.hpp"
9 ProfileTableRow(unsigned no)
27 const trace::Profile::Call* longestGpu;
28 const trace::Profile::Call* longestCpu;
29 const trace::Profile::Call* longestPixel;
32 class ProfileTableModel : public QAbstractTableModel
37 ProfileTableModel(QObject *parent = NULL);
39 void setProfile(trace::Profile* profile);
42 void selectProgram(unsigned program);
43 void selectTime(int64_t start, int64_t end);
45 int getRowIndex(unsigned program) const;
46 unsigned getProgram(const QModelIndex & index) const;
47 const trace::Profile::Call* getJumpCall(const QModelIndex & index) const;
49 virtual int rowCount(const QModelIndex & parent) const;
50 virtual int columnCount(const QModelIndex & parent) const;
52 virtual QVariant data(const QModelIndex &index, int role) const;
53 virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
55 virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
59 ProfileTableRow* getRow(unsigned program);
62 QList<ProfileTableRow> m_rowData;
63 trace::Profile *m_profile;
67 Qt::SortOrder m_sortOrder;
70 #endif // PROFILEMODEL_H