| Summary: | Multiple levels of plot groups are destroyed shortly after creation | ||
|---|---|---|---|
| Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
| Component: | general | Assignee: | kst |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.x | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Andrew Walker
2006-03-28 23:01:53 UTC
This problem seems to be caused by the following lines of code in KstToplevelView::releasePressLayoutModeMove(...)
if (container != _pressTarget && !container->children().contains(_pressTarget)) {
_pressTarget->detach();
container->appendChild(_pressTarget);
}
which implicitly moves objects from a deeper group up to a higher level. This appears related to the automated parenting of objects following a move, but in this case no move was made.
One solution would be to disable a move operation for objects within a plot group. Only the group could be moved as a whole. However, we might still want to be able to edit an object within a plot group.
I don't think that's the case. I think we're getting the wrong target to begin with. It's because of a change I made to plotgroups to fix some other problems. I didn't notice the impact here. I'm testing a patch now. SVN commit 526966 by staikos:
don't break plot groups apart. There are still many problems lurking though.
BUG: 124453
M +6 -4 ksttoplevelview.cpp
--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #526965:526966
@@ -330,11 +330,13 @@
_pressTarget = findDeepestChild(pos, false);
if (_pressTarget) {
KstViewObjectPtr p = _pressTarget;
- while (p->_parent && p->_parent->_container) {
+ while (p->_parent && (p->_parent->_container || kst_cast<KstPlotGroup>((KstViewObjectPtr)p->_parent)) && !kst_cast<KstTopLevelView>((KstViewObjectPtr)p->_parent)) {
p = p->_parent;
}
- if (p->_parent && !p->_parent->_container) {
+ if (p->_parent && !p->_parent->_container && !kst_cast<KstTopLevelView>((KstViewObjectPtr)p->_parent)) {
_pressTarget = p->_parent;
+ } else if (p && !p->_container) {
+ _pressTarget = p;
}
}
@@ -957,10 +959,10 @@
obj = obj.unite((*i)->geometry());
}
}
- const QPoint objOffset(_pressTarget->geometry().topLeft() - obj.topLeft());
+ const QPoint objOffset(old.topLeft() - obj.topLeft());
// do the move
- obj.moveTopLeft(pos - _moveOffset - _moveOffsetSticky - _pressTarget->geometry().topLeft() + obj.topLeft());
+ obj.moveTopLeft(pos - _moveOffset - _moveOffsetSticky - old.topLeft() + obj.topLeft());
if (!_geom.contains(obj, true)) {
slideInto(_geom, obj);
}
|