Salome HOME
Merge relevant changes from V8_0_0_BR branch
[modules/gui.git] / src / TreeData / TreeModel.cxx
index 12510fd40806f7e3c6ffd8f1bc68afccecb12bc6..5bb540c91161a2d7c46f7e7371bf7940f2d5daa9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -20,8 +20,6 @@
 // Author: Guillaume Boulant (EDF/R&D)
 
 
-#include <QtGui>
-
 #include "TreeItem.hxx"
 #include "TreeModel.hxx"
 
@@ -186,7 +184,7 @@ bool TreeModel::setHeaderData(int section, Qt::Orientation orientation,
 // This part is a specific behavior to get a TreeModel that can
 // organize itself the tree hierarchy using data provided in a
 // filesystem-like format:
-// 
+//
 // data="a/b/c" ==> creation/filling of the hierarchy a->b->c
 // The "folder" categories are unique whereas the leaves may exists
 // in multiple instances.
@@ -208,3 +206,10 @@ bool TreeModel::addData(DataObject * dataObject, const QStringList &path) {
   rootItem->appendChild(dataObject, path);
   return true;
 }
+
+bool TreeModel::removeData(DataObject * dataObject) {
+  QStringList path = QString(dataObject->getPath().c_str()).split(DataObject::pathsep.c_str());
+  TreeItem * rootItem = this->getItem();
+  rootItem->removeChild(dataObject, path);
+  return true;
+}