PDA

View Full Version : How can I use QGraphicsRectItem?



learning_qt
14th January 2009, 09:53
Hello,

I will use convert QImage to QGraphicsRectItem. I have to implement paint() fromQGraphicsItem. But there is no virtual destructor in QGraphicsItem. how can I work out this?

Thanks!

jpn
14th January 2009, 10:20
I will use convert QImage to QGraphicsRectItem. I have to implement paint() fromQGraphicsItem.
Why not QGraphicsPixmapItem? :)


But there is no virtual destructor in QGraphicsItem. how can I work out this?
Of course it's virtual as indicated by the docs.

learning_qt
14th January 2009, 10:37
Sorry, I made a mistake.

There is no virtual destructor in QGraphicsRectItem. So I can not inherit it. Could you please give some hints to solve this?

I will not use QGraphicsPixmapItem because QImage is used in my application.

jpn
14th January 2009, 11:00
It's declared as virtual by QGraphicsItem so it remains virtual in all subclasses.