don't set the parent item as target, since we don't know when target will die.
instead map the target position to the proper place, in our current parent's coordinates BUG:211404 svn path=/trunk/KDE/kdelibs/; revision=1061426
This commit is contained in:
parent
6df20d182c
commit
c4bd7a9db4
@ -161,13 +161,12 @@ void ItemBackground::setTargetItem(QGraphicsItem *target)
|
||||
QTransform t = transform();
|
||||
setTransform(QTransform());
|
||||
QRectF geom = mapToScene(geometry()).boundingRect();
|
||||
setParentItem(target->parentItem());
|
||||
setGeometry(mapFromScene(geom).boundingRect());
|
||||
setTransform(t);
|
||||
}
|
||||
|
||||
QRectF rect = target->boundingRect();
|
||||
rect.moveTopLeft(target->pos());
|
||||
rect.moveTopLeft(mapToParent(mapFromScene(target->mapToScene(QPointF(0, 0)))));
|
||||
setTarget(rect);
|
||||
|
||||
if (newTarget) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user