#include <SUIT_ResourceMgr.h>
#include <qobjectlist.h>
+#include <QxGraph_CanvasView.h>
/*!
Constructor
*/
void QxGraph_Canvas::addView(QCanvasView* theView)
{
+ myViews.append( theView );
QCanvas::addView(theView);
- theView->setPaletteBackgroundColor(backgroundColor().light(120));
+ theView->setPaletteBackgroundColor(backgroundColor().light(120));
+}
+
+/*!
+ Remove view
+*/
+void QxGraph_Canvas::removeView( QCanvasView* theView )
+{
+ myViews.remove( theView );
+}
+
+/*!
+ Remove item
+*/
+void QxGraph_Canvas::removeItem( QCanvasItem* theItem )
+{
+ QValueList< QCanvasView* >::iterator anIter;
+ for ( anIter = myViews.begin(); anIter != myViews.end(); ++anIter )
+ {
+ QxGraph_CanvasView* aView = dynamic_cast<QxGraph_CanvasView*>( *anIter );
+ if ( aView )
+ aView->itemRemoved( theItem );
+ }
+
+ QCanvas::removeItem( theItem );
}
/*!
QxGraph_Canvas(SUIT_ResourceMgr*);
virtual ~QxGraph_Canvas();
- void addView(QCanvasView* theView);
+ virtual void addView(QCanvasView* theView);
+ virtual void removeView(QCanvasView*);
QPtrList<QxGraph_Prs> getPrsList() const { return myPrsList; }
QxGraph_Prs* getPrs(int theIndex = 0);
void addPrs(QxGraph_Prs* thePrs) { myPrsList.append(thePrs); }
- private:
+ virtual void removeItem( QCanvasItem* );
+
+private:
+
+ QValueList< QCanvasView* > myViews;
QPtrList<QxGraph_Prs> myPrsList;
};