mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
Added QgsRelation::Type
This commit is contained in:
parent
57f033f675
commit
449e2757d9
@ -1,2 +1,3 @@
|
||||
# The following has been generated automatically from src/core/qgsrelation.h
|
||||
QgsRelation.RelationType.baseClass = QgsRelation
|
||||
QgsRelation.RelationStrength.baseClass = QgsRelation
|
||||
|
@ -22,6 +22,12 @@ class QgsRelation
|
||||
|
||||
public:
|
||||
|
||||
enum RelationType
|
||||
{
|
||||
Normal,
|
||||
Generated,
|
||||
};
|
||||
|
||||
enum RelationStrength
|
||||
{
|
||||
Association,
|
||||
@ -333,6 +339,13 @@ Returns the parent polymorphic relation id. If the relation is a normal relation
|
||||
%Docstring
|
||||
Returns the parent polymorphic relation. If the relation is a normal relation, an invalid polymorphic relation is returned.
|
||||
|
||||
.. versionadded:: 3.18
|
||||
%End
|
||||
|
||||
RelationType type() const;
|
||||
%Docstring
|
||||
Returns the type of the relation
|
||||
|
||||
.. versionadded:: 3.18
|
||||
%End
|
||||
|
||||
|
@ -435,3 +435,11 @@ QgsPolymorphicRelation QgsRelation::polymorphicRelation() const
|
||||
|
||||
return mContext.project()->relationManager()->polymorphicRelation( d->mPolymorphicRelationId );
|
||||
}
|
||||
|
||||
QgsRelation::RelationType QgsRelation::type() const
|
||||
{
|
||||
if ( d->mPolymorphicRelationId.isNull() )
|
||||
return QgsRelation::Normal;
|
||||
else
|
||||
return QgsRelation::Generated;
|
||||
}
|
||||
|
@ -53,6 +53,16 @@ class CORE_EXPORT QgsRelation
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Enum holding the relations type
|
||||
*/
|
||||
enum RelationType
|
||||
{
|
||||
Normal, //! A normal relation
|
||||
Generated, //! A generated relation is a child of a polymorphic relation
|
||||
};
|
||||
Q_ENUM( RelationType )
|
||||
|
||||
/**
|
||||
* enum for the relation strength
|
||||
* Association, Composition
|
||||
@ -402,6 +412,12 @@ class CORE_EXPORT QgsRelation
|
||||
*/
|
||||
QgsPolymorphicRelation polymorphicRelation() const;
|
||||
|
||||
/**
|
||||
* Returns the type of the relation
|
||||
* \since QGIS 3.18
|
||||
*/
|
||||
RelationType type() const;
|
||||
|
||||
private:
|
||||
|
||||
mutable QExplicitlySharedDataPointer<QgsRelationPrivate> d;
|
||||
|
Loading…
x
Reference in New Issue
Block a user