mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fwk: Update enabled state for icons based on object toggle field
This commit is contained in:
parent
e814246e22
commit
c579c61404
@ -464,5 +464,17 @@ void PdmObject::addUiTreeChildren(PdmUiTreeOrdering* root, QString uiConfigName
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void PdmObject::updateUiIconFromToggleField()
|
||||||
|
{
|
||||||
|
if (objectToggleField())
|
||||||
|
{
|
||||||
|
bool active = objectToggleField()->uiValue().toBool();
|
||||||
|
updateUiIconFromState(active);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} //End of namespace caf
|
} //End of namespace caf
|
||||||
|
@ -174,6 +174,8 @@ public:
|
|||||||
/// Return object editor specific parameters used to customize the editor behavior.
|
/// Return object editor specific parameters used to customize the editor behavior.
|
||||||
void objectEditorAttribute(QString uiConfigName, PdmUiEditorAttribute* attribute);
|
void objectEditorAttribute(QString uiConfigName, PdmUiEditorAttribute* attribute);
|
||||||
|
|
||||||
|
void updateUiIconFromToggleField();
|
||||||
|
|
||||||
// Virtual interface to override in subclasses to support special behaviour if needed
|
// Virtual interface to override in subclasses to support special behaviour if needed
|
||||||
public: // Virtual
|
public: // Virtual
|
||||||
virtual PdmFieldHandle* userDescriptionField() { return NULL; }
|
virtual PdmFieldHandle* userDescriptionField() { return NULL; }
|
||||||
@ -196,7 +198,8 @@ public:
|
|||||||
protected: // Virtual
|
protected: // Virtual
|
||||||
/// Method gets called from PdmDocument after all objects are read.
|
/// Method gets called from PdmDocument after all objects are read.
|
||||||
/// Re-implement to set up internal pointers etc. in your data structure
|
/// Re-implement to set up internal pointers etc. in your data structure
|
||||||
virtual void initAfterRead() {};
|
virtual void initAfterRead() { updateUiIconFromToggleField(); };
|
||||||
|
|
||||||
/// Method gets called from PdmDocument before saving document.
|
/// Method gets called from PdmDocument before saving document.
|
||||||
/// Re-implement to make sure your fields have correct data before saving
|
/// Re-implement to make sure your fields have correct data before saving
|
||||||
virtual void setupBeforeSave() {};
|
virtual void setupBeforeSave() {};
|
||||||
|
Loading…
Reference in New Issue
Block a user