mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-23 15:03:27 -06:00
AppFwk : Clear internal structures when object changes
This commit is contained in:
parent
3f97640e7a
commit
b8f1099d32
@ -171,6 +171,30 @@ void PdmUiDefaultObjectEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
m_groupBoxes = m_newGroupBoxes;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiDefaultObjectEditor::cleanupBeforeSettingPdmObject()
|
||||
{
|
||||
std::map<QString, PdmUiFieldEditorHandle*>::iterator it;
|
||||
for (it = m_fieldViews.begin(); it != m_fieldViews.end(); ++it)
|
||||
{
|
||||
PdmUiFieldEditorHandle* fvh = it->second;
|
||||
delete fvh;
|
||||
}
|
||||
m_fieldViews.clear();
|
||||
|
||||
m_newGroupBoxes.clear();
|
||||
|
||||
std::map<QString, QPointer<QGroupBox> >::iterator groupIt;
|
||||
for (groupIt = m_groupBoxes.begin(); groupIt != m_groupBoxes.end(); ++groupIt)
|
||||
{
|
||||
if (!groupIt->second.isNull()) groupIt->second->deleteLater();
|
||||
}
|
||||
|
||||
m_groupBoxes.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -61,8 +61,9 @@ public:
|
||||
~PdmUiDefaultObjectEditor();
|
||||
|
||||
protected:
|
||||
virtual QWidget* createWidget(QWidget* parent);
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName);
|
||||
virtual QWidget* createWidget(QWidget* parent) override;
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||
virtual void cleanupBeforeSettingPdmObject() override;
|
||||
|
||||
private:
|
||||
void recursiveSetupFieldsAndGroups(const std::vector<PdmUiItem*>& uiItems, QWidget* parent, QGridLayout* parentLayout, const QString& uiConfigName);
|
||||
|
Loading…
Reference in New Issue
Block a user