This code is surely invalid. Changing location as a result of a repaint is probably not what you want.
This code is surely invalid. Changing location as a result of a repaint is probably not what you want.
qtzcute (13th July 2009)
Sorry but i am very new in Qt's world and could not understand what you said. Can u kindly tell me where am i changing the location?
If you are talking about updating the 'xLocation' integer variable in paint function then well, i am doing that because i want each new rectangle to be drawn at new place.
If not, then please guide as to what i need to do.
Thanks a lot wysota
In the paint() routine.
That's surely not the right way to do this. paint() will be called for each of the rectangles more than once.If you are talking about updating the 'xLocation' integer variable in paint function then well, i am doing that because i want each new rectangle to be drawn at new place.
In my opinion you should stick to QGraphicsRectItem or its subclass.
qtzcute (13th July 2009)
Many thanks wysota...problem solved.
You were right i should not have change the position in paint function...Now my rectangles are appearing quite finely.
Bookmarks