From 98ead51adbb487c57ffae05fc62a91ff5ca9a79d Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 20 Apr 2007 10:52:22 +0000 Subject: [PATCH] Some corrections for destruction of Bloc nodes. --- src/QxGraph/QxGraph_Prs.cxx | 11 +++++++++++ src/QxGraph/QxGraph_Prs.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/QxGraph/QxGraph_Prs.cxx b/src/QxGraph/QxGraph_Prs.cxx index 26ec0e4d9..c9c6b219d 100644 --- a/src/QxGraph/QxGraph_Prs.cxx +++ b/src/QxGraph/QxGraph_Prs.cxx @@ -70,6 +70,17 @@ void QxGraph_Prs::addItem(QCanvasItem* theItem, int theDMode) myDisplayMap[theDMode].push_back(theItem); } +/*! + Remove item from the view with index theDMode +*/ +void QxGraph_Prs::removeItem(QCanvasItem* theItem, int theDMode) +{ + if ( theDMode == -1 ) // remove item from the current display mode + myDisplayMap[myDMode].remove(theItem); + else + myDisplayMap[theDMode].remove(theItem); +} + /*! Adds all the items of this presentation for the current display mode * to the canvas. */ diff --git a/src/QxGraph/QxGraph_Prs.h b/src/QxGraph/QxGraph_Prs.h index 4b7a40fa9..161610314 100644 --- a/src/QxGraph/QxGraph_Prs.h +++ b/src/QxGraph/QxGraph_Prs.h @@ -36,6 +36,7 @@ class QXGRAPH_EXPORT QxGraph_Prs QxGraph_Canvas* getCanvas() const { return myCanvas; } void addItem(QCanvasItem* theItem, int theDMode = -1); + void removeItem(QCanvasItem* theItem, int theDMode = -1); /* add items for display mode theDMode if theDMode is equal to -1 add item for the current (active) display mode */ -- 2.39.2