QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
31 QgsLayerSettings settings;
32 settings.name = layer->name();
34 settings.mNamedStyle = layer->styleManager()->currentStyle();
36 switch ( layer->type() )
44 settings.mOpacity = vLayer->
opacity();
70 mLayerSettings[layer] = settings;
79 const QString sldStyleName { layer->customProperty(
"sldStyleName",
"" ).toString() };
80 if ( !sldStyleName.isEmpty() )
82 layer->styleManager()->removeStyle( sldStyleName );
83 layer->removeCustomProperty(
"sldStyleName" );
87 const QgsLayerSettings settings = mLayerSettings[layer];
88 layer->styleManager()->setCurrentStyle( settings.mNamedStyle );
89 layer->setName( mLayerSettings[layer].name );
91 switch ( layer->type() )
100 vLayer->
selectByIds( settings.mSelectedFeatureIds );
130 : mLayerRestorer( context.layers() )
Q_INVOKABLE void selectByIds(const QgsFeatureIds &ids, Qgis::SelectBehavior behavior=Qgis::SelectBehavior::SetSelection)
Selects matching features using a list of feature IDs.
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
@ VectorLayer
Vector layer.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
Rendering context for the WMS renderer.
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
@ RasterLayer
Raster layer.
const Q_INVOKABLE QgsFeatureIds & selectedFeatureIds() const
Returns a list of the selected features IDs in this layer.
virtual void setOpacity(double opacity)
Sets the opacity for the layer, where opacity is a value between 0 (totally transparent) and 1....
Represents a raster layer.
Median cut implementation.
QgsWmsRestorer(const QgsWmsRenderContext &context)
Constructor for QgsWmsRestorer.
QgsLayerRestorer(const QList< QgsMapLayer * > &layers)
Constructor for QgsLayerRestorer.
Represents a vector layer which manages a vector based data sets.
Base class for all map layer types. This is the base class for all map layer types (vector,...
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
~QgsLayerRestorer()
Destructor.
void setOpacity(double opacity)
Sets the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
@ PluginLayer
Plugin based layer.
virtual bool setSubsetString(const QString &subset)
Sets the string (typically sql) used to define a subset of the layer.
double opacity() const
Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....