Skip to content
Permalink
Browse files

initialization of embeddet form only once

(cherry-picked from 56fe370)
  • Loading branch information
signedav committed Jul 18, 2018
1 parent fabce52 commit e59ad8aabb47831ae6aa865447730c9767f762ab
@@ -556,7 +556,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 );
if ( !mFeatureInitialized )
{
//call it for the first intialization
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );
mFeatureInitialized = true;
}
QApplication::restoreOverrideCursor();
}
}
@@ -222,6 +222,7 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
bool mIsEditable = true;
QStringList mFilterFields;
QMap<QString, QMap<QString, QSet<QString> > > mFilterCache;
bool mFeatureInitialized = false;

// Q_PROPERTY
bool mEmbedForm = false;
@@ -160,7 +160,6 @@ void QgsFeatureListComboBox::onDataChanged( const QModelIndex &topLeft, const QM
QModelIndex modelIndex = mModel->index( currentIndex, 0, QModelIndex() );
mLineEdit->setText( mModel->data( modelIndex, QgsFeatureFilterModel::ValueRole ).toString() );
}
emit currentIndexChanged( currentIndex );
}
}

0 comments on commit e59ad8a

Please sign in to comment.
You can’t perform that action at this time.