mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
make QgsRelation::RelationStrength a Q_ENUM and simplify code
This commit is contained in:
parent
27422fd717
commit
e87ba45edc
2
python/core/auto_additions/qgsrelation.py
Normal file
2
python/core/auto_additions/qgsrelation.py
Normal file
@ -0,0 +1,2 @@
|
||||
# The following has been generated automatically from src/core/qgsrelation.h
|
||||
QgsRelation.RelationStrength.baseClass = QgsRelation
|
@ -26,7 +26,6 @@ class QgsRelation
|
||||
{
|
||||
Association,
|
||||
Composition
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -126,14 +126,7 @@ void QgsRelation::writeXml( QDomNode &node, QDomDocument &doc ) const
|
||||
elem.setAttribute( QStringLiteral( "name" ), d->mRelationName );
|
||||
elem.setAttribute( QStringLiteral( "referencingLayer" ), d->mReferencingLayerId );
|
||||
elem.setAttribute( QStringLiteral( "referencedLayer" ), d->mReferencedLayerId );
|
||||
if ( d->mRelationStrength == RelationStrength::Composition )
|
||||
{
|
||||
elem.setAttribute( QStringLiteral( "strength" ), QStringLiteral( "Composition" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
elem.setAttribute( QStringLiteral( "strength" ), QStringLiteral( "Association" ) );
|
||||
}
|
||||
elem.setAttribute( QStringLiteral( "strength" ), qgsEnumValueToKey<RelationStrength>( d->mRelationStrength ) );
|
||||
|
||||
for ( const FieldPair &pair : qgis::as_const( d->mFieldPairs ) )
|
||||
{
|
||||
|
@ -58,8 +58,8 @@ class CORE_EXPORT QgsRelation
|
||||
{
|
||||
Association, //!< Loose relation, related elements are not part of the parent and a parent copy will not copy any children.
|
||||
Composition //!< Fix relation, related elements are part of the parent and a parent copy will copy any children or delete of parent will delete children
|
||||
|
||||
};
|
||||
Q_ENUM( RelationStrength )
|
||||
|
||||
#ifndef SIP_RUN
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user