I'm trying to draw numbers on QRubberBand
object. I have class widget with QRubberBand
object rectangleRubberBand
;
I can show this area etc, but I'm trying to draw on area not on the widget some numbers, for example width and height of this area. How can I do this? It's for measure purpose of charts.
It is not drawing on rubber band but it does what you need :
QToolTip
is shown near the cursor. It dynamically changes and shows actual information about size of rubber band.Result (black area is a cursor) :
Harder solution: subclass
QRubberBand
and reimplementpaintEvent
. For example:Header :
cpp :
Result:
Choose the best approach for you.