forked from qt-creator/qt-creator
Utils: Introduce a class template TypedTreeItem
For better typesafety on the user side (and optional) for items with uniformly typed children. Use it for UniformTreeModels, and consequently WatchModel to get rid of some of the static_casts there. Change-Id: Ic20e507036e180c24997b236230f0f71b285202c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -2418,9 +2418,8 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro
|
||||
}
|
||||
|
||||
if (boolSetting(SortStructMembers)) {
|
||||
parent->sortChildren([](const TreeItem *item1, const TreeItem *item2) -> bool {
|
||||
return static_cast<const WatchItem *>(item1)->name
|
||||
< static_cast<const WatchItem *>(item2)->name;
|
||||
parent->sortChildren([](const WatchItem *item1, const WatchItem *item2) {
|
||||
return item1->name < item2->name;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user