Skip to content

Commit

Permalink
Add FeatureSymbology capability to QgsVectorDataProvider
Browse files Browse the repository at this point in the history
If present, the provider is able to retrieve embedded symbology
associated with individual features.
  • Loading branch information
nyalldawson committed Mar 6, 2021
1 parent b8b5528 commit d8aba0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Expand Up @@ -54,6 +54,7 @@ of feature and attribute information from a spatial datasource.
CreateRenderer,
CreateLabeling,
ReloadData,
FeatureSymbology,
};

typedef QFlags<QgsVectorDataProvider::Capability> Capabilities;
Expand Down
5 changes: 5 additions & 0 deletions src/core/vector/qgsvectordataprovider.cpp
Expand Up @@ -321,6 +321,11 @@ QString QgsVectorDataProvider::capabilitiesString() const
abilitiesList += tr( "Curved Geometries" );
}

if ( abilities & QgsVectorDataProvider::FeatureSymbology )
{
abilitiesList += tr( "Feature Symbology" );
}

return abilitiesList.join( QLatin1String( ", " ) );
}

Expand Down
1 change: 1 addition & 0 deletions src/core/vector/qgsvectordataprovider.h
Expand Up @@ -95,6 +95,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
CreateRenderer = 1 << 24, //!< Provider can create feature renderers using backend-specific formatting information. Since QGIS 3.2. See QgsVectorDataProvider::createRenderer().
CreateLabeling = 1 << 25, //!< Provider can set labeling settings using backend-specific formatting information. Since QGIS 3.6. See QgsVectorDataProvider::createLabeling().
ReloadData = 1 << 26, //!< Provider is able to force reload data
FeatureSymbology = 1 << 27, //!< Provider is able retrieve embedded symbology associated with individual features. Since QGIS 3.20.
};

Q_DECLARE_FLAGS( Capabilities, Capability )
Expand Down

0 comments on commit d8aba0c

Please sign in to comment.