PDA

View Full Version : QGraphicsPixmapItem with signals/slots



ziofu
11th April 2012, 14:25
Hi all

I'd like to have a QGraphicsPixmapItem with signals/slots
I see that there is a QGraphicsObject, but I was wondering if there's a faster way to do this.

Thanks

wayfaerer
11th April 2012, 18:32
You could inherit from both QGraphicsPixmapItem and QObject. I don't think it's faster than QGraphicsObject, but it will probably use less memory. Take a look at these posts:

http://stackoverflow.com/questions/2292072/penalty-of-using-qgraphicsobject-vs-qgraphicsitem
http://stackoverflow.com/questions/4922801/adding-signals-slots-qobject-to-qgraphicsitem-performance-hit