knowing the position of the rectangle in QPainter, if you just want to write in it, you can use the QPainter::drawText function.
Qt: setting QLabel coordinates inside Widget
Question
I'm writing a day schedule and got some troubles: I'm drawing a rectangle on the scheme (rect = event) and I need to put label directly inside of the rectangle. Are there any ways to do that?
P.S. At the moment the scheme is a QWidget and I use QPainter to draw rectangles
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow