QmlProfiler: add functionality to search for notes

Added a text field to search for notes within the timeline's events.

Task-number: QTCREATORBUG-13417
Change-Id: Ic121ec8ade42b1ef99d5da13d1f732761d244327
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
This commit is contained in:
Joerg Bornemann
2015-01-30 16:52:11 +01:00
parent 4caee9fcbf
commit 1d14dbf1aa
7 changed files with 111 additions and 0 deletions

View File

@@ -123,6 +123,8 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT
d->m_modelProxy = new Timeline::TimelineModelAggregator(modelManager->notesModel(), this);
d->m_modelManager = modelManager;
connect(qobject_cast<QmlProfilerTool *>(profilerTool), &QmlProfilerTool::selectTimelineElement,
this, &QmlProfilerTraceView::selectByEventIndex);
connect(modelManager,SIGNAL(dataAvailable()), d->m_modelProxy,SIGNAL(dataAvailable()));
// external models pushed on top
@@ -218,6 +220,19 @@ void QmlProfilerTraceView::selectBySourceLocation(const QString &filename, int l
}
}
void QmlProfilerTraceView::selectByEventIndex(int modelId, int eventIndex)
{
QQuickItem *rootObject = d->m_mainView->rootObject();
if (!rootObject)
return;
const int modelIndex = d->m_modelProxy->modelIndexById(modelId);
QTC_ASSERT(modelIndex != -1, return);
QMetaObject::invokeMethod(rootObject, "selectByIndices",
Q_ARG(QVariant, QVariant(modelIndex)),
Q_ARG(QVariant, QVariant(eventIndex)));
}
/////////////////////////////////////////////////////////
// Goto source location
void QmlProfilerTraceView::updateCursorPosition()