Skip to content

SettingHighlighterPrivate: Port children descendants to QCoro generator

ivan tkachenko requested to merge work/ratijas/highlight-generator into master

Depending on amount of descendants this could be simply faster or way more efficient than collecting all items into a one huge list.

The comment about the lifetimes isn't something new introduced by QCoro generators. This has always been the case whenever you store a list of non-owned QObjects without QPointers. Except, with a single huge QList it was built in one go without leaving function boundaries; but with a coroutine a bit of care has to be taken to not modify the object tree in any way. Alternatively (if the current approach ever proves to be problematic), the list of childItems can be converted to a list of QPointers, i.e. every child object to be wrapped in a QPointer before suspension.

Merge request reports