forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user