summaryrefslogtreecommitdiff
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-08-29 16:32:42 +0200
committerUlf Hermann <ulf.hermann@digia.com>2014-09-29 13:06:45 +0200
commit38f4d6a5f26b6c9ad532dba295ff10d8873a019e (patch)
tree3dc30ea9fc4a6fa491c89768fbf2cf5a15f52343 /src/plugins/qmlprofiler
parent3af3878ace09fedb98c495f9bda550f7aa0df39c (diff)
downloadqt-creator-38f4d6a5f26b6c9ad532dba295ff10d8873a019e.tar.gz
QmlProfiler: rename "eventId" fields to "typeId" and "selectionId"
The convention is now that selections are the rows in the expanded timeline, "types" are the types in the QmlProfilerDataModel, and events are the single boxes in the timeline. Thus, the event view shows only types and for consistency the V8 view does so, too. Having eventId as synonym for "type index" and "event index" as actual index into the list of events is confusing. Change-Id: I6b7c4c3f1ab0a8b71c511de52ab296a2e91cf5f0 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/abstracttimelinemodel.cpp6
-rw-r--r--src/plugins/qmlprofiler/abstracttimelinemodel.h12
-rw-r--r--src/plugins/qmlprofiler/qml/CategoryLabel.qml8
-rw-r--r--src/plugins/qmlprofiler/qml/MainView.qml10
-rw-r--r--src/plugins/qmlprofiler/qml/RangeDetails.qml2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilereventview.cpp49
-rw-r--r--src/plugins/qmlprofiler/qmlprofilereventview.h23
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp38
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h12
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertraceview.cpp17
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertraceview.h2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp3
-rw-r--r--src/plugins/qmlprofiler/qv8profilerdatamodel.cpp16
-rw-r--r--src/plugins/qmlprofiler/qv8profilerdatamodel.h4
-rw-r--r--src/plugins/qmlprofiler/qv8profilereventview.cpp34
-rw-r--r--src/plugins/qmlprofiler/qv8profilereventview.h12
-rw-r--r--src/plugins/qmlprofiler/timelinemodelaggregator.cpp12
-rw-r--r--src/plugins/qmlprofiler/timelinemodelaggregator.h6
-rw-r--r--src/plugins/qmlprofiler/timelinerenderer.cpp32
-rw-r--r--src/plugins/qmlprofiler/timelinerenderer.h10
22 files changed, 154 insertions, 158 deletions
diff --git a/src/plugins/qmlprofiler/abstracttimelinemodel.cpp b/src/plugins/qmlprofiler/abstracttimelinemodel.cpp
index acfdc65883..9c01a5243d 100644
--- a/src/plugins/qmlprofiler/abstracttimelinemodel.cpp
+++ b/src/plugins/qmlprofiler/abstracttimelinemodel.cpp
@@ -152,13 +152,13 @@ QVariantMap AbstractTimelineModel::location(int index) const
return map;
}
-int AbstractTimelineModel::eventIdForTypeIndex(int typeIndex) const
+bool AbstractTimelineModel::isSelectionIdValid(int typeIndex) const
{
Q_UNUSED(typeIndex);
- return -1;
+ return false;
}
-int AbstractTimelineModel::eventIdForLocation(const QString &filename, int line, int column) const
+int AbstractTimelineModel::selectionIdForLocation(const QString &filename, int line, int column) const
{
Q_UNUSED(filename);
Q_UNUSED(line);
diff --git a/src/plugins/qmlprofiler/abstracttimelinemodel.h b/src/plugins/qmlprofiler/abstracttimelinemodel.h
index 9ade6f031b..3873066b9d 100644
--- a/src/plugins/qmlprofiler/abstracttimelinemodel.h
+++ b/src/plugins/qmlprofiler/abstracttimelinemodel.h
@@ -73,7 +73,7 @@ public:
int rowCount() const;
// Methods that have to be implemented by child models
- virtual int eventId(int index) const = 0;
+ virtual int selectionId(int index) const = 0;
virtual QColor color(int index) const = 0;
virtual QVariantList labels() const = 0;
virtual QVariantMap details(int index) const = 0;
@@ -83,8 +83,8 @@ public:
// Methods which can optionally be implemented by child models.
// returned map should contain "file", "line", "column" properties, or be empty
virtual QVariantMap location(int index) const;
- virtual int eventIdForTypeIndex(int typeIndex) const;
- virtual int eventIdForLocation(const QString &filename, int line, int column) const;
+ virtual bool isSelectionIdValid(int selectionId) const;
+ virtual int selectionIdForLocation(const QString &filename, int line, int column) const;
virtual int bindingLoopDest(int index) const;
virtual float relativeHeight(int index) const;
virtual int rowMinValue(int rowNumber) const;
@@ -100,16 +100,16 @@ protected:
static const int DefaultRowHeight = 30;
enum BoxColorProperties {
- EventHueMultiplier = 25,
+ SelectionIdHueMultiplier = 25,
FractionHueMultiplier = 96,
FractionHueMininimum = 10,
Saturation = 150,
Lightness = 166
};
- QColor colorByEventId(int index) const
+ QColor colorBySelectionId(int index) const
{
- return colorByHue(eventId(index) * EventHueMultiplier);
+ return colorByHue(selectionId(index) * SelectionIdHueMultiplier);
}
QColor colorByFraction(double fraction) const
diff --git a/src/plugins/qmlprofiler/qml/CategoryLabel.qml b/src/plugins/qmlprofiler/qml/CategoryLabel.qml
index 25690c6514..317e665354 100644
--- a/src/plugins/qmlprofiler/qml/CategoryLabel.qml
+++ b/src/plugins/qmlprofiler/qml/CategoryLabel.qml
@@ -39,7 +39,7 @@ Item {
property int bindingTrigger: 1
property var descriptions: []
property var extdescriptions: []
- property var eventIds: []
+ property var selectionIds: []
property bool dragging
property Item draggerParent
@@ -75,7 +75,7 @@ Item {
extdesc[i] += " (" + labelList[i].displayName + ")";
}
descriptions = desc;
- eventIds = ids;
+ selectionIds = ids;
extdescriptions = extdesc;
}
@@ -148,9 +148,9 @@ Item {
action: Action {
onTriggered: {
if (reverseSelect)
- view.selectPrevFromId(modelIndex,eventIds[index]);
+ view.selectPrevFromSelectionId(modelIndex,selectionIds[index]);
else
- view.selectNextFromId(modelIndex,eventIds[index]);
+ view.selectNextFromSelectionId(modelIndex,selectionIds[index]);
}
tooltip: extdescriptions[index]
diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml
index f0a84605f6..e11954d48c 100644
--- a/src/plugins/qmlprofiler/qml/MainView.qml
+++ b/src/plugins/qmlprofiler/qml/MainView.qml
@@ -153,19 +153,19 @@ Rectangle {
rangeDetails.isBindingLoop = false;
}
- function selectById(modelIndex, eventId)
+ function selectBySelectionId(modelIndex, selectionId)
{
- if (eventId === -1 || (modelIndex === view.selectedModel &&
- eventId === qmlProfilerModelProxy.eventId(modelIndex, view.selectedItem)))
+ if (selectionId === -1 || (modelIndex === view.selectedModel &&
+ selectionId === qmlProfilerModelProxy.selectionId(modelIndex, view.selectedItem)))
return;
// this is a slot responding to events from the other pane
// which tracks only events from the basic model
if (!lockItemSelection) {
lockItemSelection = true;
- var itemIndex = view.nextItemFromId(modelIndex, eventId);
+ var itemIndex = view.nextItemFromSelectionId(modelIndex, selectionId);
// select an item, lock to it, and recenter if necessary
- view.selectFromId(modelIndex, itemIndex); // triggers recentering
+ view.selectFromEventIndex(modelIndex, itemIndex); // triggers recentering
if (itemIndex !== -1)
view.selectionLocked = true;
lockItemSelection = false;
diff --git a/src/plugins/qmlprofiler/qml/RangeDetails.qml b/src/plugins/qmlprofiler/qml/RangeDetails.qml
index 25fcb20369..2afb638221 100644
--- a/src/plugins/qmlprofiler/qml/RangeDetails.qml
+++ b/src/plugins/qmlprofiler/qml/RangeDetails.qml
@@ -223,7 +223,7 @@ Item {
anchors.fill: parent
onClicked: {
root.hideRangeDetails();
- view.selectFromId(view.selectedModel, -1);
+ view.selectFromEventIndex(view.selectedModel, -1);
}
}
}
diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.cpp b/src/plugins/qmlprofiler/qmlprofilereventview.cpp
index b800c57296..7d7f2ab1a7 100644
--- a/src/plugins/qmlprofiler/qmlprofilereventview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilereventview.cpp
@@ -151,8 +151,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(eventSelected(int)),
- this, SIGNAL(eventSelectedByTypeIndex(int)));
+ connect(d->m_eventTree, SIGNAL(typeSelected(int)), this, SIGNAL(typeSelected(int)));
d->m_eventChildren = new QmlProfilerEventRelativesView(
profilerModelManager,
@@ -162,10 +161,10 @@ QmlProfilerEventsWidget::QmlProfilerEventsWidget(QWidget *parent,
profilerModelManager,
new QmlProfilerEventParentsModelProxy(profilerModelManager, d->modelProxy, this),
this);
- connect(d->m_eventTree, SIGNAL(eventSelected(int)), d->m_eventChildren, SLOT(displayEvent(int)));
- connect(d->m_eventTree, SIGNAL(eventSelected(int)), d->m_eventParents, SLOT(displayEvent(int)));
- connect(d->m_eventChildren, SIGNAL(eventClicked(int)), d->m_eventTree, SLOT(selectEvent(int)));
- connect(d->m_eventParents, SIGNAL(eventClicked(int)), d->m_eventTree, SLOT(selectEvent(int)));
+ connect(d->m_eventTree, SIGNAL(typeSelected(int)), d->m_eventChildren, SLOT(displayType(int)));
+ connect(d->m_eventTree, SIGNAL(typeSelected(int)), d->m_eventParents, SLOT(displayType(int)));
+ connect(d->m_eventChildren, SIGNAL(typeClicked(int)), d->m_eventTree, SLOT(selectType(int)));
+ connect(d->m_eventParents, SIGNAL(typeClicked(int)), d->m_eventTree, SLOT(selectType(int)));
// widget arrangement
QVBoxLayout *groupLayout = new QVBoxLayout;
@@ -214,9 +213,9 @@ void QmlProfilerEventsWidget::getStatisticsInRange(qint64 rangeStart, qint64 ran
d->modelProxy->limitToRange(rangeStart, rangeEnd);
}
-QModelIndex QmlProfilerEventsWidget::selectedItem() const
+QModelIndex QmlProfilerEventsWidget::selectedModelIndex() const
{
- return d->m_eventTree->selectedItem();
+ return d->m_eventTree->selectedModelIndex();
}
void QmlProfilerEventsWidget::contextMenuEvent(QContextMenuEvent *ev)
@@ -243,7 +242,7 @@ void QmlProfilerEventsWidget::contextMenuEvent(QContextMenuEvent *ev)
if (mouseOnTable(position)) {
menu.addSeparator();
- if (selectedItem().isValid())
+ if (selectedModelIndex().isValid())
copyRowAction = menu.addAction(tr("Copy Row"));
copyTableAction = menu.addAction(tr("Copy Table"));
@@ -315,13 +314,13 @@ void QmlProfilerEventsWidget::copyRowToClipboard() const
void QmlProfilerEventsWidget::updateSelectedEvent(int typeIndex) const
{
- if (d->m_eventTree->selectedTypeIndex() != typeIndex)
- d->m_eventTree->selectEvent(typeIndex);
+ if (d->m_eventTree->selectedTypeId() != typeIndex)
+ d->m_eventTree->selectType(typeIndex);
}
void QmlProfilerEventsWidget::selectBySourceLocation(const QString &filename, int line, int column)
{
- d->m_eventTree->selectEventByLocation(filename, line, column);
+ d->m_eventTree->selectByLocation(filename, line, column);
}
bool QmlProfilerEventsWidget::hasGlobalStats() const
@@ -659,7 +658,7 @@ void QmlProfilerEventsMainView::parseModelProxy()
item->setEditable(false);
// metadata
- newRow.at(0)->setData(QVariant(typeIndex),EventTypeIndexRole);
+ newRow.at(0)->setData(QVariant(typeIndex),TypeIdRole);
newRow.at(0)->setData(QVariant(event.location.filename),FilenameRole);
newRow.at(0)->setData(QVariant(event.location.line),LineRole);
newRow.at(0)->setData(QVariant(event.location.column),ColumnRole);
@@ -695,13 +694,13 @@ void QmlProfilerEventsMainView::getStatisticsInRange(qint64 rangeStart, qint64 r
d->modelProxy->limitToRange(rangeStart, rangeEnd);
}
-int QmlProfilerEventsMainView::selectedTypeIndex() const
+int QmlProfilerEventsMainView::selectedTypeId() const
{
- QModelIndex index = selectedItem();
+ QModelIndex index = selectedModelIndex();
if (!index.isValid())
return -1;
QStandardItem *item = d->m_model->item(index.row(), 0);
- return item->data(EventTypeIndexRole).toInt();
+ return item->data(TypeIdRole).toInt();
}
@@ -726,7 +725,7 @@ void QmlProfilerEventsMainView::jumpToItem(const QModelIndex &index)
emit gotoSourceLocation(fileName, line, column);
// show in callers/callees subwindow
- emit eventSelected(infoItem->data(EventTypeIndexRole).toInt());
+ emit typeSelected(infoItem->data(TypeIdRole).toInt());
d->m_preventSelectBounce = false;
}
@@ -741,18 +740,18 @@ void QmlProfilerEventsMainView::selectItem(const QStandardItem *item)
}
}
-void QmlProfilerEventsMainView::selectEvent(int typeIndex)
+void QmlProfilerEventsMainView::selectType(int typeIndex)
{
for (int i=0; i<d->m_model->rowCount(); i++) {
QStandardItem *infoItem = d->m_model->item(i, 0);
- if (infoItem->data(EventTypeIndexRole).toInt() == typeIndex) {
+ if (infoItem->data(TypeIdRole).toInt() == typeIndex) {
selectItem(infoItem);
return;
}
}
}
-void QmlProfilerEventsMainView::selectEventByLocation(const QString &filename, int line, int column)
+void QmlProfilerEventsMainView::selectByLocation(const QString &filename, int line, int column)
{
if (d->m_preventSelectBounce)
return;
@@ -769,7 +768,7 @@ void QmlProfilerEventsMainView::selectEventByLocation(const QString &filename, i
}
}
-QModelIndex QmlProfilerEventsMainView::selectedItem() const
+QModelIndex QmlProfilerEventsMainView::selectedModelIndex() const
{
QModelIndexList sel = selectedIndexes();
if (sel.isEmpty())
@@ -833,7 +832,7 @@ void QmlProfilerEventsMainView::copyTableToClipboard() const
void QmlProfilerEventsMainView::copyRowToClipboard() const
{
QString str;
- str = d->textForItem(d->m_model->itemFromIndex(selectedItem()), false);
+ str = d->textForItem(d->m_model->itemFromIndex(selectedModelIndex()), false);
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(str, QClipboard::Selection);
@@ -876,7 +875,7 @@ QmlProfilerEventRelativesView::~QmlProfilerEventRelativesView()
delete d;
}
-void QmlProfilerEventRelativesView::displayEvent(int typeIndex)
+void QmlProfilerEventRelativesView::displayType(int typeIndex)
{
rebuildTree(d->modelProxy->getData(typeIndex));
@@ -914,7 +913,7 @@ void QmlProfilerEventRelativesView::rebuildTree(
newRow << new EventsViewItem(type.data.isEmpty() ? tr("Source code not available") :
type.data);
- newRow.at(0)->setData(QVariant(typeIndex), EventTypeIndexRole);
+ newRow.at(0)->setData(QVariant(typeIndex), TypeIdRole);
newRow.at(0)->setData(QVariant(type.location.filename),FilenameRole);
newRow.at(0)->setData(QVariant(type.location.line),LineRole);
newRow.at(0)->setData(QVariant(type.location.column),ColumnRole);
@@ -981,7 +980,7 @@ void QmlProfilerEventRelativesView::jumpToItem(const QModelIndex &index)
{
if (treeModel()) {
QStandardItem *infoItem = treeModel()->item(index.row(), 0);
- emit eventClicked(infoItem->data(EventTypeIndexRole).toInt());
+ emit typeClicked(infoItem->data(TypeIdRole).toInt());
}
}
diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.h b/src/plugins/qmlprofiler/qmlprofilereventview.h
index 86ef4400d7..02bf43986f 100644
--- a/src/plugins/qmlprofiler/qmlprofilereventview.h
+++ b/src/plugins/qmlprofiler/qmlprofilereventview.h
@@ -49,11 +49,10 @@ class QmlProfilerEventRelativesView;
enum ItemRole {
SortRole = Qt::UserRole + 1, // Sort by data, not by displayed string
- EventTypeIndexRole,
+ TypeIdRole,
FilenameRole,
LineRole,
- ColumnRole,
- EventIdRole
+ ColumnRole
};
class QmlProfilerEventsWidget : public QWidget
@@ -69,7 +68,7 @@ public:
void clear();
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
- QModelIndex selectedItem() const;
+ QModelIndex selectedModelIndex() const;
bool mouseOnTable(const QPoint &position) const;
void copyTableToClipboard() const;
void copyRowToClipboard() const;
@@ -86,7 +85,7 @@ public:
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
- void eventSelectedByTypeIndex(int typeIndex);
+ void typeSelected(int typeIndex);
void resized();
public slots:
@@ -116,14 +115,14 @@ public:
void setFieldViewable(Fields field, bool show);
void setShowAnonymousEvents( bool showThem );
- QModelIndex selectedItem() const;
+ QModelIndex selectedModelIndex() const;
void copyTableToClipboard() const;
void copyRowToClipboard() const;
static QString nameForType(QmlDebug::RangeType typeNumber);
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
- int selectedTypeIndex() const;
+ int selectedTypeId() const;
void setShowExtendedStatistics(bool);
bool showExtendedStatistics() const;
@@ -131,13 +130,13 @@ public:
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
- void eventSelected(int typeIndex);
+ void typeSelected(int typeIndex);
public slots:
void clear();
void jumpToItem(const QModelIndex &index);
- void selectEvent(int typeIndex);
- void selectEventByLocation(const QString &filename, int line, int column);
+ void selectType(int typeIndex);
+ void selectByLocation(const QString &filename, int line, int column);
void buildModel();
private slots:
@@ -164,10 +163,10 @@ public:
~QmlProfilerEventRelativesView();
signals:
- void eventClicked(int typeIndex);
+ void typeClicked(int typeIndex);
public slots:
- void displayEvent(int typeIndex);
+ void displayType(int typeIndex);
void jumpToItem(const QModelIndex &);
void clear();
diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp
index 8a76767de8..d4af325df3 100644
--- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp
@@ -173,7 +173,7 @@ int PaintEventsModelProxy::rowMaxValue(int rowNumber) const
}
}
-int PaintEventsModelProxy::eventId(int index) const
+int PaintEventsModelProxy::selectionId(int index) const
{
Q_D(const PaintEventsModelProxy);
return d->data[index].threadId;
diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h
index 63613d319f..2c6ef37a5e 100644
--- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h
+++ b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h
@@ -63,7 +63,7 @@ public:
int rowMaxValue(int rowNumber) const;
- int eventId(int index) const;
+ int selectionId(int index) const;
int row(int index) const;
QColor color(int index) const;
diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
index a5b29f870d..d058ebf3cd 100644
--- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
@@ -162,12 +162,12 @@ void RangeTimelineModel::RangeTimelineModelPrivate::computeExpandedLevels()
QHash<int, int> eventRow;
int eventCount = q->count();
for (int i = 0; i < eventCount; i++) {
- int eventId = data[i].eventId;
- if (!eventRow.contains(eventId)) {
- eventRow[eventId] = expandedRowTypes.size();
- expandedRowTypes << eventId;
+ int typeId = data[i].typeId;
+ if (!eventRow.contains(typeId)) {
+ eventRow[typeId] = expandedRowTypes.size();
+ expandedRowTypes << typeId;
}
- data[i].displayRowExpanded = eventRow[eventId];
+ data[i].displayRowExpanded = eventRow[typeId];
}
expandedRowCount = expandedRowTypes.size();
}
@@ -194,14 +194,14 @@ void RangeTimelineModel::RangeTimelineModelPrivate::findBindingLoops()
// check whether event is already in stack
for (int ii = 0; ii < callStack.size(); ++ii) {
- if (callStack.at(ii).first == data[i].eventId) {
+ if (callStack.at(ii).first == data[i].typeId) {
data[i].bindingLoopHead = callStack.at(ii).second;
break;
}
}
- CallStackEntry newEntry(data[i].eventId, i);
+ CallStackEntry newEntry(data[i].typeId, i);
callStack.push(newEntry);
}
@@ -224,10 +224,10 @@ int RangeTimelineModel::row(int index) const
return d->data[index].displayRowCollapsed;
}
-int RangeTimelineModel::eventId(int index) const
+int RangeTimelineModel::selectionId(int index) const
{
Q_D(const RangeTimelineModel);
- return d->data[index].eventId;
+ return d->data[index].typeId;
}
int RangeTimelineModel::bindingLoopDest(int index) const
@@ -238,7 +238,7 @@ int RangeTimelineModel::bindingLoopDest(int index) const
QColor RangeTimelineModel::color(int index) const
{
- return colorByEventId(index);
+ return colorBySelectionId(index);
}
QVariantList RangeTimelineModel::labels() const
@@ -266,7 +266,7 @@ QVariantMap RangeTimelineModel::details(int index) const
{
Q_D(const RangeTimelineModel);
QVariantMap result;
- int id = eventId(index);
+ int id = selectionId(index);
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types =
d->modelManager->qmlModel()->getEventTypes();
@@ -282,7 +282,7 @@ QVariantMap RangeTimelineModel::location(int index) const
{
Q_D(const RangeTimelineModel);
QVariantMap result;
- int id = eventId(index);
+ int id = selectionId(index);
const QmlDebug::QmlEventLocation &location
= d->modelManager->qmlModel()->getEventTypes().at(id).location;
@@ -294,19 +294,19 @@ QVariantMap RangeTimelineModel::location(int index) const
return result;
}
-int RangeTimelineModel::eventIdForTypeIndex(int typeIndex) const
+bool RangeTimelineModel::isSelectionIdValid(int typeId) const
{
Q_D(const RangeTimelineModel);
- if (typeIndex < 0)
- return -1;
+ if (typeId < 0)
+ return false;
const QmlProfilerDataModel::QmlEventTypeData &type =
- d->modelManager->qmlModel()->getEventTypes().at(typeIndex);
+ d->modelManager->qmlModel()->getEventTypes().at(typeId);
if (type.message != d->message || type.rangeType != d->rangeType)
- return -1;
- return typeIndex;
+ return false;
+ return true;
}
-int RangeTimelineModel::eventIdForLocation(const QString &filename, int line, int column) const
+int RangeTimelineModel::selectionIdForLocation(const QString &filename, int line, int column) const
{
Q_D(const RangeTimelineModel);
// if this is called from v8 view, we don't have the column number, it will be -1
diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h
index 53fd5feac0..01e96fe4f8 100644
--- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h
+++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h
@@ -49,13 +49,13 @@ class RangeTimelineModel : public AbstractTimelineModel
public:
struct QmlRangeEventStartInstance {
- QmlRangeEventStartInstance(int eventId = -1) :
- eventId(eventId),
+ QmlRangeEventStartInstance(int typeId = -1) :
+ typeId(typeId),
displayRowExpanded(QmlDebug::Constants::QML_MIN_LEVEL),
displayRowCollapsed(QmlDebug::Constants::QML_MIN_LEVEL),
bindingLoopHead(-1) {}
- int eventId;
+ int typeId;
// not-expanded, per type
int displayRowExpanded;
@@ -69,7 +69,7 @@ public:
quint64 features() const;
int row(int index) const;
- int eventId(int index) const;
+ int selectionId(int index) const;
int bindingLoopDest(int index) const;
QColor color(int index) const;
@@ -77,8 +77,8 @@ public:
QVariantMap details(int index) const;
QVariantMap location(int index) const;
- int eventIdForTypeIndex(int typeIndex) const;
- int eventIdForLocation(const QString &filename, int line, int column) const;
+ bool isSelectionIdValid(int typeIndex) const;
+ int selectionIdForLocation(const QString &filename, int line, int column) const;
protected:
void loadData();
diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
index ca47a00b1e..14847e0d4f 100644
--- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
@@ -258,18 +258,17 @@ void QmlProfilerTraceView::clear()
QMetaObject::invokeMethod(d->m_mainView->rootObject(), "clear");
}
-void QmlProfilerTraceView::selectByTypeIndex(int typeIndex)
+void QmlProfilerTraceView::selectByTypeId(int typeId)
{
QQuickItem *rootObject = d->m_mainView->rootObject();
if (!rootObject)
return;
for (int modelIndex = 0; modelIndex < d->m_modelProxy->modelCount(); ++modelIndex) {
- int eventId = d->m_modelProxy->eventIdForTypeIndex(modelIndex, typeIndex);
- if (eventId != -1) {
- QMetaObject::invokeMethod(rootObject, "selectById",
+ if (d->m_modelProxy->isSelectionIdValid(modelIndex, typeId)) {
+ QMetaObject::invokeMethod(rootObject, "selectBySelectionId",
Q_ARG(QVariant,QVariant(modelIndex)),
- Q_ARG(QVariant,QVariant(eventId)));
+ Q_ARG(QVariant,QVariant(typeId)));
return;
}
}
@@ -282,11 +281,11 @@ void QmlProfilerTraceView::selectBySourceLocation(const QString &filename, int l
return;
for (int modelIndex = 0; modelIndex < d->m_modelProxy->modelCount(); ++modelIndex) {
- int eventId = d->m_modelProxy->eventIdForLocation(modelIndex, filename, line, column);
- if (eventId != -1) {
- QMetaObject::invokeMethod(rootObject, "selectById",
+ int typeId = d->m_modelProxy->selectionIdForLocation(modelIndex, filename, line, column);
+ if (typeId != -1) {
+ QMetaObject::invokeMethod(rootObject, "selectBySelectionId",
Q_ARG(QVariant,QVariant(modelIndex)),
- Q_ARG(QVariant,QVariant(eventId)));
+ Q_ARG(QVariant,QVariant(typeId)));
return;
}
}
diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.h b/src/plugins/qmlprofiler/qmlprofilertraceview.h
index f407f20059..7f008555e5 100644
--- a/src/plugins/qmlprofiler/qmlprofilertraceview.h
+++ b/src/plugins/qmlprofiler/qmlprofilertraceview.h
@@ -100,7 +100,7 @@ public:
public slots:
void clear();
- void selectByTypeIndex(int typeIndex);
+ void selectByTypeId(int typeId);
void selectBySourceLocation(const QString &filename, int line, int column);
private slots:
diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
index a0bcebc5f8..2b0f56d332 100644
--- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
@@ -107,8 +107,7 @@ void QmlProfilerViewManager::createViews()
d->eventsView->setWindowTitle(tr("Events"));
connect(d->eventsView, SIGNAL(gotoSourceLocation(QString,int,int)), this,
SIGNAL(gotoSourceLocation(QString,int,int)));
- connect(d->eventsView, SIGNAL(eventSelectedByTypeIndex(int)),
- d->traceView, SLOT(selectByTypeIndex(int)));
+ connect(d->eventsView, SIGNAL(typeSelected(int)), d->traceView, SLOT(selectByTypeId(int)));
connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)),
d->eventsView, SLOT(selectBySourceLocation(QString,int,int)));
diff --git a/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp b/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
index 3fa9e6d997..9fa17bd71e 100644
--- a/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
+++ b/src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
@@ -67,7 +67,7 @@ QV8ProfilerDataModel::QV8EventData &QV8ProfilerDataModel::QV8EventData::operator
totalPercent = ref.totalPercent;
selfTime = ref.selfTime;
SelfTimeInPercent = ref.SelfTimeInPercent;
- eventId = ref.eventId;
+ typeId = ref.typeId;
qDeleteAll(parentHash);
parentHash = cloneEventHash(ref.parentHash);
@@ -81,7 +81,7 @@ QV8ProfilerDataModel::QV8EventData &QV8ProfilerDataModel::QV8EventData::operator
QV8ProfilerDataModel::QV8EventData::QV8EventData()
{
line = -1;
- eventId = -1;
+ typeId = -1;
totalTime = 0;
selfTime = 0;
totalPercent = 0;
@@ -141,11 +141,11 @@ bool QV8ProfilerDataModel::isEmpty() const
return d->v8EventHash.isEmpty();
}
-QV8ProfilerDataModel::QV8EventData *QV8ProfilerDataModel::v8EventDescription(int eventId) const
+QV8ProfilerDataModel::QV8EventData *QV8ProfilerDataModel::v8EventDescription(int typeId) const
{
Q_D(const QV8ProfilerDataModel);
foreach (QV8EventData *event, d->v8EventHash) {
- if (event->eventId == eventId)
+ if (event->typeId == typeId)
return event;
}
return 0;
@@ -287,13 +287,13 @@ void QV8ProfilerDataModel::complete()
int index = d->pendingRewrites.size();
foreach (QV8EventData *v8event, d->v8EventHash.values()) {
- v8event->eventId = index++;
+ v8event->typeId = index++;
d->pendingRewrites << v8event;
d->detailsRewriter->requestDetailsForLocation(index,
QmlDebug::QmlEventLocation(v8event->filename, v8event->line, 1));
}
- d->v8RootEvent.eventId = d->v8EventHash[rootEventHash]->eventId;
+ d->v8RootEvent.typeId = d->v8EventHash[rootEventHash]->typeId;
} else {
// On empty data, still add a fake root event
clearV8RootEvent();
@@ -314,7 +314,7 @@ void QV8ProfilerDataModel::clearV8RootEvent()
d->v8RootEvent.totalPercent = 0;
d->v8RootEvent.selfTime = 0;
d->v8RootEvent.SelfTimeInPercent = 0;
- d->v8RootEvent.eventId = -1;
+ d->v8RootEvent.typeId = -1;
qDeleteAll(d->v8RootEvent.parentHash.values());
qDeleteAll(d->v8RootEvent.childrenHash.values());
@@ -347,7 +347,7 @@ void QV8ProfilerDataModel::save(QXmlStreamWriter &stream)
QStringList childrenTimes;
QStringList parentTimes;
foreach (const QV8EventSub *v8child, v8event->childrenHash) {
- childrenIndexes << QString::number(v8child->reference->eventId);
+ childrenIndexes << QString::number(v8child->reference->typeId);
childrenTimes << QString::number(v8child->totalTime);
parentTimes << QString::number(v8child->totalTime);
}
diff --git a/src/plugins/qmlprofiler/qv8profilerdatamodel.h b/src/plugins/qmlprofiler/qv8profilerdatamodel.h
index 26755295eb..0c71018c19 100644
--- a/src/plugins/qmlprofiler/qv8profilerdatamodel.h
+++ b/src/plugins/qmlprofiler/qv8profilerdatamodel.h
@@ -63,7 +63,7 @@ public:
double SelfTimeInPercent;
QHash <QString, QV8EventSub *> parentHash;
QHash <QString, QV8EventSub *> childrenHash;
- int eventId;
+ int typeId;
QV8EventData &operator=(const QV8EventData &ref);
};
@@ -81,7 +81,7 @@ public:
void clear();
bool isEmpty() const;
QList<QV8EventData *> getV8Events() const;
- QV8EventData *v8EventDescription(int eventId) const;
+ QV8EventData *v8EventDescription(int typeId) const;
qint64 v8MeasuredTime() const;
diff --git a/src/plugins/qmlprofiler/qv8profilereventview.cpp b/src/plugins/qmlprofiler/qv8profilereventview.cpp
index cd8197fb9d..89a1fed64f 100644
--- a/src/plugins/qmlprofiler/qv8profilereventview.cpp
+++ b/src/plugins/qmlprofiler/qv8profilereventview.cpp
@@ -61,7 +61,7 @@ enum ItemRole {
SortRole = Qt::UserRole + 1, // Sort by data, not by displayed text
FilenameRole,
LineRole,
- EventIdRole
+ TypeIdRole
};
////////////////////////////////////////////////////////////////////////////////////
@@ -132,10 +132,10 @@ QV8ProfilerEventsWidget::QV8ProfilerEventsWidget(QWidget *parent,
d->m_eventParents = new QV8ProfilerEventRelativesView(d->v8Model,
QV8ProfilerEventRelativesView::ParentsView,
this);
- connect(d->m_eventTree, SIGNAL(eventSelected(int)), d->m_eventChildren, SLOT(displayEvent(int)));
- connect(d->m_eventTree, SIGNAL(eventSelected(int)), d->m_eventParents, SLOT(displayEvent(int)));
- connect(d->m_eventChildren, SIGNAL(eventClicked(int)), d->m_eventTree, SLOT(selectEvent(int)));
- connect(d->m_eventParents, SIGNAL(eventClicked(int)), d->m_eventTree, SLOT(selectEvent(int)));
+ connect(d->m_eventTree, SIGNAL(typeSelected(int)), d->m_eventChildren, SLOT(displayType(int)));
+ connect(d->m_eventTree, SIGNAL(typeSelected(int)), d->m_eventParents, SLOT(displayType(int)));
+ connect(d->m_eventChildren, SIGNAL(typeClicked(int)), d->m_eventTree, SLOT(selectType(int)));
+ connect(d->m_eventParents, SIGNAL(typeClicked(int)), d->m_eventTree, SLOT(selectType(int)));
connect(d->v8Model, SIGNAL(changed()), this, SLOT(updateEnabledState()));
// widget arrangement
@@ -242,10 +242,10 @@ void QV8ProfilerEventsWidget::copyRowToClipboard() const
d->m_eventTree->copyRowToClipboard();
}
-void QV8ProfilerEventsWidget::updateSelectedEvent(int eventId) const
+void QV8ProfilerEventsWidget::updateSelectedType(int typeId) const
{
- if (d->m_eventTree->selectedEventId() != eventId)
- d->m_eventTree->selectEvent(eventId);
+ if (d->m_eventTree->selectedTypeId() != typeId)
+ d->m_eventTree->selectType(typeId);
}
void QV8ProfilerEventsWidget::selectBySourceLocation(const QString &filename, int line, int column)
@@ -474,7 +474,7 @@ void QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate::buildV8ModelFr
QStandardItem *firstItem = newRow.at(0);
firstItem->setData(QVariant(v8event->filename), FilenameRole);
firstItem->setData(QVariant(v8event->line), LineRole);
- firstItem->setData(QVariant(v8event->eventId), EventIdRole);
+ firstItem->setData(QVariant(v8event->typeId), TypeIdRole);
// append
m_model->invisibleRootItem()->appendRow(newRow);
@@ -482,13 +482,13 @@ void QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate::buildV8ModelFr
}
}
-int QV8ProfilerEventsMainView::selectedEventId() const
+int QV8ProfilerEventsMainView::selectedTypeId() const
{
QModelIndex index = selectedItem();
if (!index.isValid())
return -1;
QStandardItem *item = d->m_model->item(index.row(), 0);
- return item->data(EventIdRole).toInt();
+ return item->data(TypeIdRole).toInt();
}
void QV8ProfilerEventsMainView::jumpToItem(const QModelIndex &index)
@@ -511,16 +511,16 @@ void QV8ProfilerEventsMainView::jumpToItem(const QModelIndex &index)
emit gotoSourceLocation(fileName, line, -1);
// show in callers/callees subwindow
- emit eventSelected(infoItem->data(EventIdRole).toInt());
+ emit typeSelected(infoItem->data(TypeIdRole).toInt());
d->m_preventSelectBounce = false;
}
-void QV8ProfilerEventsMainView::selectEvent(int eventId)
+void QV8ProfilerEventsMainView::selectType(int typeId)
{
for (int i=0; i<d->m_model->rowCount(); i++) {
QStandardItem *infoItem = d->m_model->item(i, 0);
- if (infoItem->data(EventIdRole).toInt() == eventId) {
+ if (infoItem->data(TypeIdRole).toInt() == typeId) {
setCurrentIndex(d->m_model->indexFromItem(infoItem));
jumpToItem(currentIndex());
return;
@@ -639,7 +639,7 @@ QV8ProfilerEventRelativesView::~QV8ProfilerEventRelativesView()
{
}
-void QV8ProfilerEventRelativesView::displayEvent(int index)
+void QV8ProfilerEventRelativesView::displayType(int index)
{
QV8ProfilerDataModel::QV8EventData *event = m_v8Model->v8EventDescription(index);
QTC_CHECK(event);
@@ -670,7 +670,7 @@ void QV8ProfilerEventRelativesView::rebuildTree(QList<QV8ProfilerDataModel::QV8E
newRow << new V8ViewItem(QmlProfilerBaseModel::formatTime(event->totalTime));
newRow << new V8ViewItem(event->reference->functionName);
- newRow.at(0)->setData(QVariant(event->reference->eventId), EventIdRole);
+ newRow.at(0)->setData(QVariant(event->reference->typeId), TypeIdRole);
newRow.at(0)->setData(QVariant(event->reference->filename), FilenameRole);
newRow.at(0)->setData(QVariant(event->reference->line), LineRole);
newRow.at(1)->setData(QVariant(event->totalTime));
@@ -709,7 +709,7 @@ void QV8ProfilerEventRelativesView::updateHeader()
void QV8ProfilerEventRelativesView::jumpToItem(const QModelIndex &index)
{
QStandardItem *infoItem = m_model->item(index.row(), 0);
- emit eventClicked(infoItem->data(EventIdRole).toInt());
+ emit typeClicked(infoItem->data(TypeIdRole).toInt());
}
} // namespace Internal
diff --git a/src/plugins/qmlprofiler/qv8profilereventview.h b/src/plugins/qmlprofiler/qv8profilereventview.h
index 5f7f63fc76..226d381161 100644
--- a/src/plugins/qmlprofiler/qv8profilereventview.h
+++ b/src/plugins/qmlprofiler/qv8profilereventview.h
@@ -72,7 +72,7 @@ signals:
void resized();
public slots:
- void updateSelectedEvent(int eventId) const;
+ void updateSelectedType(int typeId) const;
void selectBySourceLocation(const QString &filename, int line, int column);
void updateEnabledState();
@@ -101,19 +101,19 @@ public:
void copyTableToClipboard() const;
void copyRowToClipboard() const;
- int selectedEventId() const;
+ int selectedTypeId() const;
void setShowExtendedStatistics(bool);
bool showExtendedStatistics() const;
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
- void eventSelected(int eventId);
+ void typeSelected(int typeId);
public slots:
void clear();
void jumpToItem(const QModelIndex &index);
- void selectEvent(int eventId);
+ void selectType(int typeId);
void selectEventByLocation(const QString &filename, int line);
void buildModel();
@@ -139,10 +139,10 @@ public:
~QV8ProfilerEventRelativesView();
signals:
- void eventClicked(int eventId);
+ void typeClicked(int typeId);
public slots:
- void displayEvent(int eventId);
+ void displayType(int typeId);
void jumpToItem(const QModelIndex &);
void clear();
diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp
index aefa41da00..30c28736a1 100644
--- a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp
+++ b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp
@@ -220,9 +220,9 @@ qint64 TimelineModelAggregator::endTime(int modelIndex, int index) const
return d->modelList[modelIndex]->endTime(index);
}
-int TimelineModelAggregator::eventId(int modelIndex, int index) const
+int TimelineModelAggregator::selectionId(int modelIndex, int index) const
{
- return d->modelList[modelIndex]->eventId(index);
+ return d->modelList[modelIndex]->selectionId(index);
}
int TimelineModelAggregator::bindingLoopDest(int modelIndex,int index) const
@@ -255,15 +255,15 @@ QVariantMap TimelineModelAggregator::location(int modelIndex, int index) const
return d->modelList[modelIndex]->location(index);
}
-int TimelineModelAggregator::eventIdForTypeIndex(int modelIndex, int typeIndex) const
+bool TimelineModelAggregator::isSelectionIdValid(int modelIndex, int typeIndex) const
{
- return d->modelList[modelIndex]->eventIdForTypeIndex(typeIndex);
+ return d->modelList[modelIndex]->isSelectionIdValid(typeIndex);
}
-int TimelineModelAggregator::eventIdForLocation(int modelIndex, const QString &filename,
+int TimelineModelAggregator::selectionIdForLocation(int modelIndex, const QString &filename,
int line, int column) const
{
- return d->modelList[modelIndex]->eventIdForLocation(filename, line, column);
+ return d->modelList[modelIndex]->selectionIdForLocation(filename, line, column);
}
void TimelineModelAggregator::swapModels(int modelIndex1, int modelIndex2)
diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.h b/src/plugins/qmlprofiler/timelinemodelaggregator.h
index 6cffaf5bbe..2367170102 100644
--- a/src/plugins/qmlprofiler/timelinemodelaggregator.h
+++ b/src/plugins/qmlprofiler/timelinemodelaggregator.h
@@ -82,7 +82,7 @@ public:
Q_INVOKABLE qint64 duration(int modelIndex, int index) const;
Q_INVOKABLE qint64 startTime(int modelIndex, int index) const;
Q_INVOKABLE qint64 endTime(int modelIndex, int index) const;
- Q_INVOKABLE int eventId(int modelIndex, int index) const;
+ Q_INVOKABLE int selectionId(int modelIndex, int index) const;
Q_INVOKABLE int bindingLoopDest(int modelIndex, int index) const;
Q_INVOKABLE QColor color(int modelIndex, int index) const;
Q_INVOKABLE float relativeHeight(int modelIndex, int index) const;
@@ -92,8 +92,8 @@ public:
Q_INVOKABLE QVariantMap details(int modelIndex, int index) const;
Q_INVOKABLE QVariantMap location(int modelIndex, int index) const;
- Q_INVOKABLE int eventIdForTypeIndex(int modelIndex, int typeIndex) const;
- Q_INVOKABLE int eventIdForLocation(int modelIndex, const QString &filename, int line,
+ Q_INVOKABLE bool isSelectionIdValid(int modelIndex, int typeIndex) const;
+ Q_INVOKABLE int selectionIdForLocation(int modelIndex, const QString &filename, int line,
int column) const;
Q_INVOKABLE void swapModels(int modelIndex1, int modelIndex2);
diff --git a/src/plugins/qmlprofiler/timelinerenderer.cpp b/src/plugins/qmlprofiler/timelinerenderer.cpp
index 50f536290b..b692747df7 100644
--- a/src/plugins/qmlprofiler/timelinerenderer.cpp
+++ b/src/plugins/qmlprofiler/timelinerenderer.cpp
@@ -199,7 +199,7 @@ void TimelineRenderer::drawSelectionBoxes(QPainter *p, int modelIndex, int fromI
return;
- int id = m_profilerModelProxy->eventId(modelIndex, m_selectedItem);
+ int id = m_profilerModelProxy->selectionId(modelIndex, m_selectedItem);
int modelRowStart = 0;
for (int mi = 0; mi < modelIndex; mi++)
@@ -219,7 +219,7 @@ void TimelineRenderer::drawSelectionBoxes(QPainter *p, int modelIndex, int fromI
int currentX, currentY, itemWidth;
QRect selectedItemRect(0,0,0,0);
for (int i = fromIndex; i <= toIndex; i++) {
- if (m_profilerModelProxy->eventId(modelIndex, i) != id)
+ if (m_profilerModelProxy->selectionId(modelIndex, i) != id)
continue;
int row = m_profilerModelProxy->row(modelIndex, i);
@@ -377,11 +377,11 @@ void TimelineRenderer::manageClicked()
// itemPressed() will trigger an update of the events and JavaScript views. Make sure the
// correct event is already selected when that happens, to prevent confusion.
- selectFromId(m_currentSelection.modelIndex, m_currentSelection.eventIndex);
+ selectFromEventIndex(m_currentSelection.modelIndex, m_currentSelection.eventIndex);
emit itemPressed(m_currentSelection.modelIndex, m_currentSelection.eventIndex);
} else {
setSelectionLocked(false);
- selectFromId(m_currentSelection.modelIndex, m_currentSelection.eventIndex);
+ selectFromEventIndex(m_currentSelection.modelIndex, m_currentSelection.eventIndex);
}
}
@@ -436,7 +436,7 @@ void TimelineRenderer::manageHovered(int mouseX, int mouseY)
m_currentSelection.row = row;
m_currentSelection.modelIndex = modelIndex;
if (!m_selectionLocked)
- selectFromId(modelIndex, i);
+ selectFromEventIndex(modelIndex, i);
return;
}
}
@@ -528,7 +528,7 @@ void TimelineRenderer::selectNext()
}
}
- selectFromId(candidateModelIndex, itemIndex);
+ selectFromEventIndex(candidateModelIndex, itemIndex);
}
void TimelineRenderer::selectPrev()
@@ -580,10 +580,10 @@ void TimelineRenderer::selectPrev()
}
}
- selectFromId(candidateModelIndex, itemIndex);
+ selectFromEventIndex(candidateModelIndex, itemIndex);
}
-int TimelineRenderer::nextItemFromId(int modelIndex, int eventId) const
+int TimelineRenderer::nextItemFromSelectionId(int modelIndex, int selectionId) const
{
int ndx = -1;
if (m_selectedItem == -1)
@@ -596,14 +596,14 @@ int TimelineRenderer::nextItemFromId(int modelIndex, int eventId) const
ndx = 0;
int startIndex = ndx;
do {
- if (m_profilerModelProxy->eventId(modelIndex, ndx) == eventId)
+ if (m_profilerModelProxy->selectionId(modelIndex, ndx) == selectionId)
return ndx;
ndx = (ndx + 1) % m_profilerModelProxy->count(modelIndex);
} while (ndx != startIndex);
return -1;
}
-int TimelineRenderer::prevItemFromId(int modelIndex, int eventId) const
+int TimelineRenderer::prevItemFromSelectionId(int modelIndex, int selectionId) const
{
int ndx = -1;
if (m_selectedItem == -1)
@@ -614,7 +614,7 @@ int TimelineRenderer::prevItemFromId(int modelIndex, int eventId) const
ndx = m_profilerModelProxy->count(modelIndex) - 1;
int startIndex = ndx;
do {
- if (m_profilerModelProxy->eventId(modelIndex, ndx) == eventId)
+ if (m_profilerModelProxy->selectionId(modelIndex, ndx) == selectionId)
return ndx;
if (--ndx < 0)
ndx = m_profilerModelProxy->count(modelIndex)-1;
@@ -622,7 +622,7 @@ int TimelineRenderer::prevItemFromId(int modelIndex, int eventId) const
return -1;
}
-void TimelineRenderer::selectFromId(int modelIndex, int eventIndex)
+void TimelineRenderer::selectFromEventIndex(int modelIndex, int eventIndex)
{
if (modelIndex != m_selectedModel || eventIndex != m_selectedItem) {
setSelectedModel(modelIndex);
@@ -631,12 +631,12 @@ void TimelineRenderer::selectFromId(int modelIndex, int eventIndex)
}
}
-void TimelineRenderer::selectNextFromId(int modelIndex, int eventId)
+void TimelineRenderer::selectNextFromSelectionId(int modelIndex, int typeId)
{
- selectFromId(modelIndex, nextItemFromId(modelIndex, eventId));
+ selectFromEventIndex(modelIndex, nextItemFromSelectionId(modelIndex, typeId));
}
-void TimelineRenderer::selectPrevFromId(int modelIndex, int eventId)
+void TimelineRenderer::selectPrevFromSelectionId(int modelIndex, int typeId)
{
- selectFromId(modelIndex, prevItemFromId(modelIndex, eventId));
+ selectFromEventIndex(modelIndex, prevItemFromSelectionId(modelIndex, typeId));
}
diff --git a/src/plugins/qmlprofiler/timelinerenderer.h b/src/plugins/qmlprofiler/timelinerenderer.h
index d4e2d620d4..cb07e8765c 100644
--- a/src/plugins/qmlprofiler/timelinerenderer.h
+++ b/src/plugins/qmlprofiler/timelinerenderer.h
@@ -95,11 +95,11 @@ public:
Q_INVOKABLE void selectNext();
Q_INVOKABLE void selectPrev();
- Q_INVOKABLE int nextItemFromId(int modelIndex, int eventId) const;
- Q_INVOKABLE int prevItemFromId(int modelIndex, int eventId) const;
- Q_INVOKABLE void selectFromId(int modelIndex, int eventId);
- Q_INVOKABLE void selectNextFromId(int modelIndex, int eventId);
- Q_INVOKABLE void selectPrevFromId(int modelIndex, int eventId);
+ Q_INVOKABLE int nextItemFromSelectionId(int modelIndex, int selectionId) const;
+ Q_INVOKABLE int prevItemFromSelectionId(int modelIndex, int selectionId) const;
+ Q_INVOKABLE void selectFromEventIndex(int modelIndex, int index);
+ Q_INVOKABLE void selectNextFromSelectionId(int modelIndex, int selectionId);
+ Q_INVOKABLE void selectPrevFromSelectionId(int modelIndex, int selectionId);
signals:
void startTimeChanged(qint64 arg);