Skip to content

Commit 0d89cc8

Browse files
authoredJul 30, 2018
Merge pull request #7405 from signedav/release-3_2
3.2 Backport of Fix: Get proper mFeature in relation reference widget
2 parents af22552 + ebaac42 commit 0d89cc8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
 

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ void QgsRelationReferenceWidget::showEvent( QShowEvent *e )
460460
Q_UNUSED( e )
461461

462462
mShown = true;
463-
464-
init();
463+
if ( !mInitialized )
464+
init();
465465
}
466466

467467
void QgsRelationReferenceWidget::init()
@@ -555,8 +555,12 @@ void QgsRelationReferenceWidget::init()
555555

556556
// Only connect after iterating, to have only one iterator on the referenced table at once
557557
connect( mComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRelationReferenceWidget::comboReferenceChanged );
558-
updateAttributeEditorFrame( mFeature );
558+
//call it for the first time
559+
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );
560+
559561
QApplication::restoreOverrideCursor();
562+
563+
mInitialized = true;
560564
}
561565
}
562566

‎src/gui/editorwidgets/qgsrelationreferencewidget.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
222222
bool mIsEditable = true;
223223
QStringList mFilterFields;
224224
QMap<QString, QMap<QString, QSet<QString> > > mFilterCache;
225+
bool mInitialized = false;
225226

226227
// Q_PROPERTY
227228
bool mEmbedForm = false;

0 commit comments

Comments
 (0)
Please sign in to comment.