Skip to content

Commit

Permalink
[attribute form] Fix drag n drop spacing issue with container-less se…
Browse files Browse the repository at this point in the history
…tup (#42887)
  • Loading branch information
nirvn authored and github-actions[bot] committed Apr 21, 2021
1 parent e3e45fb commit b694b20
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -1447,6 +1447,7 @@ void QgsAttributeForm::init()
int row = 0;
int column = 0;
int columnCount = 1;
bool hasRootFields = false;

const QList<QgsAttributeEditorElement *> tabs = mLayer->editFormConfig().tabs();

Expand Down Expand Up @@ -1495,6 +1496,7 @@ void QgsAttributeForm::init()
}
else
{
hasRootFields = true;
tabWidget = nullptr;
WidgetInfo widgetInfo = createWidgetFromDef( widgDef, container, mLayer, mContext );
QLabel *label = new QLabel( widgetInfo.labelText );
Expand Down Expand Up @@ -1555,6 +1557,14 @@ void QgsAttributeForm::init()
row += 1;
}
}

if ( hasRootFields )
{
QSpacerItem *spacerItem = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
layout->addItem( spacerItem, row, 0 );
layout->setRowStretch( row, 1 );
}

formWidget = container;
}

Expand Down

0 comments on commit b694b20

Please sign in to comment.