Skip to content
Permalink
Browse files

Removed parent and replaced with QgsAttributeDialog

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 ad2caed3b2bd652a6264652bda009621c44e0c4a
Showing with 5 additions and 5 deletions.
  1. +4 −4 src/gui/qgsattributedialog.cpp
  2. +1 −1 src/gui/qgsattributedialog.h
@@ -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();
@@ -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();
@@ -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*>();
@@ -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

0 comments on commit ad2caed

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