QmlProfiler: Pass model index to QML when selecting in trace view

This allows more precise specification of which event is supposed to be
selected.

Task-number: QTCREATORBUG-11945
Change-Id: Iff2e9bb8569711cc5df72a5ca55956e0091d6163
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-06-12 13:08:08 +02:00
parent 17febac88b
commit eef83495ea
5 changed files with 34 additions and 39 deletions

View File

@@ -158,17 +158,16 @@ Rectangle {
rangeDetails.isBindingLoop = false;
}
function selectById(eventId)
function selectById(modelIndex, eventId)
{
if (eventId === -1 ||
eventId === qmlProfilerModelProxy.getEventId(view.selectedModel, view.selectedItem))
if (eventId === -1 || (modelIndex === view.selectedModel &&
eventId === qmlProfilerModelProxy.getEventId(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 modelIndex = qmlProfilerModelProxy.basicModelIndex();
var itemIndex = view.nextItemFromId(modelIndex, eventId);
// select an item, lock to it, and recenter if necessary
view.selectFromId(modelIndex, itemIndex); // triggers recentering