Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Calls setIdentifierValues( QVariantList() ) in setIdentifierValuesToN…
…ull to fix the issue that it did only set the values to null but not the index to the null values index before, what leaded to the problem that in the relationreference widget it did not change the text on switching on a form with null values (e.g.) in the attribute list's form view.

Since the function setIdentifierValuesToNull does nothing else meanwhile, it's deprecated and we use setIdentifierValues( QVariantList() ) instead.
  • Loading branch information
signedav committed Jan 14, 2020
1 parent 34d3aaa commit b0d9932
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
5 changes: 4 additions & 1 deletion python/core/auto_generated/qgsfeaturefiltermodel.sip.in
Expand Up @@ -174,12 +174,15 @@ still be available in the model.
.. versionadded:: 3.10
%End

void setExtraIdentifierValuesToNull();
void setExtraIdentifierValuesToNull() /Deprecated/;
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model as NULL value(s).

.. versionadded:: 3.10

.. deprecated:: QGIS 3.12
use setExtraIdentifierValues( QVariantList() ) instead
%End

int extraIdentifierValueIndex() const;
Expand Down
5 changes: 4 additions & 1 deletion python/gui/auto_generated/qgsfeaturelistcombobox.sip.in
Expand Up @@ -116,11 +116,14 @@ identifierFields.
.. versionadded:: 3.10
%End

void setIdentifierValuesToNull();
void setIdentifierValuesToNull() /Deprecated/;
%Docstring
Sets the identifier values of the currently selected feature to NULL value(s).

.. versionadded:: 3.10

.. deprecated:: QGIS 3.12
use setIdentifierValues( QVariantList() ) instead
%End

QgsFeatureRequest currentFeatureRequest() const;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfeaturefiltermodel.cpp
Expand Up @@ -638,5 +638,5 @@ void QgsFeatureFilterModel::setExtraIdentifierValues( const QVariantList &extraI

void QgsFeatureFilterModel::setExtraIdentifierValuesToNull()
{
mExtraIdentifierValues = QVariantList();
setExtraIdentifierValues( QVariantList() );
}
3 changes: 2 additions & 1 deletion src/core/qgsfeaturefiltermodel.h
Expand Up @@ -196,8 +196,9 @@ class CORE_EXPORT QgsFeatureFilterModel : public QAbstractItemModel
* Allows specifying one value that does not need to match the filter criteria but will
* still be available in the model as NULL value(s).
* \since QGIS 3.10
* \deprecated since QGIS 3.12 use setExtraIdentifierValues( QVariantList() ) instead
*/
void setExtraIdentifierValuesToNull();
Q_DECL_DEPRECATED void setExtraIdentifierValuesToNull() SIP_DEPRECATED;

/**
* The index at which the extra identifier value is available within the model.
Expand Down
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -391,7 +391,7 @@ void QgsRelationReferenceWidget::deleteForeignKeys()
}
else
{
mComboBox->setIdentifierValuesToNull();
mComboBox->setIdentifierValues( QVariantList() );
}
mRemoveFKButton->setEnabled( false );
updateAttributeEditorFrame( QgsFeature() );
Expand Down Expand Up @@ -426,7 +426,7 @@ void QgsRelationReferenceWidget::showIndeterminateState()
}
else
{
whileBlocking( mComboBox )->setIdentifierValuesToNull();
whileBlocking( mComboBox )->setIdentifierValues( QVariantList() );
}
mRemoveFKButton->setEnabled( false );
updateAttributeEditorFrame( QgsFeature() );
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgsfeaturelistcombobox.h
Expand Up @@ -137,8 +137,9 @@ class GUI_EXPORT QgsFeatureListComboBox : public QComboBox
/**
* Sets the identifier values of the currently selected feature to NULL value(s).
* \since QGIS 3.10
* \deprecated since QGIS 3.12 use setIdentifierValues( QVariantList() ) instead
*/
void setIdentifierValuesToNull();
Q_DECL_DEPRECATED void setIdentifierValuesToNull() SIP_DEPRECATED;

/**
* Shorthand for getting a feature request to query the currently selected
Expand Down

0 comments on commit b0d9932

Please sign in to comment.