QGraphicsItem can have its own child QGraphicsItem objects. However, QGraphicsItem has no API (like setItems) to add its child. It is only possible allow the child attach to the parent, like
QGraphicsItemGroup, a subclass of QGraphicsItem, allows to add and remove children
But a very very important function, we must pay attention to:
If "enabled=true", QGraphicsItemGroup will handle all the events. For example, the event of mouse click on the child item won't be handled by child item.
If "enabled=false", QGraphicsItem Group will not block the child item's event and let child item handle it own event.
OMG, this has been driving me nuts for months! Thanks!
ReplyDeleteone more possible reason
ReplyDeletehttp://bugreports.qt.nokia.com/browse/QTBUG-15477
very Thanks!!
ReplyDeleteYou are a life-saver, thank you so much!
ReplyDelete