Skip to content

Commit

Permalink
Merge pull request #7405 from signedav/release-3_2
Browse files Browse the repository at this point in the history
3.2 Backport of Fix: Get proper mFeature in relation reference widget
  • Loading branch information
m-kuhn committed Jul 30, 2018
2 parents af22552 + ebaac42 commit 0d89cc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -460,8 +460,8 @@ void QgsRelationReferenceWidget::showEvent( QShowEvent *e )
Q_UNUSED( e )

mShown = true;

init();
if ( !mInitialized )
init();
}

void QgsRelationReferenceWidget::init()
Expand Down Expand Up @@ -555,8 +555,12 @@ void QgsRelationReferenceWidget::init()

// Only connect after iterating, to have only one iterator on the referenced table at once
connect( mComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRelationReferenceWidget::comboReferenceChanged );
updateAttributeEditorFrame( mFeature );
//call it for the first time
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );

QApplication::restoreOverrideCursor();

mInitialized = true;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/editorwidgets/qgsrelationreferencewidget.h
Expand Up @@ -222,6 +222,7 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
bool mIsEditable = true;
QStringList mFilterFields;
QMap<QString, QMap<QString, QSet<QString> > > mFilterCache;
bool mInitialized = false;

// Q_PROPERTY
bool mEmbedForm = false;
Expand Down

0 comments on commit 0d89cc8

Please sign in to comment.