Skip to content

Commit

Permalink
Merge pull request #7398 from signedav/rr_bugfix
Browse files Browse the repository at this point in the history
Get proper mFeature in relation reference widget
  • Loading branch information
m-kuhn committed Jul 23, 2018
2 parents f1993ba + 4739463 commit a49b7a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -458,8 +458,8 @@ void QgsRelationReferenceWidget::showEvent( QShowEvent *e )
Q_UNUSED( e ) Q_UNUSED( e )


mShown = true; mShown = true;

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


void QgsRelationReferenceWidget::init() void QgsRelationReferenceWidget::init()
Expand Down Expand Up @@ -553,8 +553,12 @@ void QgsRelationReferenceWidget::init()


// Only connect after iterating, to have only one iterator on the referenced table at once // 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 ); connect( mComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRelationReferenceWidget::comboReferenceChanged );
updateAttributeEditorFrame( mFeature ); //call it for the first time
emit mComboBox->currentIndexChanged( mComboBox->currentIndex() );

QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();

mInitialized = true;
} }
} }


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


// Q_PROPERTY // Q_PROPERTY
bool mEmbedForm = false; bool mEmbedForm = false;
Expand Down

0 comments on commit a49b7a6

Please sign in to comment.