API Design and QML
summary
Defines two concrete QML API kinds — visual leaves (controls) and container branches (layouts) — and gives exact rules: inherit from Control/AbstractButton for clickable widgets, drive sizing from implicitWidth/implicitHeight, keep backgrounds subservient, tolerate bad inputs, and use attached properties for child→parent data. Describes the annotation pattern and cites qbs as a non‑visual example. Implements a PageRouter (pagefounder) inspired by React/Flutter using attached properties with methods like push/pop/navigateTo and documents it with diagrams; implementation is complete and used.
AI-written summary · about
chapters (9)
- 0:00Introduction to API design
- 1:13Types of QML APIs
- 3:52Designing leaf components
- 5:58Designing branch components
- 7:43Non-visual QML APIs
- 10:13General API design guidelines
- 13:47Documentation best practices
- 14:07Case study: Page router API
- 17:59Q&A
related talks
01h 08mNew Qt APIs for Mobile Development: Mobility I
47mAPI Design Principles
28mUnlocking Seamless Collaboration: Design-First APIs for Components
01h 05mAPI design - tips from practice
44mDesigning Hypermedia APIs
27mAPI Design Through the Lens of Photography
20mAPI-first package design — and learning patchwork in the process
38mDeep Dive: API Machinery SIG
