make moving between items with different parents work a bit better ;)
svn path=/trunk/KDE/kdelibs/; revision=1031762
This commit is contained in:
parent
cfd8409432
commit
70b3847210
@ -166,7 +166,15 @@ void ItemBackground::setTargetItem(QGraphicsItem *target)
|
||||
d->target = target;
|
||||
if (target) {
|
||||
setZValue(target->zValue() - 1);
|
||||
setParentItem(target->parentItem());
|
||||
if (parentItem() != target->parentItem()) {
|
||||
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());
|
||||
setTarget(rect);
|
||||
|
Loading…
Reference in New Issue
Block a user