Add, as in A + B = {A, B} probably. :-)
There are two approaches. Either you just add both QGraphicsItemGroup items to a new group, or move all children of one group to the other, then delete the empty group. So:
QList<QGraphicsItem *> groups;
groups << group1;
groups << group2;
// Add both groups to one parent group
QList<QGraphicsItem *> groups;
groups << group1;
groups << group2;
// Add both groups to one parent group
QGraphicsItemGroup *twoGroups = scene->createItemGroup(groups);
To copy to clipboard, switch view to plain text mode
...or:
group2->addToGroup(child);
delete group1;
foreach (QGraphicsItem *child, group1->childItems())
group2->addToGroup(child);
delete group1;
To copy to clipboard, switch view to plain text mode
Bookmarks