I am developing a video player using pyqt5. I am using QGraphicsVideoItem inside a scene. On top of this videoitem, I also need to have some polygons that move around the scene on each new frame. They track things in the video. Ideally I wan't to get them to move with 30 fps. I did a test run, where I moved 1 polygon by 1 pixel at a speed of 30 fps. I did this with the setPos() function in the QGraphicsPolygonItem. This works, but it is very wonky and each time the polygon you can see it flashing white before being repainted. I think this happens because I am moving it too quickly. Also, this action is running in parallel in a thread.
What I want to know is if there is a way move the polygon the same way it moves when you turn on the "QGraphicsItem.ItemIsSelectable" and "QGraphicsItem.ItemIsMovable" flags and move the item manually. This is very smooth and is what I would like to achieve.
I also tried leaving the points as stationary and instead moving the QGraphicsVideoitem around, this kinda worked (the move was steadier and there was no flashing white) but I could not get the scene to be centered on the videoItem. I tried using "setFocus", but this did not work.
Thank you.