forked from qt-creator/qt-creator
QmlProfiler: Rename qmlProfilerModelProxy to timelineModelAggregator
This makes it much easier to deduct where it's coming from. Change-Id: Ica85e1df0a03a01c1b319b3523fb5746e6c2d8f8 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -82,7 +82,7 @@ Rectangle {
|
|||||||
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: qmlProfilerModelProxy
|
target: timelineModelAggregator
|
||||||
onDataAvailable: {
|
onDataAvailable: {
|
||||||
content.clearChildren();
|
content.clearChildren();
|
||||||
zoomControl.setRange(zoomControl.traceStart,
|
zoomControl.setRange(zoomControl.traceStart,
|
||||||
@@ -116,20 +116,20 @@ Rectangle {
|
|||||||
|
|
||||||
var itemIndex = -1;
|
var itemIndex = -1;
|
||||||
var modelIndex = -1;
|
var modelIndex = -1;
|
||||||
var notes = qmlProfilerModelProxy.notesByTypeId(typeId);
|
var notes = timelineModelAggregator.notesByTypeId(typeId);
|
||||||
if (notes.length !== 0) {
|
if (notes.length !== 0) {
|
||||||
modelIndex = qmlProfilerModelProxy.noteTimelineModel(notes[0]);
|
modelIndex = timelineModelAggregator.noteTimelineModel(notes[0]);
|
||||||
itemIndex = qmlProfilerModelProxy.noteTimelineIndex(notes[0]);
|
itemIndex = timelineModelAggregator.noteTimelineIndex(notes[0]);
|
||||||
} else {
|
} else {
|
||||||
for (modelIndex = 0; modelIndex < qmlProfilerModelProxy.models.length; ++modelIndex) {
|
for (modelIndex = 0; modelIndex < timelineModelAggregator.models.length; ++modelIndex) {
|
||||||
if (modelIndex === selectedModel && selectedItem !== -1 &&
|
if (modelIndex === selectedModel && selectedItem !== -1 &&
|
||||||
typeId === qmlProfilerModelProxy.models[modelIndex].typeId(selectedItem))
|
typeId === timelineModelAggregator.models[modelIndex].typeId(selectedItem))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!qmlProfilerModelProxy.models[modelIndex].handlesTypeId(typeId))
|
if (!timelineModelAggregator.models[modelIndex].handlesTypeId(typeId))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
itemIndex = qmlProfilerModelProxy.models[modelIndex].nextItemByTypeId(typeId,
|
itemIndex = timelineModelAggregator.models[modelIndex].nextItemByTypeId(typeId,
|
||||||
zoomControl.rangeStart, selectedItem);
|
zoomControl.rangeStart, selectedItem);
|
||||||
if (itemIndex !== -1)
|
if (itemIndex !== -1)
|
||||||
break;
|
break;
|
||||||
@@ -158,7 +158,7 @@ Rectangle {
|
|||||||
selectedModel: root.selectedModel
|
selectedModel: root.selectedModel
|
||||||
selectedItem: root.selectedItem
|
selectedItem: root.selectedItem
|
||||||
color: root.color
|
color: root.color
|
||||||
modelProxy: qmlProfilerModelProxy
|
modelProxy: timelineModelAggregator
|
||||||
zoomer: zoomControl
|
zoomer: zoomControl
|
||||||
reverseSelect: shiftPressed
|
reverseSelect: shiftPressed
|
||||||
|
|
||||||
@@ -187,12 +187,12 @@ Rectangle {
|
|||||||
onZoomControlChanged: zoomSliderToolBar.visible = !zoomSliderToolBar.visible
|
onZoomControlChanged: zoomSliderToolBar.visible = !zoomSliderToolBar.visible
|
||||||
onFilterMenuChanged: filterMenu.visible = !filterMenu.visible
|
onFilterMenuChanged: filterMenu.visible = !filterMenu.visible
|
||||||
onJumpToNext: {
|
onJumpToNext: {
|
||||||
var next = qmlProfilerModelProxy.nextItem(root.selectedModel, root.selectedItem,
|
var next = timelineModelAggregator.nextItem(root.selectedModel, root.selectedItem,
|
||||||
zoomControl.rangeStart);
|
zoomControl.rangeStart);
|
||||||
content.select(next.model, next.item);
|
content.select(next.model, next.item);
|
||||||
}
|
}
|
||||||
onJumpToPrev: {
|
onJumpToPrev: {
|
||||||
var prev = qmlProfilerModelProxy.prevItem(root.selectedModel, root.selectedItem,
|
var prev = timelineModelAggregator.prevItem(root.selectedModel, root.selectedItem,
|
||||||
zoomControl.rangeEnd);
|
zoomControl.rangeEnd);
|
||||||
content.select(prev.model, prev.item);
|
content.select(prev.model, prev.item);
|
||||||
}
|
}
|
||||||
@@ -209,7 +209,7 @@ Rectangle {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
selectionLocked: true
|
selectionLocked: true
|
||||||
zoomer: zoomControl
|
zoomer: zoomControl
|
||||||
modelProxy: qmlProfilerModelProxy
|
modelProxy: timelineModelAggregator
|
||||||
|
|
||||||
onSelectionLockedChanged: {
|
onSelectionLockedChanged: {
|
||||||
buttonsBar.updateLockButton(selectionLocked);
|
buttonsBar.updateLockButton(selectionLocked);
|
||||||
@@ -230,7 +230,7 @@ Rectangle {
|
|||||||
rangeDetails.showInfo(selectedModel, selectedItem);
|
rangeDetails.showInfo(selectedModel, selectedItem);
|
||||||
|
|
||||||
// update in other views
|
// update in other views
|
||||||
var model = qmlProfilerModelProxy.models[selectedModel];
|
var model = timelineModelAggregator.models[selectedModel];
|
||||||
var eventLocation = model.location(selectedItem);
|
var eventLocation = model.location(selectedItem);
|
||||||
gotoSourceLocation(eventLocation.file, eventLocation.line,
|
gotoSourceLocation(eventLocation.file, eventLocation.line,
|
||||||
eventLocation.column);
|
eventLocation.column);
|
||||||
@@ -344,8 +344,8 @@ Rectangle {
|
|||||||
y: 25
|
y: 25
|
||||||
|
|
||||||
property alias locked: content.selectionLocked
|
property alias locked: content.selectionLocked
|
||||||
models: qmlProfilerModelProxy.models
|
models: timelineModelAggregator.models
|
||||||
notes: qmlProfilerModelProxy.notes
|
notes: timelineModelAggregator.notes
|
||||||
onRecenterOnItem: {
|
onRecenterOnItem: {
|
||||||
content.gotoSourceLocation(file, line, column);
|
content.gotoSourceLocation(file, line, column);
|
||||||
content.select(selectedModel, selectedItem)
|
content.select(selectedModel, selectedItem)
|
||||||
@@ -374,11 +374,11 @@ Rectangle {
|
|||||||
width: buttonsBar.width
|
width: buttonsBar.width
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: buttonsBar.bottom
|
anchors.top: buttonsBar.bottom
|
||||||
height: qmlProfilerModelProxy.models.length * buttonsBar.height
|
height: timelineModelAggregator.models.length * buttonsBar.height
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: filterMenuInner
|
id: filterMenuInner
|
||||||
model: qmlProfilerModelProxy.models
|
model: timelineModelAggregator.models
|
||||||
CheckBox {
|
CheckBox {
|
||||||
anchors.left: filterMenu.left
|
anchors.left: filterMenu.left
|
||||||
anchors.right: filterMenu.right
|
anchors.right: filterMenu.right
|
||||||
@@ -438,7 +438,7 @@ Rectangle {
|
|||||||
var fixedPoint = (zoomControl.rangeStart + zoomControl.rangeEnd) / 2;
|
var fixedPoint = (zoomControl.rangeStart + zoomControl.rangeEnd) / 2;
|
||||||
if (root.selectedItem !== -1) {
|
if (root.selectedItem !== -1) {
|
||||||
// center on selected item if it's inside the current screen
|
// center on selected item if it's inside the current screen
|
||||||
var model = qmlProfilerModelProxy.models[root.selectedModel]
|
var model = timelineModelAggregator.models[root.selectedModel]
|
||||||
var newFixedPoint = (model.startTime(root.selectedItem) +
|
var newFixedPoint = (model.startTime(root.selectedItem) +
|
||||||
model.endTime(root.selectedItem)) / 2;
|
model.endTime(root.selectedItem)) / 2;
|
||||||
if (newFixedPoint >= zoomControl.rangeStart &&
|
if (newFixedPoint >= zoomControl.rangeStart &&
|
||||||
@@ -458,7 +458,7 @@ Rectangle {
|
|||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
modelProxy: qmlProfilerModelProxy
|
modelProxy: timelineModelAggregator
|
||||||
zoomer: zoomControl
|
zoomer: zoomControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT
|
|||||||
|
|
||||||
d->m_modelProxy = new TimelineModelAggregator(modelManager->notesModel(), this);
|
d->m_modelProxy = new TimelineModelAggregator(modelManager->notesModel(), this);
|
||||||
setModelManager(modelManager);
|
setModelManager(modelManager);
|
||||||
d->m_mainView->rootContext()->setContextProperty(QLatin1String("qmlProfilerModelProxy"),
|
d->m_mainView->rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"),
|
||||||
d->m_modelProxy);
|
d->m_modelProxy);
|
||||||
d->m_profilerState = profilerState;
|
d->m_profilerState = profilerState;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user