I have a very complex QGraphicsView object and thus I try to keep the number of repaints as small as possible to reduce CPU load.
Now I have a widget ontop of the graphics view. That widget needs to be repainted everytime the mouse pointer moves. The problem is, that this immense repainting causes the graphics view also to be repainted and hence I have a CPU load of 100%.
So I need a way to repaint my widget without the graphics view being repainted automatically too.
I already had some kind of a solution - QWidget::setAttribute(Qt::WA_OpaquePaintEvent) - it really only causes the widget to be repainted and therefore the CPU load is at 0%-1%!
The problem with this solution is, that the background of the widget won't be erased before each paintEvent anymore. This causes my new text to be overlapped with the old text.
So I dunno. I either need a way to "erase" the background before paintEvent or find a way to repaint my widget without notifying its parent
Thank you guys for suggestions!
Bookmarks