Qml Inspector: Sort watch items if SortStructMembers is set

Change-Id: I94f3a9c24df52c1a5689ea6e73d81a526d12bdc4
Task-number: QTCREATORBUG-16645
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2016-07-22 09:37:51 +02:00
parent 30eab176fd
commit 96e877d3ca

View File

@@ -663,6 +663,12 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
propertiesWatch->appendChild(propertyWatch);
}
if (boolSetting(SortStructMembers)) {
propertiesWatch->sortChildren([](const WatchItem *item1, const WatchItem *item2) {
return item1->name < item2->name;
});
}
m_qmlEngine->watchHandler()->insertItem(propertiesWatch);
}