void KstPlotDrag::setPlots(const KstViewObjectList& l) { QByteArray a; QDataStream ds(a, IO_WriteOnly); ds << l.count(); for (KstViewObjectList::ConstIterator i = l.begin(); i != l.end(); ++i) { ds << *i; } setEncodedData(a); }
bool KstIfaceImpl::deletePlot(const QString& window, const QString& name) { KstViewWindow *pView = dynamic_cast<KstViewWindow*>(KstApp::inst()->findWindow(window)); if (pView) { KstTopLevelViewPtr pTLV = pView->view(); KstViewObjectList objects = pTLV->findChildrenType<KstViewObject>(true); for (KstViewObjectList::Iterator it = objects.begin(); it != objects.end(); ++it) { KstViewObjectPtr object = *it; if (object->tagName() == name) { pTLV->removeChild(object, true); _doc->forceUpdate(); _doc->setModified(); return true; } } } return false; }