[qt] WIP: organize drawPrimitive