Skip to content

Commit ad2caed

Browse files
committed
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)
1 parent 17df615 commit ad2caed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/gui/qgsattributedialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat
3333
QgsAttributeEditorContext context;
3434
context.setDistanceArea( myDa );
3535

36-
init( vl, thepFeature, context, parent );
36+
init( vl, thepFeature, context );
3737

3838
if ( !showDialogButtons )
3939
mAttributeForm->hideButtonBox();
@@ -44,7 +44,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat
4444
, mHighlight( 0 )
4545
, mOwnedFeature( featureOwner ? thepFeature : 0 )
4646
{
47-
init( vl, thepFeature, context, parent );
47+
init( vl, thepFeature, context );
4848

4949
if ( !showDialogButtons )
5050
mAttributeForm->hideButtonBox();
@@ -97,12 +97,12 @@ void QgsAttributeDialog::show( bool autoDelete )
9797
activateWindow();
9898
}
9999

100-
void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext &context, QWidget* parent )
100+
void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext &context )
101101
{
102102
setWindowTitle( tr( "%1 - Feature Attributes" ).arg( layer->name() ) );
103103
setLayout( new QGridLayout() );
104104
layout()->setMargin( 0 );
105-
mAttributeForm = new QgsAttributeForm( layer, *feature, context, parent );
105+
mAttributeForm = new QgsAttributeForm( layer, *feature, context, this );
106106
mAttributeForm->disconnectButtonBox();
107107
layout()->addWidget( mAttributeForm );
108108
QDialogButtonBox* buttonBox = mAttributeForm->findChild<QDialogButtonBox*>();

src/gui/qgsattributedialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
135135
void show( bool autoDelete = true );
136136

137137
private:
138-
void init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext& context, QWidget* parent );
138+
void init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext& context );
139139

140140
QString mSettingsPath;
141141
// Used to sync multiple widgets for the same field

0 commit comments

Comments
 (0)