"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gui/editorwidgets/qgsrelationreferencewidget.cpp" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

qgsrelationreferencewidget.cpp  (QGIS-final-3_14_15):qgsrelationreferencewidget.cpp  (QGIS-final-3_14_16)
skipping to change at line 304 skipping to change at line 304
for ( const QString &fieldName : qgis::as_const( mReferencedFields ) ) for ( const QString &fieldName : qgis::as_const( mReferencedFields ) )
titleFields << mFeature.attribute( fieldName ).toString(); titleFields << mFeature.attribute( fieldName ).toString();
title = titleFields.join( QStringLiteral( " " ) ); title = titleFields.join( QStringLiteral( " " ) );
} }
mLineEdit->setText( title ); mLineEdit->setText( title );
} }
else else
{ {
mComboBox->setIdentifierValues( values ); mComboBox->setIdentifierValues( values );
if ( mChainFilters ) if ( mEmbedForm || mChainFilters )
{ {
QVariant nullValue = QgsApplication::nullRepresentation();
QgsFeatureRequest request = mComboBox->currentFeatureRequest(); QgsFeatureRequest request = mComboBox->currentFeatureRequest();
mReferencedLayer->getFeatures( request ).nextFeature( mFeature ); mReferencedLayer->getFeatures( request ).nextFeature( mFeature );
}
if ( mChainFilters )
{
QVariant nullValue = QgsApplication::nullRepresentation();
const int count = std::min( mFilterComboBoxes.size(), mFilterFields.size() ); const int count = std::min( mFilterComboBoxes.size(), mFilterFields.size() );
for ( int i = 0; i < count; i++ ) for ( int i = 0; i < count; i++ )
{ {
QVariant v = mFeature.attribute( mFilterFields[i] ); QVariant v = mFeature.attribute( mFilterFields[i] );
QString f = v.isNull() ? nullValue.toString() : v.toString(); QString f = v.isNull() ? nullValue.toString() : v.toString();
mFilterComboBoxes.at( i )->setCurrentIndex( mFilterComboBoxes.at( i )->f indText( f ) ); mFilterComboBoxes.at( i )->setCurrentIndex( mFilterComboBoxes.at( i )->f indText( f ) );
} }
} }
} }
skipping to change at line 1002 skipping to change at line 1002
attributes.insert( fieldIdx, mComboBox->currentText() ); attributes.insert( fieldIdx, mComboBox->currentText() );
} }
} }
if ( mEditorContext.vectorLayerTools()->addFeature( mReferencedLayer, attribut es, f.geometry(), &f ) ) if ( mEditorContext.vectorLayerTools()->addFeature( mReferencedLayer, attribut es, f.geometry(), &f ) )
{ {
QVariantList attrs; QVariantList attrs;
for ( const QString &fieldName : qgis::as_const( mReferencedFields ) ) for ( const QString &fieldName : qgis::as_const( mReferencedFields ) )
attrs << f.attribute( fieldName ); attrs << f.attribute( fieldName );
mComboBox->setIdentifierValues( attrs ); setForeignKeys( attrs );
mAddEntryButton->setEnabled( false ); mAddEntryButton->setEnabled( false );
} }
unsetMapTool(); unsetMapTool();
} }
void QgsRelationReferenceWidget::updateAddEntryButton() void QgsRelationReferenceWidget::updateAddEntryButton()
{ {
mAddEntryButton->setVisible( mAllowAddFeatures && mMapToolDigitize ); mAddEntryButton->setVisible( mAllowAddFeatures && mMapToolDigitize );
 End of changes. 5 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)