Do you do math and then fill in the right coordinates in the paint events?
I guess yes... You can also have a look at Qt source code as how they do it...am not sure which class though