Skip to content

Commit

Permalink
Removed parent and replaced with QgsAttributeDialog
Browse files Browse the repository at this point in the history
This makes possible to resize/alter the outer dialog
from python init code in the form.

Fixes #11517 (indirectly)
  • Loading branch information
elpaso committed Nov 12, 2015
1 parent 17df615 commit ad2caed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/gui/qgsattributedialog.cpp
Expand Up @@ -33,7 +33,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat
QgsAttributeEditorContext context;
context.setDistanceArea( myDa );

init( vl, thepFeature, context, parent );
init( vl, thepFeature, context );

if ( !showDialogButtons )
mAttributeForm->hideButtonBox();
Expand All @@ -44,7 +44,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat
, mHighlight( 0 )
, mOwnedFeature( featureOwner ? thepFeature : 0 )
{
init( vl, thepFeature, context, parent );
init( vl, thepFeature, context );

if ( !showDialogButtons )
mAttributeForm->hideButtonBox();
Expand Down Expand Up @@ -97,12 +97,12 @@ void QgsAttributeDialog::show( bool autoDelete )
activateWindow();
}

void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext &context, QWidget* parent )
void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext &context )
{
setWindowTitle( tr( "%1 - Feature Attributes" ).arg( layer->name() ) );
setLayout( new QGridLayout() );
layout()->setMargin( 0 );
mAttributeForm = new QgsAttributeForm( layer, *feature, context, parent );
mAttributeForm = new QgsAttributeForm( layer, *feature, context, this );
mAttributeForm->disconnectButtonBox();
layout()->addWidget( mAttributeForm );
QDialogButtonBox* buttonBox = mAttributeForm->findChild<QDialogButtonBox*>();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsattributedialog.h
Expand Up @@ -135,7 +135,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
void show( bool autoDelete = true );

private:
void init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext& context, QWidget* parent );
void init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext& context );

QString mSettingsPath;
// Used to sync multiple widgets for the same field
Expand Down

0 comments on commit ad2caed

Please sign in to comment.