#define DBL_MAX 1.7976931348623158e+308
#endif
-
-ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData)
- : ModuleBase_ModelWidget(theParent, theData)
+ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
+ const Config_WidgetAPI* theData,
+ const std::string& theParentId)
+ : ModuleBase_ModelWidget(theParent, theData, theParentId)
{
myContainer = new QWidget(theParent);
QHBoxLayout* aControlLay = new QHBoxLayout(myContainer);
{
}
-bool ModuleBase_WidgetDoubleValue::storeValue(ObjectPtr theObject) const
+bool ModuleBase_WidgetDoubleValue::storeValue() const
{
- DataPtr aData = theObject->data();
+ DataPtr aData = myFeature->data();
AttributeDoublePtr aReal = aData->real(attributeID());
if (aReal->value() != mySpinBox->value()) {
aReal->setValue(mySpinBox->value());
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ updateObject(myFeature);
}
return true;
}
-bool ModuleBase_WidgetDoubleValue::restoreValue(ObjectPtr theObject)
+bool ModuleBase_WidgetDoubleValue::restoreValue()
{
- DataPtr aData = theObject->data();
+ DataPtr aData = myFeature->data();
AttributeDoublePtr aRef = aData->real(attributeID());
bool isBlocked = mySpinBox->blockSignals(true);
{
if (theObject == mySpinBox) {
if (theEvent->type() == QEvent::KeyRelease) {
- QKeyEvent* aKeyEvent = (QKeyEvent*)theEvent;
+ QKeyEvent* aKeyEvent = (QKeyEvent*) theEvent;
if (aKeyEvent && aKeyEvent->key() == Qt::Key_Return) {
emit focusOutWidget(this);
}