Skip to content

Commit

Permalink
Fix for container "show as group box" setting is lost when closing
Browse files Browse the repository at this point in the history
layer properties dialog

We can't use the checkbox visibility to determine whether it applies,
as the checkbox will ALWAYS be invisible when applying the settings
as a result of clicking "OK" (since the form is already closed and
all child widgets are not visible at that stage)

Fixes #37205
  • Loading branch information
nyalldawson committed Jun 15, 2020
1 parent 7ec4968 commit 803f507
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -32,6 +32,7 @@ QgsAttributeFormContainerEdit::QgsAttributeFormContainerEdit( QTreeWidgetItem *i
// only top level items can be tabs
// i.e. it's always a group box if it's a nested container
mShowAsGroupBoxCheckBox->hide();
mShowAsGroupBoxCheckBox->setEnabled( false );
}

mTitleLineEdit->setText( itemData.name() );
Expand Down Expand Up @@ -59,7 +60,7 @@ void QgsAttributeFormContainerEdit::updateItemData()
QgsAttributesFormProperties::DnDTreeItemData itemData = mTreeItem->data( 0, QgsAttributesFormProperties::DnDTreeRole ).value<QgsAttributesFormProperties::DnDTreeItemData>();

itemData.setColumnCount( mColumnCountSpinBox->value() );
itemData.setShowAsGroupBox( mShowAsGroupBoxCheckBox->isVisible() ? mShowAsGroupBoxCheckBox->isChecked() : false );
itemData.setShowAsGroupBox( mShowAsGroupBoxCheckBox->isEnabled() ? mShowAsGroupBoxCheckBox->isChecked() : false );
itemData.setName( mTitleLineEdit->text() );
itemData.setShowLabel( mShowLabelCheckBox->isChecked() );
itemData.setBackgroundColor( mBackgroundColorButton->color() );
Expand Down

0 comments on commit 803f507

Please sign in to comment.