PDA

View Full Version : select a QGraphicsitem and all it's child items



salcin
27th November 2013, 15:55
Hi,

I want to select a qgraphicsitem and all it's child items when a select the parent item. How can I do this? Where should I start?
Now only the item which I clicked on is selected.

Thanks!

Santosh Reddy
28th November 2013, 06:31
Use QList<QGraphicsItem *> QGraphicsItem::childItems() const to get the children list and call void QGraphicsItem::setSelected(true) on all the items in the list. You could add this in a slot connected to void QGraphicsScene::selectionChanged() [signal] of the QGraphicsScene