Effective Qt (2017 edition)
summary
Recommendation: prefer std::vector/map/etc for business logic because Qt containers are older, slower, lack allocators/emplace/node APIs and still require default‑constructible, copyable types; Qt containers use implicit sharing causes hidden detaches (copy‑on‑write) that can trigger unexpected deep copies or bugs; avoid QList and Q_FOREACH; use QVarLengthArray only for small preallocated buffers; adopt QStringView (Qt 5.10) for alloc‑free string parameters; and run clazy — it reports thousands of Qt pitfalls (about 9,000 warnings found in Qt itself).
AI-written summary · about
chapters (11)
- 0:00Introduction and overview
- 1:50Qt containers vs Standard Library
- 8:56Why avoid Qt containers
- 13:10Type traits for Qt containers
- 21:48Implicit sharing in Qt
- 31:28Pitfalls of implicit sharing
- 35:20Range-based for loops in Qt
- 39:52Clazy tool for Qt code
- 41:35Qt string classes overview
- 48:24QStringView introduction
- 52:19Q&A session
related talks
55mKEYNOTE: Qt Containers and Algorithms
52musing namespace std;
56mIdentifying Common Code Smells
01h 29mValue-oriented design in an object-oriented system
01h 31mNew (& Old) C++ Standard Library Containers - How to Choose the Right Container in C++26 and Beyond
52mC++ Performance Tips - Cutting Down on Unnecessary Objects
01h 00mEnough string_view to hang ourselves
01h 01mRecipes for Reducing Allocations by C++ Containers
