mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-23 23:13:39 -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;
|
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();
|
~PdmUiDefaultObjectEditor();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWidget* createWidget(QWidget* parent);
|
virtual QWidget* createWidget(QWidget* parent) override;
|
||||||
virtual void configureAndUpdateUi(const QString& uiConfigName);
|
virtual void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||||
|
virtual void cleanupBeforeSettingPdmObject() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void recursiveSetupFieldsAndGroups(const std::vector<PdmUiItem*>& uiItems, QWidget* parent, QGridLayout* parentLayout, const QString& uiConfigName);
|
void recursiveSetupFieldsAndGroups(const std::vector<PdmUiItem*>& uiItems, QWidget* parent, QGridLayout* parentLayout, const QString& uiConfigName);
|
||||||
|
Loading…
Reference in New Issue
Block a user