I am working on a project that I need to draw, for example, a rectangle every time the QPushButton
is pressed using QPainter
. This is the first problem, the second one here is that I need some information to be sent to the drawing function too, for example, a list containing tuples, each tuple has 4 elements: x1
, y1
, x2
, y2
- the locations of top-left and right-down point (aka. the function is able to draw multiple rectangles).
So, how do I implement it? or use anything other than QPainter
but can do thing like that is also good.