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