mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
#11731 Detect when a group box have the same name as an existing group box
Detect when a group box have the same name as an existing group box. This is not currently supported, and leads to dangling group boxes in the Property Editor. Trigger assert and crash when the situation appears.
This commit is contained in:
parent
0a0c8fbbe3
commit
da37687c77
@ -348,6 +348,17 @@ QMinimizePanel* caf::PdmUiFormLayoutObjectEditor::findOrCreateGroupBox( QWidget*
|
||||
|
||||
if ( it == m_groupBoxes.end() )
|
||||
{
|
||||
auto newBoxIt = m_newGroupBoxes.find( groupBoxKey );
|
||||
if ( newBoxIt != m_newGroupBoxes.end() )
|
||||
{
|
||||
// This error happens when the same group is added to the same parent multiple times
|
||||
// https://github.com/OPM/ResInsight/issues/11731
|
||||
// Suggested approach: Make sure that all objects and groups in PdmUiOrdering have unique names.
|
||||
|
||||
auto message = "Detected duplicate group box with keyword: " + groupBoxKey;
|
||||
CAF_ASSERT( false && message.toStdString().data() );
|
||||
}
|
||||
|
||||
groupBox = new QMinimizePanel( parent );
|
||||
groupBox->enableFrame( group->enableFrame() );
|
||||
groupBox->setTitle( group->uiName( uiConfigName ) );
|
||||
|
Loading…
Reference in New Issue
Block a user