Skip to content
Permalink
Browse files

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

mShown = true;

init();
if ( !mInitialized )
init();
}

void QgsRelationReferenceWidget::init()
@@ -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;
}
}

@@ -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;

0 comments on commit ebaac42

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