Skip to content

Commit baf1b3a

Browse files
committedJul 18, 2018
initialization of embeddet form only once
1 parent 56fe370 commit baf1b3a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
 

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,12 @@ void QgsRelationReferenceWidget::init()
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 );
558558

559-
updateAttributeEditorFrame( mFeature );
559+
if ( !mFeatureInitialized )
560+
{
561+
//call it for the first intialization
562+
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );
563+
mFeatureInitialized = true;
564+
}
560565
QApplication::restoreOverrideCursor();
561566
}
562567
}

‎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 mFeatureInitialized = false;
225226

226227
// Q_PROPERTY
227228
bool mEmbedForm = false;

‎src/gui/qgsfeaturelistcombobox.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ void QgsFeatureListComboBox::onDataChanged( const QModelIndex &topLeft, const QM
160160
QModelIndex modelIndex = mModel->index( currentIndex, 0, QModelIndex() );
161161
mLineEdit->setText( mModel->data( modelIndex, QgsFeatureFilterModel::ValueRole ).toString() );
162162
}
163-
emit currentIndexChanged( currentIndex );
164163
}
165164
}
166165

0 commit comments

Comments
 (0)
Please sign in to comment.