Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use initialized for complete init() function
not only for the feature part

(cherry-picked from 4739463)
  • Loading branch information
signedav committed Jul 23, 2018
1 parent 5fe017a commit ebaac42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 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,14 +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 );
//call it for the first time
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );

if ( !mFeatureInitialized )
{
//call it for the first initialization
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );
mFeatureInitialized = true;
}
QApplication::restoreOverrideCursor();

mInitialized = true;
}
}

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

// Q_PROPERTY
bool mEmbedForm = false;
Expand Down

0 comments on commit ebaac42

Please sign in to comment.