Hi..
i would like to write text inside a rectangle created using Q3CanvasRectangle, like some name of it and the coordinates for it.. how do i do that...
Plz help me in this..
Thanking you a lot...
with regards,
Kapil
Hi..
i would like to write text inside a rectangle created using Q3CanvasRectangle, like some name of it and the coordinates for it.. how do i do that...
Plz help me in this..
Thanking you a lot...
with regards,
Kapil
All you have to decide is what to do with the time that is given to you
I think you can reimplement drawShape and write your text.
Mithin
www.mithin.in
thanks for the reply..Originally Posted by munna
what i have done is used the Q3CanvasText and written by specifying the position.. just the only problem which i am facing is that when i provide motion to the canvas or move it the text does not move...
so i have to like set on the move for the text also with it..
what i want is that when i move the rectangle, the text moves with it as if its painted on the rectangle only...
how to do it..
thanks,
with regards,
Kapil
All you have to decide is what to do with the time that is given to you
You have already been given your answer -- subclass QCanvasRectangle and reimplement drawShape so that it paints your text in the rectangle:
Qt Code:
QCanvasRectangle::drawShape(p); // this draws the rectangle p.drawText(rect(), Qt::AlignCenter, "Some text"); }To copy to clipboard, switch view to plain text mode
Bookmarks