Drawing text on the screen?
-
I need to draw graphics and text on the screen. I've googled a bit and people recommended using a transparent widget in which I could override the paintEvent, and so I did, the problem is that I need the things drawn to sometimes move around on the screen relatively fast and that results in stuff like text becoming very hard to read (when calling widget->move(x, y) frequently).
So I was hoping there might be a better way to do graphics drawing so I can move things like text around without making it blurry, or what you'd call it...? -
Hi and welcome to devnet,
One way can be to draw it once on a QImage and then draw that QImage in the paint event. You will have to refresh the QImage when the widget is resized.
-
Hi
QPixmap could also be used in this use case. But since he sounds like
he plan to alter the image (manipulate) then QImage is suggested.https://stackoverflow.com/questions/10307860/what-is-the-difference-between-qimage-and-qpixmap
-
@mrjj I read the same item you provided the link to, but I did not get the idea that there was a plan to manipulate the image. If there was no manipulation of the image, just drawing on the display widget, then is one choice better that the other?
-