Issue
In my app I am using the Graphics View framework and I am creating a lot of QGraphicsItemGroup. For example one group represents a text frame with some squares to resize the frame and another is a group of points representing a brush stroke. I am implementing a selection tool similar to the one you can find in Adobe Photoshop or Indesign. I implemented it as follow:
- In my scene I use the function itemAt(pos, transform) with pos being the current position of my mouse.
- Plus I called setFiltersChildEvents(True) in all the groups
However the item returned by itemAt is sometimes just a child of the group itself. Is there a way to make the function itemAt() returning the group of the item ? Or in another way, to make those children unselectable.
Solution
If you are looking to get the group of the item
Below method available for QGraphicsItem
, which returns QGraphicsItemGroup
. Use this group object and set the desired.
PySide6.QtWidgets.QGraphicsItem.group()
Answered By - Pavan Chandaka
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.