hii...,
i new to qt .i want to draw and resize rectangle using mouse events on Qimage which is in label
hii...,
i new to qt .i want to draw and resize rectangle using mouse events on Qimage which is in label
You could use QRubberBand.
Or derive a class from QLabel, implement mouse event handlers to get the values for the rect.
Reimplement paintEvent() such that you first call the implementation of the base class and then paint your rect on top of it.
Cheers,
_
thanks for reply earlier i used QRubberBand but it is not compatible to my application and using mouse events i draw rectangle with QPainter. but my problem is resizeing that rectangle
The QRect API is usually pretty straight forward.
How do you attempt to resize the rectangle?
Cheers,
_
then how can i do that resizing part..?i want to bound the objects in image so i need resizing .
I assume you have a member variable of type QRect.
So resizing the rect means changing that member's values and then calling update().
Cheers,
_
Bookmarks