From 832e2b8d39628c54e1b6f28333b8c6cd649fdb61 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Wed, 10 Jul 2013 16:47:16 +0200 Subject: QmlProfiler: link views when selecting event Change-Id: I4dbb09d459e033fae2fceb24ab5e4b0e7de38179 Reviewed-by: Kai Koehne --- plugins/qmlprofiler/abstracttimelinemodel.h | 2 ++ plugins/qmlprofiler/qml/MainView.qml | 25 +++++++++++------ plugins/qmlprofiler/qmlprofilereventview.cpp | 32 ++++++---------------- plugins/qmlprofiler/qmlprofilereventview.h | 6 ++-- .../qmlprofilerpainteventsmodelproxy.cpp | 12 ++++++++ .../qmlprofiler/qmlprofilerpainteventsmodelproxy.h | 2 ++ .../qmlprofiler/qmlprofilertimelinemodelproxy.cpp | 19 +++++++++++++ .../qmlprofiler/qmlprofilertimelinemodelproxy.h | 3 ++ plugins/qmlprofiler/qmlprofilertraceview.cpp | 19 +++++++++++-- plugins/qmlprofiler/qmlprofilertraceview.h | 3 +- plugins/qmlprofiler/qmlprofilerviewmanager.cpp | 14 ++++++++-- plugins/qmlprofiler/qv8profilereventview.cpp | 21 +++----------- plugins/qmlprofiler/qv8profilereventview.h | 2 -- plugins/qmlprofiler/timelinemodelaggregator.cpp | 22 ++++++++++++++- plugins/qmlprofiler/timelinemodelaggregator.h | 3 ++ plugins/qmlprofilerextension/pixmapcachemodel.cpp | 10 +++++++ plugins/qmlprofilerextension/pixmapcachemodel.h | 3 ++ .../scenegraphtimelinemodel.cpp | 10 +++++++ .../qmlprofilerextension/scenegraphtimelinemodel.h | 3 ++ 19 files changed, 149 insertions(+), 62 deletions(-) diff --git a/plugins/qmlprofiler/abstracttimelinemodel.h b/plugins/qmlprofiler/abstracttimelinemodel.h index 1e96a22adc..2eecdeef54 100644 --- a/plugins/qmlprofiler/abstracttimelinemodel.h +++ b/plugins/qmlprofiler/abstracttimelinemodel.h @@ -91,6 +91,8 @@ public: // returned map should contain "file", "line", "column" properties, or be empty Q_INVOKABLE virtual const QVariantMap getEventLocation(int index) const = 0; + Q_INVOKABLE virtual int getEventIdForHash(const QString &eventHash) const = 0; + Q_INVOKABLE virtual int getEventIdForLocation(const QString &filename, int line, int column) const = 0; signals: void countChanged(); diff --git a/plugins/qmlprofiler/qml/MainView.qml b/plugins/qmlprofiler/qml/MainView.qml index ab7289d309..2c9c2df308 100644 --- a/plugins/qmlprofiler/qml/MainView.qml +++ b/plugins/qmlprofiler/qml/MainView.qml @@ -152,10 +152,12 @@ Rectangle { // ***** functions function gotoSourceLocation(file,line,column) { - root.fileName = file; - root.lineNumber = line; - root.columnNumber = column; - root.updateCursorPosition(); + if (file !== undefined) { + root.fileName = file; + root.lineNumber = line; + root.columnNumber = column; + root.updateCursorPosition(); + } } function clearData() { @@ -293,7 +295,14 @@ Rectangle { rangeDetails.isBindingLoop = false; } - function selectNextWithId( eventId ) + function selectNextByHash(hash) { + var eventId = qmlProfilerModelProxy.getEventIdForHash(hash); + if (eventId !== -1) { + selectNextById(eventId); + } + } + + function selectNextById(eventId) { // this is a slot responding to events from the other pane // which tracks only events from the basic model @@ -327,9 +336,9 @@ Rectangle { onSelectedItemChanged: { if (selectedItem != -1 && !lockItemSelection) { lockItemSelection = true; - /* - selectedEventChanged( qmlProfilerDataModel.getEventId(selectedItem) ); - */ + // update in other views + var eventLocation = qmlProfilerModelProxy.getEventLocation(view.selectedModel, view.selectedItem); + gotoSourceLocation(eventLocation.file, eventLocation.line, eventLocation.column); lockItemSelection = false; } } diff --git a/plugins/qmlprofiler/qmlprofilereventview.cpp b/plugins/qmlprofiler/qmlprofilereventview.cpp index 07f1309518..2e44ec650e 100644 --- a/plugins/qmlprofiler/qmlprofilereventview.cpp +++ b/plugins/qmlprofiler/qmlprofilereventview.cpp @@ -128,7 +128,7 @@ QmlProfilerEventsWidget::QmlProfilerEventsWidget(QWidget *parent, d->m_eventTree = new QmlProfilerEventsMainView(this, d->modelProxy); connect(d->m_eventTree, SIGNAL(gotoSourceLocation(QString,int,int)), this, SIGNAL(gotoSourceLocation(QString,int,int))); - connect(d->m_eventTree, SIGNAL(showEventInTimeline(int)), this, SIGNAL(showEventInTimeline(int))); + connect(d->m_eventTree, SIGNAL(eventSelected(QString)), this, SIGNAL(eventSelectedByHash(QString))); d->m_eventChildren = new QmlProfilerEventRelativesView( profilerModelManager, @@ -283,11 +283,7 @@ void QmlProfilerEventsWidget::updateSelectedEvent(const QString &eventHash) cons void QmlProfilerEventsWidget::selectBySourceLocation(const QString &filename, int line, int column) { - // This slot is used to connect the javascript pane with the qml events pane - // Our javascript trace data does not store column information - // thus we ignore it here - Q_UNUSED(column); - d->m_eventTree->selectEventByLocation(filename, line); + d->m_eventTree->selectEventByLocation(filename, line, column); } bool QmlProfilerEventsWidget::hasGlobalStats() const @@ -668,9 +664,6 @@ void QmlProfilerEventsMainView::jumpToItem(const QModelIndex &index) // show in callers/callees subwindow emit eventSelected(infoItem->data(EventHashStrRole).toString()); - // show in timelinerenderer - emit showEventInTimeline(infoItem->data(EventIdRole).toInt()); - d->m_preventSelectBounce = false; } @@ -686,14 +679,18 @@ void QmlProfilerEventsMainView::selectEvent(const QString &eventHash) } } -void QmlProfilerEventsMainView::selectEventByLocation(const QString &filename, int line) +void QmlProfilerEventsMainView::selectEventByLocation(const QString &filename, int line, int column) { if (d->m_preventSelectBounce) return; for (int i=0; im_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) { + if (currentIndex() != d->m_model->indexFromItem(infoItem) && + infoItem->data(FilenameRole).toString() == filename && + infoItem->data(LineRole).toInt() == line && + (column == -1 || + infoItem->data(ColumnRole).toInt() == column)) { setCurrentIndex(d->m_model->indexFromItem(infoItem)); jumpToItem(currentIndex()); return; @@ -710,18 +707,6 @@ QModelIndex QmlProfilerEventsMainView::selectedItem() const return sel.first(); } -void QmlProfilerEventsMainView::changeDetailsForEvent(int eventId, const QString &newString) -{ - for (int i=0; im_model->rowCount(); i++) { - QStandardItem *infoItem = d->m_model->item(i, 0); - if (infoItem->data(EventIdRole).toInt() == eventId) { - d->m_model->item(i,d->m_columnIndex[Details])->setData(QVariant(newString),Qt::DisplayRole); - d->m_model->item(i,d->m_columnIndex[Details])->setData(QVariant(newString)); - return; - } - } -} - QString QmlProfilerEventsMainView::QmlProfilerEventsMainViewPrivate::textForItem(QStandardItem *item, bool recursive) const { QString str; @@ -852,7 +837,6 @@ void QmlProfilerEventRelativesView::rebuildTree(QmlProfilerEventRelativesModelPr // newRow << new EventsViewItem(QString::number(event->calls)); // newRow << new EventsViewItem(event->reference->details); newRow.at(0)->setData(QVariant(key), EventHashStrRole); -// newRow.at(0)->setData(QVariant(event->reference->eventId), EventIdRole); newRow.at(2)->setData(QVariant(event.duration)); newRow.at(3)->setData(QVariant(event.calls)); diff --git a/plugins/qmlprofiler/qmlprofilereventview.h b/plugins/qmlprofiler/qmlprofilereventview.h index ef3c4d8596..f6e6297c02 100644 --- a/plugins/qmlprofiler/qmlprofilereventview.h +++ b/plugins/qmlprofiler/qmlprofilereventview.h @@ -81,7 +81,7 @@ public: signals: void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber); - void showEventInTimeline(int eventId); + void eventSelectedByHash(const QString &eventHash); void resized(); public slots: @@ -129,15 +129,13 @@ public: signals: void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber); void eventSelected(const QString &eventHash); - void showEventInTimeline(int eventId); public slots: void clear(); void jumpToItem(const QModelIndex &index); void selectEvent(const QString &eventHash); - void selectEventByLocation(const QString &filename, int line); + void selectEventByLocation(const QString &filename, int line, int column); void buildModel(); - void changeDetailsForEvent(int eventId, const QString &newString); private slots: void profilerDataModelStateChanged(); diff --git a/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp b/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp index 6708e7b226..7457e33dc8 100644 --- a/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp +++ b/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp @@ -421,6 +421,18 @@ const QVariantMap PaintEventsModelProxy::getEventLocation(int /*index*/) const return map; } +int PaintEventsModelProxy::getEventIdForHash(const QString &/*eventHash*/) const +{ + // paint events do not have an eventHash + return -1; +} + +int PaintEventsModelProxy::getEventIdForLocation(const QString &/*filename*/, int /*line*/, int /*column*/) const +{ + // paint events do not have a defined location + return -1; +} + } } diff --git a/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h b/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h index ed2ddec099..677c5e5c17 100644 --- a/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h +++ b/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h @@ -102,6 +102,8 @@ public: Q_INVOKABLE const QVariantList getLabelsForCategory(int category) const; Q_INVOKABLE const QVariantList getEventDetails(int index) const; Q_INVOKABLE const QVariantMap getEventLocation(int index) const; + Q_INVOKABLE int getEventIdForHash(const QString &eventHash) const; + Q_INVOKABLE int getEventIdForLocation(const QString &filename, int line, int column) const; private slots: bool eventAccepted(const QmlProfilerSimpleModel::QmlEventData &event) const; diff --git a/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp b/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp index c50b3468f6..3984b25c44 100644 --- a/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp +++ b/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp @@ -670,5 +670,24 @@ const QVariantMap BasicTimelineModel::getEventLocation(int index) const return result; } +int BasicTimelineModel::getEventIdForHash(const QString &eventHash) const +{ + return d->eventHashes.indexOf(eventHash); +} + +int BasicTimelineModel::getEventIdForLocation(const QString &filename, int line, int column) const +{ + // if this is called from v8 view, we don't have the column number, it will be -1 + foreach (const QmlRangeEventData &eventData, d->eventDict) { + if (eventData.location.filename == filename && + eventData.location.line == line && + (column == -1 || eventData.location.column == column)) + return eventData.eventId; + } + return -1; +} + + + } } diff --git a/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h b/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h index 53b05e93e2..a8e6f08aa2 100644 --- a/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h +++ b/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h @@ -125,6 +125,9 @@ public: Q_INVOKABLE const QVariantList getEventDetails(int index) const; Q_INVOKABLE const QVariantMap getEventLocation(int index) const; + Q_INVOKABLE int getEventIdForHash(const QString &eventHash) const; + Q_INVOKABLE int getEventIdForLocation(const QString &filename, int line, int column) const; + private slots: bool eventAccepted(const QmlProfilerSimpleModel::QmlEventData &event) const; protected slots: diff --git a/plugins/qmlprofiler/qmlprofilertraceview.cpp b/plugins/qmlprofiler/qmlprofilertraceview.cpp index 65a30009ed..c094a07f13 100644 --- a/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -378,12 +378,25 @@ void QmlProfilerTraceView::clearDisplay() QMetaObject::invokeMethod(d->m_overview->rootObject(), "clearDisplay"); } -void QmlProfilerTraceView::selectNextEventWithId(int eventId) +void QmlProfilerTraceView::selectNextEventByHash(const QString &hash) { QGraphicsObject *rootObject = d->m_mainView->rootObject(); + if (rootObject) - QMetaObject::invokeMethod(rootObject, "selectNextWithId", - Q_ARG(QVariant,QVariant(eventId))); + QMetaObject::invokeMethod(rootObject, "selectNextByHash", + Q_ARG(QVariant,QVariant(hash))); +} + +void QmlProfilerTraceView::selectNextEventByLocation(const QString &filename, const int line, const int column) +{ + int eventId = d->m_modelProxy->getEventIdForLocation(filename, line, column); + + if (eventId != -1) { + QGraphicsObject *rootObject = d->m_mainView->rootObject(); + if (rootObject) + QMetaObject::invokeMethod(rootObject, "selectNextById", + Q_ARG(QVariant,QVariant(eventId))); + } } ///////////////////////////////////////////////////////// diff --git a/plugins/qmlprofiler/qmlprofilertraceview.h b/plugins/qmlprofiler/qmlprofilertraceview.h index f33e80fb90..4f933eb254 100644 --- a/plugins/qmlprofiler/qmlprofilertraceview.h +++ b/plugins/qmlprofiler/qmlprofilertraceview.h @@ -99,7 +99,8 @@ public: public slots: void clearDisplay(); - void selectNextEventWithId(int eventId); + void selectNextEventByHash(const QString &eventHash); + void selectNextEventByLocation(const QString &filename, const int line, const int column); private slots: void updateCursorPosition(); diff --git a/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/plugins/qmlprofiler/qmlprofilerviewmanager.cpp index 00496107c6..5374b1c3c7 100644 --- a/plugins/qmlprofiler/qmlprofilerviewmanager.cpp +++ b/plugins/qmlprofiler/qmlprofilerviewmanager.cpp @@ -105,11 +105,21 @@ void QmlProfilerViewManager::createViews() d->profilerModelManager); connect(d->eventsView, SIGNAL(gotoSourceLocation(QString,int,int)), this, SIGNAL(gotoSourceLocation(QString,int,int))); - connect(d->eventsView, SIGNAL(showEventInTimeline(int)), d->traceView, - SLOT(selectNextEventWithId(int))); + connect(d->eventsView, SIGNAL(eventSelectedByHash(QString)), d->traceView, + SLOT(selectNextEventByHash(QString))); + connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)), + d->eventsView, SLOT(selectBySourceLocation(QString,int,int))); d->v8profilerView = new QV8ProfilerEventsWidget(mw, d->profilerTool, this, d->profilerModelManager); + connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)), + d->v8profilerView, SLOT(selectBySourceLocation(QString,int,int))); + connect(d->v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)), + d->traceView, SLOT(selectNextEventByLocation(QString,int,int))); + connect(d->v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)), + d->eventsView, SLOT(selectBySourceLocation(QString,int,int))); + connect(d->eventsView, SIGNAL(gotoSourceLocation(QString,int,int)), + d->v8profilerView, SLOT(selectBySourceLocation(QString,int,int))); QDockWidget *eventsDock = AnalyzerManager::createDockWidget (d->profilerTool, tr("Events"), d->eventsView, Qt::BottomDockWidgetArea); diff --git a/plugins/qmlprofiler/qv8profilereventview.cpp b/plugins/qmlprofiler/qv8profilereventview.cpp index 7888f00e0a..fdc3ee9592 100644 --- a/plugins/qmlprofiler/qv8profilereventview.cpp +++ b/plugins/qmlprofiler/qv8profilereventview.cpp @@ -464,7 +464,7 @@ void QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate::buildV8ModelFr newRow.at(0)->setData(QString::fromLatin1("%1:%2").arg(v8event->filename, QString::number(v8event->line)), EventHashStrRole); newRow.at(0)->setData(QVariant(v8event->filename), FilenameRole); newRow.at(0)->setData(QVariant(v8event->line), LineRole); - newRow.at(0)->setData(QVariant(0),ColumnRole); // v8 events have no column info + newRow.at(0)->setData(QVariant(-1),ColumnRole); // v8 events have no column info newRow.at(0)->setData(QVariant(v8event->eventId), EventIdRole); // append @@ -527,9 +527,6 @@ void QV8ProfilerEventsMainView::jumpToItem(const QModelIndex &index) // show in callers/callees subwindow emit eventSelected(infoItem->data(EventIdRole).toInt()); - // show in timelinerenderer - emit showEventInTimeline(infoItem->data(EventIdRole).toInt()); - d->m_preventSelectBounce = false; } @@ -552,7 +549,9 @@ void QV8ProfilerEventsMainView::selectEventByLocation(const QString &filename, i for (int i=0; im_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) { + 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; @@ -569,18 +568,6 @@ QModelIndex QV8ProfilerEventsMainView::selectedItem() const return sel.first(); } -void QV8ProfilerEventsMainView::changeDetailsForEvent(int eventId, const QString &newString) -{ - for (int i=0; im_model->rowCount(); i++) { - QStandardItem *infoItem = d->m_model->item(i, 0); - if (infoItem->data(EventIdRole).toInt() == eventId) { - d->m_model->item(i,d->m_columnIndex[Details])->setData(QVariant(newString),Qt::DisplayRole); - d->m_model->item(i,d->m_columnIndex[Details])->setData(QVariant(newString)); - return; - } - } -} - QString QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate::textForItem(QStandardItem *item, bool recursive = true) const { QString str; diff --git a/plugins/qmlprofiler/qv8profilereventview.h b/plugins/qmlprofiler/qv8profilereventview.h index da52f5e4c3..d32b499c1c 100644 --- a/plugins/qmlprofiler/qv8profilereventview.h +++ b/plugins/qmlprofiler/qv8profilereventview.h @@ -111,7 +111,6 @@ public: signals: void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber); void eventSelected(int eventId); - void showEventInTimeline(int eventId); public slots: void clear(); @@ -119,7 +118,6 @@ public slots: void selectEvent(int eventId); void selectEventByLocation(const QString &filename, int line); void buildModel(); - void changeDetailsForEvent(int eventId, const QString &newString); private: void setHeaderLabels(); diff --git a/plugins/qmlprofiler/timelinemodelaggregator.cpp b/plugins/qmlprofiler/timelinemodelaggregator.cpp index e98d669ba0..89f04d8daa 100644 --- a/plugins/qmlprofiler/timelinemodelaggregator.cpp +++ b/plugins/qmlprofiler/timelinemodelaggregator.cpp @@ -152,7 +152,7 @@ bool TimelineModelAggregator::isEmpty() const return true; } -bool TimelineModelAggregator::eventAccepted(const QmlProfilerSimpleModel::QmlEventData &event) const +bool TimelineModelAggregator::eventAccepted(const QmlProfilerSimpleModel::QmlEventData &/*event*/) const { // accept all events return true; @@ -319,6 +319,26 @@ const QVariantMap TimelineModelAggregator::getEventLocation(int modelIndex, int return d->modelList[modelIndex]->getEventLocation(index); } +int TimelineModelAggregator::getEventIdForHash(const QString &hash) const +{ + foreach (const AbstractTimelineModel *model, d->modelList) { + int eventId = model->getEventIdForHash(hash); + if (eventId != -1) + return eventId; + } + return -1; +} + +int TimelineModelAggregator::getEventIdForLocation(const QString &filename, int line, int column) const +{ + foreach (const AbstractTimelineModel *model, d->modelList) { + int eventId = model->getEventIdForLocation(filename, line, column); + if (eventId != -1) + return eventId; + } + return -1; +} + void TimelineModelAggregator::dataChanged() { // this is a slot connected for every modelproxy diff --git a/plugins/qmlprofiler/timelinemodelaggregator.h b/plugins/qmlprofiler/timelinemodelaggregator.h index 9d041001dd..9c15f362b3 100644 --- a/plugins/qmlprofiler/timelinemodelaggregator.h +++ b/plugins/qmlprofiler/timelinemodelaggregator.h @@ -95,6 +95,9 @@ public: Q_INVOKABLE const QVariantList getEventDetails(int modelIndex, int index) const; Q_INVOKABLE const QVariantMap getEventLocation(int modelIndex, int index) const; + Q_INVOKABLE int getEventIdForHash(const QString &hash) const; + Q_INVOKABLE int getEventIdForLocation(const QString &filename, int line, int column) const; + Q_INVOKABLE int modelIndexForCategory(int absoluteCategoryIndex) const; Q_INVOKABLE int correctedCategoryIndexForModel(int modelIndex, int absoluteCategoryIndex) const; diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp index 496ad94884..db8cd938be 100644 --- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp +++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp @@ -348,6 +348,16 @@ const QVariantMap PixmapCacheModel::getEventLocation(int /*index*/) const return map; } +int PixmapCacheModel::getEventIdForHash(const QString &/*eventHash*/) const +{ + return -1; +} + +int PixmapCacheModel::getEventIdForLocation(const QString &/*filename*/, int /*line*/, int /*column*/) const +{ + return -1; +} + bool compareStartTimes(const PixmapCacheModel::PixmapCacheEvent&t1, const PixmapCacheModel::PixmapCacheEvent &t2) { return t1.startTime < t2.startTime; diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.h b/plugins/qmlprofilerextension/pixmapcachemodel.h index bdb43d89f8..8fd38bb378 100644 --- a/plugins/qmlprofilerextension/pixmapcachemodel.h +++ b/plugins/qmlprofilerextension/pixmapcachemodel.h @@ -97,6 +97,9 @@ public: Q_INVOKABLE const QVariantList getEventDetails(int index) const; Q_INVOKABLE const QVariantMap getEventLocation(int index) const; + Q_INVOKABLE int getEventIdForHash(const QString &eventHash) const; + Q_INVOKABLE int getEventIdForLocation(const QString &filename, int line, int column) const; + void loadData(); void clear(); //signals: diff --git a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp index 3bf3416c2b..bcca3987e7 100644 --- a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp +++ b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp @@ -353,6 +353,16 @@ const QVariantMap SceneGraphTimelineModel::getEventLocation(int /*index*/) const return map; } +int SceneGraphTimelineModel::getEventIdForHash(const QString &) const +{ + return -1; +} + +int SceneGraphTimelineModel::getEventIdForLocation(const QString &/*filename*/, int /*line*/, int /*column*/) const +{ + return -1; +} + bool compareStartTimes(const SceneGraphTimelineModel::SceneGraphEvent&t1, const SceneGraphTimelineModel::SceneGraphEvent &t2) { return t1.startTime < t2.startTime; diff --git a/plugins/qmlprofilerextension/scenegraphtimelinemodel.h b/plugins/qmlprofilerextension/scenegraphtimelinemodel.h index edad9ec0d3..83812643a3 100644 --- a/plugins/qmlprofilerextension/scenegraphtimelinemodel.h +++ b/plugins/qmlprofilerextension/scenegraphtimelinemodel.h @@ -85,6 +85,9 @@ public: Q_INVOKABLE const QVariantList getEventDetails(int index) const; Q_INVOKABLE const QVariantMap getEventLocation(int index) const; + Q_INVOKABLE int getEventIdForHash(const QString &eventHash) const; + Q_INVOKABLE int getEventIdForLocation(const QString &filename, int line, int column) const; + void loadData(); void clear(); //signals: -- cgit v1.2.3