I try to create something, where you can drop different things on it, like the Qt Creator (no, i don't want to create a new one, but i need the function of that). You drag some elements and drop them anywhere in a tabPane. My problem now is how to make a grid/raster in the background. It should look similar to this:
I mean those dots in the background. If I make them with two for loops, it will take hours and it's not efficient or anything else. There has to be a more efficient solution and a lot easier one.
I'm programming in c++ with Qt as a Framework. Please give me some links or anything else I can use.
You can:
QWidget::paintEvent
documentation,QPoint
in your loops instead of drawing the points, and draw them all with QPainter::drawPoints
after the loop,QPixmap
with transparency and reuse it if the window size didn't change (example from Qt Quaterly).Of course, you should do some testing to see if you gain anything at all by doing any of these optimizations.