lundi 25 décembre 2017

How can i set the display range of a QGraphicItemGroup?

I have a QGraphicsItemGroup aggregating several child items, and I want to show only part of the group.(not the numbers of child items, area). Just like the image here.Image is here I want to just show the display area.

To do that, I have tried the override the QGraphicsItemGroup::boundingRect(). However, nothing have happened. And i find this in QT docs, maybe this is the reason why doesn't work.

Also, i know i can change the QGraphicsView to make it work. However i put the View as CentralWidget, as i also need to display other object in the View, i can not change the size of the View.

How can i set the display range of a QGraphicItemGroup?

The boundingRect() function of QGraphicsItemGroup returns the bounding rectangle of all items in the item group.

Aucun commentaire:

Enregistrer un commentaire