1 // File: ModuleBase_ModelWidget.h
2 // Created: 25 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #include "ModuleBase_ModelWidget.h"
7 #include <ModelAPI_Data.h>
8 #include <ModelAPI_Attribute.h>
10 #include "Config_WidgetAPI.h"
14 ModuleBase_ModelWidget::ModuleBase_ModelWidget(QObject* theParent, const Config_WidgetAPI* theData)
15 : QObject(theParent), myHasDefaultValue(false)
17 myAttributeID = theData ? theData->widgetId() : "";
20 bool ModuleBase_ModelWidget::isInitialized(FeaturePtr theFeature) const
22 return theFeature->data()->attribute(attributeID())->isInitialized();
25 bool ModuleBase_ModelWidget::focusTo()
27 QList<QWidget*> aControls = getControls();
28 QList<QWidget*>::const_iterator anIt = aControls.begin(), aLast = aControls.end();
29 for (; anIt != aLast; anIt++) {
30 QWidget* aWidget = *anIt;
31 if (aWidget && aWidget->focusPolicy() != Qt::NoFocus) {
39 std::string ModuleBase_ModelWidget::attributeID() const