1 #include "profiledialog.h"
2 #include "profiletablemodel.h"
3 #include <QSortFilterProxyModel>
5 ProfileDialog::ProfileDialog(QWidget *parent)
11 connect(m_timeline, SIGNAL(jumpToCall(int)), SIGNAL(jumpToCall(int)));
12 connect(m_timeline, SIGNAL(selectionChanged(int64_t,int64_t)), SLOT(selectionChanged(int64_t,int64_t)));
16 ProfileDialog::~ProfileDialog()
22 void ProfileDialog::tableDoubleClicked(const QModelIndex& index)
24 ProfileTableModel* model = (ProfileTableModel*)m_table->model();
25 const trace::Profile::Call* call = model->getJumpCall(index);
28 emit jumpToCall(call->no);
33 void ProfileDialog::setProfile(trace::Profile* profile)
40 m_timeline->setProfile(m_profile);
42 ProfileTableModel* model = new ProfileTableModel(m_table);
43 model->setProfile(m_profile);
45 delete m_table->model();
46 m_table->setModel(model);
47 m_table->resizeColumnsToContents();
48 m_table->sortByColumn(2, Qt::DescendingOrder);
52 void ProfileDialog::selectionChanged(int64_t start, int64_t end)
54 ProfileTableModel* model = (ProfileTableModel*)m_table->model();
55 model->setTimeSelection(start, end);
60 void ProfileDialog::setVerticalScrollMax(int max)
63 m_verticalScrollBar->hide();
65 m_verticalScrollBar->show();
66 m_verticalScrollBar->setMinimum(0);
67 m_verticalScrollBar->setMaximum(max);
72 void ProfileDialog::setHorizontalScrollMax(int max)
75 m_horizontalScrollBar->hide();
77 m_horizontalScrollBar->show();
78 m_horizontalScrollBar->setMinimum(0);
79 m_horizontalScrollBar->setMaximum(max);
83 #include "profiledialog.moc"