SUPERVGUI_Canvas::~SUPERVGUI_Canvas() {
+ // asv : 17.01.05 : why delete its own children (CanvasNode-s)?
+ // they must be destroyed automatically.
QObjectList* aNodeList = queryList("SUPERVGUI_CanvasNode");
QObjectListIt aIt(*aNodeList);
QObject* anObj;
- while ((anObj = aIt.current()) != 0) {
+ while ( (anObj = aIt.current()) != 0 ) {
++aIt;
+ aNodeList->removeRef(anObj);
delete anObj;
}
+ // asv : list returned by queryList() must be removed
+ delete aNodeList;
}
void SUPERVGUI_Canvas::addView(QCanvasView* theView)
}
void SUPERVGUI_Canvas::sync() {
- // MESSAGE("===> SUPERVGUI_Canvas::sync()");
if (SUPERV_isNull(myMain->getDataflow())) return;
SUPERVGUI_CanvasNode* ihmNode;
* Synchronizes Graph presentation with internal graph structure
*/
void SUPERVGUI_Canvas::merge() {
- // MESSAGE("===> SUPERVGUI_Canvas::merge()");
if (SUPERV_isNull(myMain->getDataflow())) return;
SUPERVGUI_CanvasNode* ihmNode;
delete ihmList;
}
-void SUPERVGUI_Canvas::setAsFromStudy(bool theToStudy)
-{
- if (theToStudy) return;
-
- SUPERVGUI_CanvasPortOut* aPortOut;
- QObjectList* aPortList = queryList("SUPERVGUI_CanvasPortOut");
- QObjectListIt aPortIt(*aPortList);
- while ((aPortOut=(SUPERVGUI_CanvasPortOut*)aPortIt.current()) != 0) {
- ++aPortIt;
- if (aPortOut->isInStudy()) {
- aPortOut->setStudyState(theToStudy);
- aPortOut->sync();
- }
- }
- delete aPortList;
-}
-
SUPERVGUI_CanvasNode* SUPERVGUI_Canvas::getNode(SUPERV::CNode_ptr theNode) const
{
return (SUPERVGUI_CanvasNode*)