Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
19 March 2015
This video presents the development of a custom polar positioner for Qt Quick that enables declarative positioning of UI elements along circular paths. The presenter addresses the common problem of implementing circular layouts like clock faces and gauges, where developers typically resort to manual mathematical calculations using JavaScript for positioning elements around circles. Instead of this repetitive approach, the solution involves creating a new C++ positioner class that inherits from Qt Quick's private QQuickBasePositioner class.
The implementation adds configurable properties for start/end angles, radius, and direction, allowing developers to use a declarative approach similar to existing Row and Column positioners. The demonstration shows practical applications including animated clock interfaces with automatic element positioning and rotation, with plans to upstream this feature to the official Qt Quick module.