Skip to content

Commit a49b7a6

Browse files
authoredJul 23, 2018
Merge pull request #7398 from signedav/rr_bugfix
Get proper mFeature in relation reference widget
2 parents f1993ba + 4739463 commit a49b7a6

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
@@ -458,8 +458,8 @@ void QgsRelationReferenceWidget::showEvent( QShowEvent *e )
458458
Q_UNUSED( e )
459459

460460
mShown = true;
461-
462-
init();
461+
if ( !mInitialized )
462+
init();
463463
}
464464

465465
void QgsRelationReferenceWidget::init()
@@ -553,8 +553,12 @@ void QgsRelationReferenceWidget::init()
553553

554554
// Only connect after iterating, to have only one iterator on the referenced table at once
555555
connect( mComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRelationReferenceWidget::comboReferenceChanged );
556-
updateAttributeEditorFrame( mFeature );
556+
//call it for the first time
557+
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );
558+
557559
QApplication::restoreOverrideCursor();
560+
561+
mInitialized = true;
558562
}
559563
}
560564

‎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.