フラグが設定されQGraphicsItem
ているsのバウンディングボックス(シーンスペース内)を取得する必要があります。QGraphicsItem::ItemIgnoresTransformations
ドキュメントによると、これを行うにはQGraphicsItem :: deviceTransform()を使用する必要があります。私はこれを試しました:
// Get the viewport => scene transform
vp_trans = view.viewportTransform();
// Get the item => viewport transform
trans = item.deviceTransform(vp_trans);
// Get the item's bounding box in item's space
bbox = item.boundingRect();
// Map it to viewport space
bbox = trans.mapRect(bbox);
// Map it back to scene's space
bbox = vp_trans.mapRect(bbox);
しかし、何かがおかしいです。バウンディングボックスが小さく、アイテムの右側に表示されます...