+}
+
+void XGUI_DocumentDataModel::removeSubModel(int theModelId)
+{
+ XGUI_PartModel* aModel = myPartModels.at(theModelId);
+ QIntList aToRemove;
+ for (int i = 0; i < myIndexes.size(); i++) {
+ if (myIndexes.at(i)->model() == aModel)
+ aToRemove.append(i);
+ }
+ int aId;
+ while(aToRemove.size() > 0) {
+ aId = aToRemove.last();
+ delete myIndexes.at(aId);
+ myIndexes.removeAt(aId);
+ aToRemove.removeLast();
+ }
+ delete aModel;
+ myPartModels.removeAt(theModelId);
+}
+
+bool XGUI_DocumentDataModel::hasSubModel(const QAbstractItemModel* theModel) const
+{
+ if (theModel == myModel)
+ return true;
+ QList<XGUI_PartModel*>::const_iterator aIt;
+ for (aIt = myPartModels.constBegin(); aIt != myPartModels.constEnd(); ++aIt)
+ if ((*aIt) == theModel)
+ return true;
+ return false;
+}