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,
15 const Config_WidgetAPI* theData,
16 const std::string& theParentId)
17 : QObject(theParent), myHasDefaultValue(false), myParentId(theParentId)
19 myAttributeID = theData ? theData->widgetId() : "";
22 bool ModuleBase_ModelWidget::isInitialized(ObjectPtr theObject) const
24 return theObject->data()->attribute(attributeID())->isInitialized();
27 bool ModuleBase_ModelWidget::focusTo()
29 QList<QWidget*> aControls = getControls();
30 QList<QWidget*>::const_iterator anIt = aControls.begin(), aLast = aControls.end();
31 for (; anIt != aLast; anIt++) {
32 QWidget* aWidget = *anIt;
33 if (aWidget && aWidget->focusPolicy() != Qt::NoFocus) {