Francesco
Francesco

Reputation: 511

How to know which items are in a QGraphicsItemGroup?

I do not seem to find anywhere in the documentation how to find which QGraphicsItem belongs to a QGraphicsItemGroup knowing the group. Is this possible?

Upvotes: 3

Views: 1628

Answers (1)

TheDarkKnight
TheDarkKnight

Reputation: 27621

From the documentation:

A QGraphicsItemGroup is a special type of compound item that treats itself and all its children as one item.

So all group's children belong to the group.

QGraphicsItemGroup is derived from QGraphicsItem, which has this function:

QList<QGraphicsItem *> QGraphicsItem::childItems() const

Upvotes: 4

Related Questions