myState(Stored),
myIsValueStateBlocked(false)
{
+ myIsInternal = theData->getBooleanAttribute(ATTR_INTERNAL, false);
+
myDefaultValue = theData->getProperty(ATTR_DEFAULT);
myUseReset = theData->getBooleanAttribute(ATTR_USE_RESET, true);
myIsComputedDefault = theData->getProperty(ATTR_DEFAULT) == DOUBLE_WDG_DEFAULT_COMPUTED;
{
QList<QWidget*> aMyControls = getControls();
foreach(QWidget* eachControl, aMyControls) {
- if (myIsObligatory) {
eachControl->setFocusPolicy(Qt::StrongFocus);
eachControl->installEventFilter(this);
- }
- else {
- eachControl->setFocusPolicy(Qt::NoFocus);
- }
}
}
void ModuleBase_ModelWidget::deactivate()
{
myIsValueStateBlocked = false;
- if (myState == ModifiedInPP)
+ if (myState == ModifiedInPP || myState == ModifiedInViewer)
storeValue();
myState = Stored;
}
return false;
}
+bool ModuleBase_ModelWidget::processDelete()
+{
+ // we consider that model objects eats delete key in order to
+ // do nothing by for example symbol delete in line edit or spin box
+ return true;
+}
+
bool ModuleBase_ModelWidget::eventFilter(QObject* theObject, QEvent *theEvent)
{
QWidget* aWidget = qobject_cast<QWidget*>(theObject);
aReason == Qt::TabFocusReason ||
aReason == Qt::BacktabFocusReason ||
aReason == Qt::OtherFocusReason; // to process widget->setFocus()
- if (aMouseOrKey && getControls().contains(aWidget) && getValueState() == ModifiedInPP)
- storeValue();
+ if (aMouseOrKey && getControls().contains(aWidget)) {
+ if (getValueState() == ModifiedInPP) {
+ storeValue();
+ }
+ }
}
// pass the event on to the parent class