[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Thu May 20 16:50:43 CEST 2004
CVS commit by arwalker:
Handle deleting a plot from within a group.
M +27 -0 kstplotgroup.cpp 1.8
M +1 -0 kstplotgroup.h 1.7
--- kdeextragear-2/kst/kst/kstplotgroup.cpp #1.7:1.8
@@ -43,4 +43,31 @@ KstObject::UpdateType KstPlotGroup::upda
+bool KstPlotGroup::removeChild(KstViewObjectPtr obj, bool recursive) {
+ KstViewObjectList::Iterator it;
+ bool bRetVal = false;
+
+ if (KstViewObject::removeChild(obj,recursive)) {
+ if (_children.count() > 1) {
+ QRect gg = _children.first()->geometry();
+ for (it = _children.begin(); it != _children.end(); ++it) {
+ gg |= (*it)->geometry();
+ }
+
+ _geom = gg;
+ updateAspect();
+ for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+ updateAspect( );
+ }
+ } else {
+ flatten();
+ }
+
+ bRetVal = true;
+ }
+
+ return bRetVal;
+}
+
+
void KstPlotGroup::flatten() {
assert(_parent);
--- kdeextragear-2/kst/kst/kstplotgroup.h #1.6:1.7
@@ -31,4 +31,5 @@ class KstPlotGroup : public KstMetaPlot
virtual void save(QTextStream& ts);
+ virtual bool removeChild(KstViewObjectPtr obj, bool recursive = false);
virtual bool popupMenu(KPopupMenu *menu, const QPoint& pos, KstViewObjectPtr topLevelParent);
virtual bool layoutPopupMenu(KPopupMenu *menu, const QPoint& pos, KstViewObjectPtr topParent);
More information about the Kst
mailing list