Lazy QObject tree traversal
summary
Claim: implement a lazy, composable QObject children view so traversal yields objects on demand rather than building a QList. Uses C++20 coroutines and ranges-v3 with a cppcoro generator and a single-pass cursor to compose filters by type/name/regex. Built a children_view and pipeable filters; full-tree traversal performs about the same as Qt’s eager children() up to ~1M elements, type-filtering is slower, a std::vector fallback is competitive, and current coroutine state memory use is higher and needs optimization.
AI-written summary · about
chapters (24)
- 0:00Intro
- 1:53About Qt
- 3:17About QObject
- 4:43QObject trees
- 5:38Tree traversing
- 7:00findChildren implementation
- 11:09Toolbox
- 12:21Coroutines in C++: core definitions
- 13:24Coroutines in C++: implementation
- 14:00Coroutines in C++: libraries
- 14:39Coroutines in C++: usage example
- 15:57Lazy traversal with coroutines: implementation
- 17:14Lazy traversal with coroutines: usage example
- 18:17Implementation without coroutines
- 20:08Ranges in C++: example
- 21:33Everything is lazy!
- 22:42Create a new view
- 24:15Create a cursor (single-pass)
- 26:13Basic functionality implementation constexpr auto children
- 29:03QObject tree traversal
- 29:44Filter by type, name, and regex
- 30:38Make a copy
- 31:30Test environment
- 37:15Useful links
related talks
01h 21mAdvanced Qt - A Deep Dive 6/6 - ModelView Part 2
01h 29mValue-oriented design in an object-oriented system
01h 28mUnderstanding the Filter View to Use It Right
01h 01mEffective Qt (2017 edition)
01h 25mAdvanced Qt -A Deep Dive 1/6 Graphics View Part 1
01h 10mSafe and Readable Code - Monadic Operations in C++23
55mKEYNOTE: Qt Containers and Algorithms
01h 16mC++ Coroutines From Scratch
