Closed parisa-hr closed 3 years ago
Hi!
I see (at least) two ways to accomplish what you want without modifying/inheriting from the GraphicsItemResizer
:
ItemSelectedHasChanged
event in QGraphicsItem::itemChange of the items to be selectable and detach/attach GraphicsItemResizer
as the parent item to the corresponding item.Another option would be to use QGraphicsItem::installSceneEventFilter in the GraphicsItemResizer
(or its subclass) to intercept selection events.
Hope this helps.
Hi!
I see (at least) two ways to accomplish what you want without modifying/inheriting from the
GraphicsItemResizer
:* Listen for [QGraphicsScene::selectionChanged](https://doc.qt.io/qt-5/qgraphicsscene.html#selectionChanged) and attach resizer to currently selected items, you have to track previously selected items though (to detach resizers from them); * Listen for `ItemSelectedHasChanged` event in [QGraphicsItem::itemChange](https://doc.qt.io/qt-5/qgraphicsitem.html#itemChange) of the items to be selectable and detach/attach `GraphicsItemResizer` as the parent item to the corresponding item.
Another option would be to use QGraphicsItem::installSceneEventFilter in the
GraphicsItemResizer
(or its subclass) to intercept selection events.Hope this helps.
Thanks.
Hi I want to Resize my QGraphicsItem when it is selected , how can do this? I mean I want HandleItem 's squares to become hide and when the user selects one Item, they appear and user has resized access.