QPainter not drawing the rectangle on QLabel
I am displaying image on q QLabel and want to draw a rectangle on it with mouse movement
Image is loaded correctly and selectionRect has correct co-ordinates. Its co-ordinates are changing with mouse move.
However, This painEvent is not painting. Could someone help me on this?
void XWizardPage :: paintEvent(QPaintEvent * e)
Secondly, How can I draw multiple rectangles on my QLabel?
Found the mistake, I was not setting image back to the label.
Added the following line and it works more than perfect.
How can I avoid the "intermediate drawings":http://tinypic.com/r/2nswhh0/8?
[quote author="tesmai4" date="1406043994"]How can I avoid the "intermediate drawings":http://tinypic.com/r/2nswhh0/8?
I guess you need to redraw the part of image that is covered by previous rectangle and then draw your new rectangle.
BTW(By The Way) If you trying to implement a selection rectangle then take a look on "QRubberBand":http://qt-project.org/doc/qt-5/qrubberband.html#details