QmlProfiler: linking JS events with QML events

Change-Id: Id2f37caef0c62fa8fa830fed8f46dcbb0a565cdb
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2011-12-14 14:30:37 +01:00
parent 5798225cc8
commit eef3d91ea1
3 changed files with 22 additions and 0 deletions

View File

@@ -181,6 +181,11 @@ void QmlProfilerEventsWidget::updateSelectedEvent(int eventId) const
m_eventTree->selectEvent(eventId);
}
void QmlProfilerEventsWidget::selectBySourceLocation(const QString &filename, int line)
{
m_eventTree->selectEventByLocation(filename, line);
}
bool QmlProfilerEventsWidget::hasGlobalStats() const
{
return m_globalStatsEnabled;
@@ -589,6 +594,18 @@ void QmlProfilerEventsMainView::selectEvent(int eventId)
}
}
void QmlProfilerEventsMainView::selectEventByLocation(const QString &filename, int line)
{
for (int i=0; i<d->m_model->rowCount(); i++) {
QStandardItem *infoItem = d->m_model->item(i, 0);
if (currentIndex() != d->m_model->indexFromItem(infoItem) && infoItem->data(FilenameRole).toString() == filename && infoItem->data(LineRole).toInt() == line) {
setCurrentIndex(d->m_model->indexFromItem(infoItem));
jumpToItem(currentIndex());
return;
}
}
}
QModelIndex QmlProfilerEventsMainView::selectedItem() const
{
QModelIndexList sel = selectedIndexes();