Skip to content
Permalink
Browse files

Fix layout problems with relation reference widget

  • Loading branch information
m-kuhn committed Nov 23, 2015
1 parent 675da0c commit 7bcc935f4dd7f080294898b6ea5434ec7a42c3ee
@@ -83,7 +83,9 @@ QgsRelationReferenceWidget::QgsRelationReferenceWidget( QWidget* parent )
{
mTopLayout = new QVBoxLayout( this );
mTopLayout->setContentsMargins( 0, 0, 0, 0 );
mTopLayout->setAlignment( Qt::AlignTop );

setSizePolicy( sizePolicy().horizontalPolicy(), QSizePolicy::Fixed );

setLayout( mTopLayout );

QHBoxLayout* editLayout = new QHBoxLayout();
@@ -142,9 +144,6 @@ QgsRelationReferenceWidget::QgsRelationReferenceWidget( QWidget* parent )
mRemoveFKButton->setText( tr( "No selection" ) );
editLayout->addWidget( mRemoveFKButton );

// spacer
editLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding ) );

// add line to top layout
mTopLayout->addLayout( editLayout );

@@ -379,6 +378,12 @@ void QgsRelationReferenceWidget::setEditorContext( const QgsAttributeEditorConte

void QgsRelationReferenceWidget::setEmbedForm( bool display )
{
if ( display )
{
setSizePolicy( sizePolicy().horizontalPolicy(), QSizePolicy::MinimumExpanding );
mTopLayout->setAlignment( Qt::AlignTop );
}

mAttributeEditorFrame->setVisible( display );
mEmbedForm = display;
}
@@ -484,6 +489,10 @@ void QgsRelationReferenceWidget::init()
}
}
}
else
{
mFilterContainer->hide();
}

QgsExpression exp( mReferencedLayer->displayExpression() );

@@ -30,7 +30,6 @@ QgsRelationReferenceWidgetWrapper::QgsRelationReferenceWidgetWrapper( QgsVectorL
QWidget* QgsRelationReferenceWidgetWrapper::createWidget( QWidget* parent )
{
QgsRelationReferenceWidget* w = new QgsRelationReferenceWidget( parent );
w->setSizePolicy( w->sizePolicy().horizontalPolicy(), QSizePolicy::Expanding );
return w;
}

0 comments on commit 7bcc935

Please sign in to comment.
You can’t perform that action at this time.