forked from qt-creator/qt-creator
QmlProfiler: linking JS events with QML events
Change-Id: Id2f37caef0c62fa8fa830fed8f46dcbb0a565cdb Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user