如何沿固定路径拖动项目? [在 Qt 图形视图中]

How to drag an item along a fixed path? [in Qt Graphics View]

如何使像图中红色的对象沿着白线拖动,使其随着线的弯曲而旋转并固定在线上?

在 Qt 中使用 GraphicsItem。

正如丹尼尔·桑切斯所说:

get the circle radius, ofsset you box, rotate over the circle center, learn some math