1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ModuleBase_IPropertyPanel.cpp
6 * Created on: Oct 01, 2014
10 #include "ModuleBase_IPropertyPanel.h"
11 #include "ModuleBase_ModelWidget.h"
12 #include "ModuleBase_ToolBox.h"
14 #include <ModelAPI_Validator.h>
15 #include <ModelAPI_Session.h>
17 ModuleBase_IPropertyPanel::ModuleBase_IPropertyPanel(QWidget* theParent) : QDockWidget(theParent), myIsEditing(false)
22 ModuleBase_ModelWidget* ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget()
24 return ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget(modelWidgets());
27 ModuleBase_ModelWidget* ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget(
28 const QList<ModuleBase_ModelWidget*>& theWidgets)
30 ModuleBase_ModelWidget* aFirstWidget = 0;
32 ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators();
34 ModuleBase_ModelWidget* aWgt;
35 QList<ModuleBase_ModelWidget*>::const_iterator aWIt;
36 bool isOffToolBox = false;
37 for (aWIt = theWidgets.begin(); aWIt != theWidgets.end() && !aFirstWidget; ++aWIt) {
39 if (!aValidators->isCase(aWgt->feature(), aWgt->attributeID()))
40 continue; // this attribute is not participated in the current case
42 if (!aWgt->canSetValue())
45 /// workaround for the same attributes used in different stacked widgets(attribute types)
46 if (ModuleBase_ToolBox::isOffToolBoxParent(aWgt))