I am using the QGraphicsScene in Qt5 to add different QGraphicsItems. Some of them have further child items, some not. But now I need the possibility to find all top-level items. Surely, I could write a method, which would use the QList<QGraphicsItem *> QGraphicsScene::items(...) const
method and then iterating through the returned list, looking for all items, that would return 0
as their parent. But probably the returned list will be long with only very few top-level items.
So, is there any better solution?