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:
@@ -394,15 +394,12 @@ public:
|
||||
quint64 addrstep;
|
||||
};
|
||||
|
||||
static bool sortByName(const Utils::TreeItem *a, const Utils::TreeItem *b)
|
||||
static bool sortByName(const WatchItem *a, const WatchItem *b)
|
||||
{
|
||||
auto aa = static_cast<const WatchItem *>(a);
|
||||
auto bb = static_cast<const WatchItem *>(b);
|
||||
if (a->sortGroup != b->sortGroup)
|
||||
return a->sortGroup > b->sortGroup;
|
||||
|
||||
if (aa->sortGroup != bb->sortGroup)
|
||||
return aa->sortGroup > bb->sortGroup;
|
||||
|
||||
return aa->name < bb->name;
|
||||
return a->name < b->name;
|
||||
}
|
||||
|
||||
void WatchItem::parseHelper(const GdbMi &input, bool maySort)
|
||||
|
||||
Reference in New Issue
Block a user