Please nominate your Qt Champions for 2021!

QGraphicsItem::ItemIgnoresTransformations mouse interact

  • Hi,

    I have put a QGraphicsRectItem on QGraphicsPixmapItem which is a parent item. Since RectItem is big enough, it is easy to select RectItem by mouse click. When I scale down the PixmapItem, RectItem also zoom out as expected. For example, if I zoom out PixmapItem by 5%, RectItem also become smaller. because RectItem becomes small, now it is hard for me to select it by mouse clicking. After applying setFlag(QGraphicsItem::ItemIgnoresTransformations) to RectItem, it stays the same rect size even after zooming PixmapItem. But it is still hard to select RectItem by mouse. Is this a bug, or is there any workaround to select RectItem easily even after zooming out PixmapItem?

Log in to reply