Skip to content
Permalink
Browse files
Merge pull request #42889 from qgis/backport-42887-to-release-3_18
[Backport release-3_18] [attribute form] Fix drag n drop spacing issue with container-less setup
  • Loading branch information
nirvn committed Apr 21, 2021
2 parents e3e45fb + b694b20 commit 642ef190288111450442bdd3a715a5eaa7948f11
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/gui/qgsattributeform.cpp
@@ -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();

@@ -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 );
@@ -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;
}

0 comments on commit 642ef19

Please sign in to comment.