QGIS/python/core/auto_generated/qgsmaplayer.sip.in

1642 lines
45 KiB
Plaintext
Raw Normal View History

2017-04-10 17:07:50 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2018-03-18 21:49:59 +01:00
class QgsMapLayer : QObject
{
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Base class for all map layer types.
This is the base class for all map layer types (vector, raster).
%End
2017-04-10 17:07:50 +10:00
%TypeHeaderCode
#include "qgsmaplayer.h"
%End
%ConvertToSubClassCode
2017-04-10 17:07:50 +10:00
QgsMapLayer *layer = qobject_cast<QgsMapLayer *>( sipCpp );
2017-04-10 17:07:50 +10:00
sipType = 0;
2017-04-10 17:07:50 +10:00
if ( layer )
{
2017-04-10 17:07:50 +10:00
switch ( layer->type() )
{
case QgsMapLayer::VectorLayer:
sipType = sipType_QgsVectorLayer;
break;
case QgsMapLayer::RasterLayer:
sipType = sipType_QgsRasterLayer;
break;
case QgsMapLayer::PluginLayer:
sipType = sipType_QgsPluginLayer;
break;
case QgsMapLayer::MeshLayer:
sipType = sipType_QgsMeshLayer;
break;
2017-04-10 17:07:50 +10:00
default:
sipType = nullptr;
2017-04-10 17:07:50 +10:00
break;
}
}
%End
public:
enum LayerType
{
VectorLayer,
RasterLayer,
PluginLayer,
MeshLayer
};
2018-01-02 18:58:05 +03:00
enum PropertyType
{
Style,
Metadata,
};
enum LayerFlag
{
Identifiable,
Removable,
Searchable,
};
typedef QFlags<QgsMapLayer::LayerFlag> LayerFlags;
enum StyleCategory
{
LayerConfiguration,
Symbology,
Symbology3D,
Labeling,
Fields,
Forms,
Actions,
MapTips,
Diagrams,
AttributeTable,
Rendering,
CustomProperties,
GeometryOptions,
AllStyleCategories
};
typedef QFlags<QgsMapLayer::StyleCategory> StyleCategories;
QgsMapLayer( QgsMapLayer::LayerType type = VectorLayer, const QString &name = QString(), const QString &source = QString() );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsMapLayer
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param type: layer type
:param name: display name for the layer
:param source: datasource of layer
2017-04-10 17:07:50 +10:00
%End
~QgsMapLayer();
2017-05-17 08:53:52 +02:00
virtual QgsMapLayer *clone() const = 0;
2017-05-16 13:34:18 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a new instance equivalent to this one except for the id which
is still unique.
:return: a new layer instance
2017-05-16 13:34:18 +02:00
.. versionadded:: 3.0
%End
QgsMapLayer::LayerType type() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type of the layer.
%End
QgsMapLayer::LayerFlags flags() const;
%Docstring
Returns the flags for this layer.
.. note::
Flags are options specified by the user used for the UI but are not preventing any API call.
For instance, even if the Removable flag is not set, the layer can still be removed with the API
but the action will not be listed in the legend menu.
.. versionadded:: 3.4
%End
void setFlags( QgsMapLayer::LayerFlags flags );
%Docstring
Returns the flags for this layer.
.. note::
Flags are options specified by the user used for the UI but are not preventing any API call.
For instance, even if the Removable flag is not set, the layer can still be removed with the API
but the action will not be listed in the legend menu.
.. versionadded:: 3.4
2018-01-02 18:58:05 +03:00
%End
static QString extensionPropertyType( PropertyType type );
%Docstring
Returns the extension of a Property.
:return: The extension
.. versionadded:: 3.0
2017-04-10 17:07:50 +10:00
%End
QString id() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-19 11:43:52 -04:00
Returns the layer's unique ID, which is used to access this layer from :py:class:`QgsProject`.
2017-04-10 17:07:50 +10:00
%End
void setName( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Set the display ``name`` of the layer.
.. seealso:: :py:func:`name`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.16
2017-04-10 17:07:50 +10:00
%End
QString name() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the display name of the layer.
.. seealso:: :py:func:`setName`
2017-04-10 17:07:50 +10:00
%End
virtual QgsDataProvider *dataProvider();
%Docstring
Returns the layer's data provider, it may be null.
%End
2017-04-10 17:07:50 +10:00
void setShortName( const QString &shortName );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the short name of the layer
used by QGIS Server to identify the layer.
:return: the layer short name
.. seealso:: :py:func:`shortName`
2017-04-10 17:07:50 +10:00
%End
QString shortName() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the short name of the layer
used by QGIS Server to identify the layer.
.. seealso:: :py:func:`setShortName`
2017-04-10 17:07:50 +10:00
%End
void setTitle( const QString &title );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the title of the layer
used by QGIS Server in GetCapabilities request.
.. seealso:: :py:func:`title`
2017-04-10 17:07:50 +10:00
%End
QString title() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the title of the layer
used by QGIS Server in GetCapabilities request.
:return: the layer title
.. seealso:: :py:func:`setTitle`
2017-04-10 17:07:50 +10:00
%End
void setAbstract( const QString &abstract );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the abstract of the layer
used by QGIS Server in GetCapabilities request.
:return: the layer abstract
.. seealso:: :py:func:`abstract`
2017-04-10 17:07:50 +10:00
%End
QString abstract() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the abstract of the layer
used by QGIS Server in GetCapabilities request.
:return: the layer abstract
.. seealso:: :py:func:`setAbstract`
2017-04-10 17:07:50 +10:00
%End
void setKeywordList( const QString &keywords );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the keyword list of the layer
used by QGIS Server in GetCapabilities request.
:return: the layer keyword list
.. seealso:: :py:func:`keywordList`
2017-04-10 17:07:50 +10:00
%End
QString keywordList() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the keyword list of the layer
used by QGIS Server in GetCapabilities request.
:return: the layer keyword list
.. seealso:: :py:func:`setKeywordList`
2017-04-10 17:07:50 +10:00
%End
2017-04-10 17:07:50 +10:00
void setDataUrl( const QString &dataUrl );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the DataUrl of the layer
used by QGIS Server in GetCapabilities request.
DataUrl is a a link to the underlying data represented by a particular layer.
:return: the layer DataUrl
.. seealso:: :py:func:`dataUrl`
2017-04-10 17:07:50 +10:00
%End
QString dataUrl() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the DataUrl of the layer
used by QGIS Server in GetCapabilities request.
DataUrl is a a link to the underlying data represented by a particular layer.
:return: the layer DataUrl
.. seealso:: :py:func:`setDataUrl`
2017-04-10 17:07:50 +10:00
%End
void setDataUrlFormat( const QString &dataUrlFormat );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the DataUrl format of the layer
used by QGIS Server in GetCapabilities request.
DataUrl is a a link to the underlying data represented by a particular layer.
:return: the layer DataUrl format
.. seealso:: :py:func:`dataUrlFormat`
2017-04-10 17:07:50 +10:00
%End
QString dataUrlFormat() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the DataUrl format of the layer
used by QGIS Server in GetCapabilities request.
DataUrl is a a link to the underlying data represented by a particular layer.
:return: the layer DataUrl format
.. seealso:: :py:func:`setDataUrlFormat`
2017-04-10 17:07:50 +10:00
%End
2017-04-10 17:07:50 +10:00
void setAttribution( const QString &attrib );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the attribution of the layer
used by QGIS Server in GetCapabilities request.
Attribution indicates the provider of a layer or collection of layers.
:return: the layer attribution
.. seealso:: :py:func:`attribution`
2017-04-10 17:07:50 +10:00
%End
2013-06-23 16:00:16 +02:00
QString attribution() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the attribution of the layer
used by QGIS Server in GetCapabilities request.
Attribution indicates the provider of a layer or collection of layers.
:return: the layer attribution
.. seealso:: :py:func:`setAttribution`
2017-04-10 17:07:50 +10:00
%End
void setAttributionUrl( const QString &attribUrl );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the attribution URL of the layer
used by QGIS Server in GetCapabilities request.
Attribution indicates the provider of a layer or collection of layers.
:return: the layer attribution URL
.. seealso:: :py:func:`attributionUrl`
2017-04-10 17:07:50 +10:00
%End
QString attributionUrl() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the attribution URL of the layer
used by QGIS Server in GetCapabilities request.
Attribution indicates the provider of a layer or collection of layers.
:return: the layer attribution URL
.. seealso:: :py:func:`setAttributionUrl`
2017-04-10 17:07:50 +10:00
%End
2017-04-10 17:07:50 +10:00
void setMetadataUrl( const QString &metaUrl );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the metadata URL of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrl is a a link to the detailed, standardized metadata about the data.
:return: the layer metadata URL
.. seealso:: :py:func:`metadataUrl`
2017-04-10 17:07:50 +10:00
%End
QString metadataUrl() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the metadata URL of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrl is a a link to the detailed, standardized metadata about the data.
:return: the layer metadata URL
.. seealso:: :py:func:`setMetadataUrl`
2017-04-10 17:07:50 +10:00
%End
void setMetadataUrlType( const QString &metaUrlType );
%Docstring
2017-12-15 10:36:55 -04:00
Set the metadata type of the layer
used by QGIS Server in GetCapabilities request
MetadataUrlType indicates the standard to which the metadata complies.
:return: the layer metadata type
.. seealso:: :py:func:`metadataUrlType`
2017-04-10 17:07:50 +10:00
%End
QString metadataUrlType() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the metadata type of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrlType indicates the standard to which the metadata complies.
:return: the layer metadata type
.. seealso:: :py:func:`setMetadataUrlType`
2017-04-10 17:07:50 +10:00
%End
void setMetadataUrlFormat( const QString &metaUrlFormat );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the metadata format of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrlType indicates how the metadata is structured.
:return: the layer metadata format
.. seealso:: :py:func:`metadataUrlFormat`
2017-04-10 17:07:50 +10:00
%End
QString metadataUrlFormat() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the metadata format of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrlType indicates how the metadata is structured.
:return: the layer metadata format
.. seealso:: :py:func:`setMetadataUrlFormat`
2017-04-10 17:07:50 +10:00
%End
void setBlendMode( QPainter::CompositionMode blendMode );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Set the blending mode used for rendering a layer.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param blendMode: new blending mode
.. seealso:: :py:func:`blendMode`
2017-04-10 17:07:50 +10:00
%End
2013-06-23 16:00:16 +02:00
QPainter::CompositionMode blendMode() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the current blending mode for a layer.
.. seealso:: :py:func:`setBlendMode`
2017-04-10 17:07:50 +10:00
%End
2013-06-23 16:00:16 +02:00
bool readOnly() const;
2017-04-10 17:07:50 +10:00
%Docstring
Returns if this layer is read only.
%End
virtual void reload();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Synchronises with changes in the datasource
2017-04-10 17:07:50 +10:00
%End
2017-04-10 17:07:50 +10:00
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) = 0 /Factory/;
%Docstring
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context
2017-12-15 10:36:55 -04:00
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.4
%End
virtual QgsRectangle extent() const;
2017-04-10 17:07:50 +10:00
%Docstring
Returns the extent of the layer.
%End
bool isValid() const;
2017-04-10 17:07:50 +10:00
%Docstring
Returns the status of the layer. An invalid layer is one which has a bad datasource
2017-12-15 10:36:55 -04:00
or other problem. Child classes set this flag when initialized.
:return: true if the layer is valid and can be accessed
2017-04-10 17:07:50 +10:00
%End
QString publicSource() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Gets a version of the internal layer definition that has sensitive
bits removed (for example, the password). This function should
be used when displaying the source name for general viewing.
.. seealso:: :py:func:`source`
2017-04-10 17:07:50 +10:00
%End
QString source() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the source for the layer. This source may contain usernames, passwords
and other sensitive information.
.. seealso:: :py:func:`publicSource`
2017-04-10 17:07:50 +10:00
%End
virtual QStringList subLayers() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the sublayers of this layer.
(Useful for providers that manage their own layers, such as WMS).
2017-04-10 17:07:50 +10:00
%End
virtual void setLayerOrder( const QStringList &layers );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Reorders the *previously selected* sublayers of this layer from bottom to top.
(Useful for providers that manage their own layers, such as WMS).
2017-04-10 17:07:50 +10:00
%End
2017-04-10 17:07:50 +10:00
virtual void setSubLayerVisibility( const QString &name, bool visible );
%Docstring
2017-12-15 10:36:55 -04:00
Set the visibility of the given sublayer name.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param name: sublayer name
:param visible: sublayer visibility
2017-04-10 17:07:50 +10:00
%End
virtual bool isEditable() const;
2017-04-10 17:07:50 +10:00
%Docstring
Returns true if the layer can be edited.
%End
virtual bool isSpatial() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the layer is considered a spatial layer, ie it has some form of geometry associated with it.
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.16
%End
bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context );
2017-04-10 17:07:50 +10:00
%Docstring
Sets state from DOM document
2017-12-15 21:36:08 -04:00
:param layerElement: The DOM element corresponding to ``maplayer'' tag
2017-12-15 10:36:55 -04:00
:param context: writing context (e.g. for conversion between relative and absolute paths)
2017-04-10 17:07:50 +10:00
\note
2017-04-20 13:48:50 +02:00
The DOM node corresponds to a DOM document project file XML element read
2017-12-19 11:43:52 -04:00
by :py:class:`QgsProject`.
2017-04-20 13:48:50 +02:00
This, in turn, calls readXml() (and then readSymbology()), which is overridable
by sub-classes so that they can read their own specific state from the given DOM node.
2017-04-20 13:48:50 +02:00
2017-12-19 11:43:52 -04:00
Invoked by :py:func:`QgsProject.read()`
2017-04-20 13:48:50 +02:00
2017-04-10 17:07:50 +10:00
:return: true if successful
%End
bool writeLayerXml( QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
2017-04-10 17:07:50 +10:00
%Docstring
Stores state in DOM node
2017-12-15 21:36:08 -04:00
:param layerElement: is a DOM element corresponding to ``maplayer'' tag
:param document: is a the DOM document being written
2017-12-15 10:36:55 -04:00
:param context: reading context (e.g. for conversion between relative and absolute paths)
\note
2017-04-10 17:07:50 +10:00
The DOM node corresponds to a DOM document project file XML element to be
2017-12-19 11:43:52 -04:00
written by :py:class:`QgsProject`.
2017-04-10 17:07:50 +10:00
This, in turn, calls writeXml() (and then writeSymbology), which is over-rideable
by sub-classes so that they can write their own specific state to the given DOM node.
2017-04-10 17:07:50 +10:00
2017-12-19 11:43:52 -04:00
Invoked by :py:func:`QgsProject.write()`
2017-12-15 10:36:55 -04:00
:return: true if successful
2017-04-10 17:07:50 +10:00
%End
virtual void resolveReferences( QgsProject *project );
%Docstring
2017-12-15 10:36:55 -04:00
Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
.. versionadded:: 3.0
%End
QStringList customPropertyKeys() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns list of all keys within custom properties. Properties are stored in a map and saved in project file.
.. seealso:: :py:func:`customProperty`
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
2017-04-10 17:07:50 +10:00
void setCustomProperty( const QString &key, const QVariant &value );
%Docstring
2017-12-15 10:36:55 -04:00
Set a custom property for layer. Properties are stored in a map and saved in project file.
.. seealso:: :py:func:`customProperty`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`removeCustomProperty`
2017-04-10 17:07:50 +10:00
%End
QVariant customProperty( const QString &value, const QVariant &defaultValue = QVariant() ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Read a custom property from layer. Properties are stored in a map and saved in project file.
.. seealso:: :py:func:`setCustomProperty`
2017-04-10 17:07:50 +10:00
%End
2017-05-16 13:34:18 +02:00
void setCustomProperties( const QgsObjectCustomProperties &properties );
%Docstring
2017-12-15 10:36:55 -04:00
Set custom properties for layer. Current properties are dropped.
2017-05-16 13:34:18 +02:00
.. versionadded:: 3.0
%End
2017-04-10 17:07:50 +10:00
void removeCustomProperty( const QString &key );
%Docstring
2017-12-15 10:36:55 -04:00
Remove a custom property from layer. Properties are stored in a map and saved in project file.
.. seealso:: :py:func:`setCustomProperty`
2017-04-10 17:07:50 +10:00
%End
2013-06-23 16:00:16 +02:00
virtual QgsError error() const;
2017-04-10 17:07:50 +10:00
%Docstring
Gets current status error. This error describes some principal problem
2017-12-15 10:36:55 -04:00
for which layer cannot work and thus is not valid. It is not last error
after accessing data by draw() etc.
2017-04-10 17:07:50 +10:00
%End
2013-06-23 16:00:16 +02:00
QgsCoordinateReferenceSystem crs() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the layer's spatial reference system.
2017-04-10 17:07:50 +10:00
.. versionadded:: 1.4
%End
2017-04-10 17:07:50 +10:00
void setCrs( const QgsCoordinateReferenceSystem &srs, bool emitSignal = true );
%Docstring
Sets layer's spatial reference system
%End
static QString formatLayerName( const QString &name );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
A convenience function to capitalize and format a layer ``name``.
2018-01-02 18:58:05 +03:00
.. versionadded:: 3.0
%End
virtual QString metadataUri() const;
%Docstring
Retrieve the metadata URI for this layer
(either as a .qmd file on disk or as a
record in the users style table in their personal qgis.db)
:return: a QString with the metadata file name
.. versionadded:: 3.0
%End
void exportNamedMetadata( QDomDocument &doc, QString &errorMsg ) const;
%Docstring
Export the current metadata of this layer as named metadata in a QDomDocument
:param doc: the target QDomDocument
:param errorMsg: this QString will be initialized on error
.. versionadded:: 3.0
%End
virtual QString saveDefaultMetadata( bool &resultFlag /Out/ );
%Docstring
Save the current metadata of this layer as the default metadata
(either as a .qmd file on disk or as a
record in the users style table in their personal qgis.db)
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to save the default metadata.
2018-01-02 18:58:05 +03:00
:return: a QString with any status messages
.. versionadded:: 3.0
%End
QString saveNamedMetadata( const QString &uri, bool &resultFlag );
%Docstring
Save the current metadata of this layer as a named metadata
(either as a .qmd file on disk or as a
record in the users style table in their personal qgis.db)
:param uri: the file name or other URI for the
metadata file. First an attempt will be made to see if this
is a file and save to that, if that fails the qgis.db metadata
table will be used to create a metadata entry who's
key matches the URI.
2018-01-02 18:58:05 +03:00
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to save the default metadata.
2018-01-02 18:58:05 +03:00
:return: a QString with any status messages
.. versionadded:: 3.0
%End
virtual QString loadNamedMetadata( const QString &uri, bool &resultFlag /Out/ );
%Docstring
Retrieve a named metadata for this layer if one
exists (either as a .qmd file on disk or as a
record in the users style table in their personal qgis.db)
:param uri: - the file name or other URI for the
metadata file. First an attempt will be made to see if this
is a file and load that, if that fails the qgis.db metadata
table will be consulted to see if there is a metadata who's
key matches the URI.
2018-01-02 18:58:05 +03:00
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to load the default metadata.
2018-01-02 18:58:05 +03:00
:return: a QString with any status messages
.. versionadded:: 3.0
%End
QString loadDefaultMetadata( bool &resultFlag );
%Docstring
Retrieve the default metadata for this layer if one
exists (either as a .qmd file on disk or as a
record in the users metadata table in their personal qgis.db)
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to load the default metadata.
2018-01-02 18:58:05 +03:00
:return: a QString with any status messages
.. versionadded:: 3.0
%End
bool loadNamedMetadataFromDatabase( const QString &db, const QString &uri, QString &qmd );
%Docstring
Retrieve a named metadata for this layer from a sqlite database.
:param db: path to sqlite database
:param uri: uri for table
:param qmd: will be set to QMD xml metadata content from database
:return: true if style was successfully loaded
.. versionadded:: 3.0
%End
bool importNamedMetadata( QDomDocument &document, QString &errorMessage );
%Docstring
Import the metadata of this layer from a QDomDocument
:param document: source QDomDocument
:param errorMessage: this QString will be initialized on error
:return: true on success
.. versionadded:: 3.0
2017-04-10 17:07:50 +10:00
%End
virtual QString styleURI() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Retrieve the style URI for this layer
(either as a .qml file on disk or as a
record in the users style table in their personal qgis.db)
:return: a QString with the style file name
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`also`
2017-04-10 17:07:50 +10:00
%End
virtual QString loadDefaultStyle( bool &resultFlag /Out/ );
%Docstring
2017-12-15 10:36:55 -04:00
Retrieve the default style for this layer if one
exists (either as a .qml file on disk or as a
record in the users style table in their personal qgis.db)
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to load the default style.
2017-12-15 10:36:55 -04:00
:return: a QString with any status messages
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`also`
2017-04-10 17:07:50 +10:00
%End
virtual QString loadNamedStyle( const QString &uri, bool &resultFlag /Out/, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Retrieve a named style for this layer if one
exists (either as a .qml file on disk or as a
record in the users style table in their personal qgis.db)
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param uri: - the file name or other URI for the
style file. First an attempt will be made to see if this
is a file and load that, if that fails the qgis.db styles
table will be consulted to see if there is a style who's
key matches the URI.
2017-12-15 10:36:55 -04:00
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to load the default style.
:param categories: the style categories to be loaded.
2017-12-15 10:36:55 -04:00
:return: a QString with any status messages
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`also`
2017-04-10 17:07:50 +10:00
%End
virtual bool loadNamedStyleFromDatabase( const QString &db, const QString &uri, QString &qml /Out/ );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Retrieve a named style for this layer from a sqlite database.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param db: path to sqlite database
:param uri: uri for table
:param qml: will be set to QML style content from database
:return: true if style was successfully loaded
2017-04-10 17:07:50 +10:00
%End
2018-09-12 14:24:29 -04:00
virtual bool importNamedStyle( QDomDocument &doc, QString &errorMsg /Out/,
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Import the properties of this layer from a QDomDocument
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param doc: source QDomDocument
:param errorMsg: this QString will be initialized on error
during the execution of readSymbology
2018-09-12 14:24:29 -04:00
:param categories: the style categories to import
2017-12-15 10:36:55 -04:00
:return: true on success
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.8
%End
virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg /Out/, const QgsReadWriteContext &context = QgsReadWriteContext(),
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Export the properties of this layer as named style in a QDomDocument
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param doc: the target QDomDocument
:param errorMsg: this QString will be initialized on error
:param context: read write context
2018-09-12 14:24:29 -04:00
:param categories: the style categories to export
during the execution of writeSymbology
2017-04-10 17:07:50 +10:00
%End
2013-06-23 16:00:16 +02:00
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Export the properties of this layer as SLD style in a QDomDocument
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param doc: the target QDomDocument
:param errorMsg: this QString will be initialized on error
during the execution of writeSymbology
2017-04-10 17:07:50 +10:00
%End
virtual QString saveDefaultStyle( bool &resultFlag /Out/ );
%Docstring
2017-12-15 10:36:55 -04:00
Save the properties of this layer as the default style
(either as a .qml file on disk or as a
record in the users style table in their personal qgis.db)
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to save the default style.
2017-12-15 10:36:55 -04:00
:return: a QString with any status messages
.. seealso:: :py:func:`loadNamedStyle`
2017-04-10 17:07:50 +10:00
%End
2013-06-23 16:00:16 +02:00
virtual QString saveNamedStyle( const QString &uri, bool &resultFlag /Out/, StyleCategories categories = AllStyleCategories );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Save the properties of this layer as a named style
(either as a .qml file on disk or as a
record in the users style table in their personal qgis.db)
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param uri: the file name or other URI for the
style file. First an attempt will be made to see if this
is a file and save to that, if that fails the qgis.db styles
table will be used to create a style entry who's
key matches the URI.
2017-12-15 10:36:55 -04:00
:param resultFlag: a reference to a flag that will be set to false if
we did not manage to save the default style.
2018-09-13 16:28:03 -04:00
:param categories: the style categories to be saved.
2017-12-15 10:36:55 -04:00
:return: a QString with any status messages
.. seealso:: :py:func:`saveDefaultStyle`
2017-04-10 17:07:50 +10:00
%End
virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Saves the properties of this layer to an SLD format file.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param uri: uri of destination for exported SLD file.
:param resultFlag: a reference to a flag that will be set to false if
the SLD file could not be generated
2017-12-15 10:36:55 -04:00
:return: a string with any status or error messages
.. seealso:: :py:func:`loadSldStyle`
2017-04-10 17:07:50 +10:00
%End
2016-07-15 08:08:24 +10:00
virtual QString loadSldStyle( const QString &uri, bool &resultFlag );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to style the layer using the formatting from an SLD type file.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param uri: uri of source SLD file
:param resultFlag: a reference to a flag that will be set to false if
the SLD file could not be loaded
2017-12-15 10:36:55 -04:00
:return: a string with any status or error messages
.. seealso:: :py:func:`saveSldStyle`
2017-04-10 17:07:50 +10:00
%End
virtual bool readSld( const QDomNode &node, QString &errorMessage );
2017-04-10 17:07:50 +10:00
virtual bool readSymbology( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) = 0;
2017-04-10 17:07:50 +10:00
%Docstring
Read the symbology for the current layer from the DOM node supplied.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param node: node that will contain the symbology definition for this layer.
:param errorMessage: reference to string that will be updated with any error messages
:param context: reading context (used for transform from relative to absolute paths)
:param categories: the style categories to be read
2017-12-15 10:36:55 -04:00
:return: true in case of success.
2017-04-10 17:07:50 +10:00
%End
virtual bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories );
2017-04-10 17:07:50 +10:00
%Docstring
Read the style for the current layer from the DOM node supplied.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param node: node that will contain the style definition for this layer.
:param errorMessage: reference to string that will be updated with any error messages
:param context: reading context (used for transform from relative to absolute paths)
:param categories: the style categories to be read
2017-12-15 10:36:55 -04:00
:return: true in case of success.
2017-04-10 17:07:50 +10:00
.. note::
To be implemented in subclasses. Default implementation does nothing and returns false.
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.16
2017-04-10 17:07:50 +10:00
%End
virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
StyleCategories categories = AllStyleCategories ) const = 0;
2017-04-10 17:07:50 +10:00
%Docstring
Write the style for the layer into the docment provided.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param node: the node that will have the style element added to it.
:param doc: the document that will have the QDomNode added.
:param errorMessage: reference to string that will be updated with any error messages
:param context: writing context (used for transform from absolute to relative paths)
:param categories: the style categories to be written
2017-12-15 10:36:55 -04:00
.. note::
There is a confusion of terms with the GUI. This method actually writes what is called a style in the application.
2017-12-15 10:36:55 -04:00
:return: true in case of success.
2017-04-10 17:07:50 +10:00
%End
virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
StyleCategories categories = AllStyleCategories ) const;
2017-04-10 17:07:50 +10:00
%Docstring
Write just the symbology information for the layer into the document
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param node: the node that will have the style element added to it.
:param doc: the document that will have the QDomNode added.
:param errorMessage: reference to string that will be updated with any error messages
:param context: writing context (used for transform from absolute to relative paths)
:param categories: the style categories to be written
2017-12-15 10:36:55 -04:00
:return: true in case of success.
2017-04-10 17:07:50 +10:00
.. note::
To be implemented in subclasses. Default implementation does nothing and returns false.
2018-05-28 11:31:08 -04:00
.. note::
There is a confusion of terms with the GUI. This method actually writes what is known as the symbology in the application.
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.16
2017-04-10 17:07:50 +10:00
%End
virtual void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false );
%Docstring
Updates the data source of the layer. The layer's renderer and legend will be preserved only
if the geometry type of the new data source matches the current geometry type of the layer.
Subclasses should override this method: default implementation does nothing.
:param dataSource: new layer data source
:param baseName: base name of the layer
:param provider: provider string
:param options: provider options
:param loadDefaultStyleFlag: set to true to reset the layer's style to the default for the
data source
.. seealso:: :py:func:`dataSourceChanged`
.. versionadded:: 3.6
%End
QString providerType() const;
%Docstring
Returns the provider type (provider key) for this layer
%End
QUndoStack *undoStack();
2017-04-10 17:07:50 +10:00
%Docstring
Returns pointer to layer's undo stack
2017-04-10 17:07:50 +10:00
%End
QUndoStack *undoStackStyles();
2017-04-10 17:07:50 +10:00
%Docstring
Returns pointer to layer's style undo stack
2017-12-15 10:36:55 -04:00
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.16
%End
void setLegendUrl( const QString &legendUrl );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the URL for the layer's legend.
2017-04-10 17:07:50 +10:00
%End
QString legendUrl() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the URL for the layer's legend.
2017-04-10 17:07:50 +10:00
%End
void setLegendUrlFormat( const QString &legendUrlFormat );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the format for a URL based layer legend.
2017-04-10 17:07:50 +10:00
%End
QString legendUrlFormat() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the format for a URL based layer legend.
2017-04-10 17:07:50 +10:00
%End
void setLegend( QgsMapLayerLegend *legend /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Assign a legend controller to the map layer. The object will be responsible for providing legend items.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param legend: Takes ownership of the object. Can be null pointer
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.6
%End
QgsMapLayerLegend *legend() const;
%Docstring
2017-12-15 10:36:55 -04:00
Can be null.
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.6
%End
QgsMapLayerStyleManager *styleManager() const;
%Docstring
Gets access to the layer's style manager. Style manager allows switching between multiple styles.
2017-12-15 10:36:55 -04:00
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.8
%End
2014-05-18 15:22:26 +02:00
2017-09-15 16:44:42 +02:00
void setRenderer3D( QgsAbstract3DRenderer *renderer /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Sets 3D renderer for the layer. Takes ownership of the renderer.
2017-09-15 16:44:42 +02:00
.. versionadded:: 3.0
%End
2017-09-15 16:44:42 +02:00
QgsAbstract3DRenderer *renderer3D() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns 3D renderer associated with the layer. May be null.
2017-09-15 16:44:42 +02:00
.. versionadded:: 3.0
%End
bool isInScaleRange( double scale ) const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Tests whether the layer should be visible at the specified ``scale``.
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
:return: true if the layer is visible at the given scale.
.. seealso:: :py:func:`minimumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`maximumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`hasScaleBasedVisibility`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.16
2017-04-10 17:07:50 +10:00
%End
double minimumScale() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the minimum map scale (i.e. most "zoomed out" scale) at which the layer will be visible.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
A scale of 0 indicates no minimum scale visibility.
.. note::
Scale based visibility is only used if setScaleBasedVisibility() is set to true.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setMinimumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`maximumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`hasScaleBasedVisibility`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`isInScaleRange`
2017-04-10 17:07:50 +10:00
%End
double maximumScale() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the maximum map scale (i.e. most "zoomed in" scale) at which the layer will be visible.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
A scale of 0 indicates no maximum scale visibility.
.. note::
Scale based visibility is only used if setScaleBasedVisibility() is set to true.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setMaximumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`minimumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`hasScaleBasedVisibility`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`isInScaleRange`
2017-04-10 17:07:50 +10:00
%End
bool hasScaleBasedVisibility() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether scale based visibility is enabled for the layer.
:return: true if scale based visibility is enabled
.. seealso:: :py:func:`minimumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`maximumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setScaleBasedVisibility`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`isInScaleRange`
2017-04-10 17:07:50 +10:00
%End
bool hasAutoRefreshEnabled() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if auto refresh is enabled for the layer.
.. seealso:: :py:func:`autoRefreshInterval`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setAutoRefreshEnabled`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-04-10 17:07:50 +10:00
%End
int autoRefreshInterval() const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the auto refresh interval (in milliseconds). Note that
auto refresh is only active when hasAutoRefreshEnabled() is true.
2018-05-25 09:00:58 +10:00
.. seealso:: :py:func:`hasAutoRefreshEnabled`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setAutoRefreshInterval`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-04-10 17:07:50 +10:00
%End
void setAutoRefreshInterval( int interval );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the auto refresh interval (in milliseconds) for the layer. This
will cause the layer to be automatically redrawn on a matching interval.
Note that auto refresh must be enabled by calling setAutoRefreshEnabled().
Note that auto refresh triggers deferred repaints of the layer. Any map
canvas must be refreshed separately in order to view the refreshed layer.
2017-04-10 17:07:50 +10:00
.. seealso:: :py:func:`autoRefreshInterval`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setAutoRefreshEnabled`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-04-10 17:07:50 +10:00
%End
void setAutoRefreshEnabled( bool enabled );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether auto refresh is enabled for the layer.
.. seealso:: :py:func:`hasAutoRefreshEnabled`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setAutoRefreshInterval`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-04-10 17:07:50 +10:00
%End
2017-04-10 16:41:36 +10:00
virtual const QgsLayerMetadata &metadata() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a reference to the layer's metadata store.
.. seealso:: :py:func:`setMetadata`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`metadataChanged`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-04-10 16:41:36 +10:00
%End
virtual void setMetadata( const QgsLayerMetadata &metadata );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the layer's ``metadata`` store.
.. seealso:: :py:func:`metadata`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`metadataChanged`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-04-10 16:41:36 +10:00
%End
virtual QString htmlMetadata() const;
%Docstring
2017-12-15 10:36:55 -04:00
Obtain a formatted HTML string containing assorted metadata for this layer.
.. versionadded:: 3.0
%End
virtual QDateTime timestamp() const;
%Docstring
Time stamp of data source in the moment when data/metadata were loaded by provider
%End
virtual QSet<QgsMapLayerDependency> dependencies() const;
%Docstring
Gets the list of dependencies. This includes data dependencies set by the user (:py:func:`setDataDependencies`)
2017-12-15 10:36:55 -04:00
as well as dependencies given by the provider
:return: a set of QgsMapLayerDependency
.. versionadded:: 3.0
%End
QString refreshOnNotifyMessage() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the message that should be notified by the provider to triggerRepaint
.. versionadded:: 3.0
%End
bool isRefreshOnNotifyEnabled() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the refresh on provider nofification is enabled
.. versionadded:: 3.0
%End
QString originalXmlProperties() const;
%Docstring
Returns the XML properties of the original layer as they were when the layer
was first read from the project file. In case of new layers this is normally empty.
The storage format for the XML is qlr
.. versionadded:: 3.6
%End
void setOriginalXmlProperties( const QString &originalXmlProperties );
%Docstring
Sets the original XML properties for the layer to ``originalXmlProperties``
The storage format for the XML is qlr
.. versionadded:: 3.6
%End
public slots:
void setMinimumScale( double scale );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the minimum map ``scale`` (i.e. most "zoomed out" scale) at which the layer will be visible.
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
A ``scale`` of 0 indicates no minimum scale visibility.
.. note::
Scale based visibility is only used if setScaleBasedVisibility() is set to true.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`minimumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setMaximumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setScaleBasedVisibility`
2017-04-10 17:07:50 +10:00
%End
void setMaximumScale( double scale );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the maximum map ``scale`` (i.e. most "zoomed in" scale) at which the layer will be visible.
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
A ``scale`` of 0 indicates no maximum scale visibility.
.. note::
Scale based visibility is only used if setScaleBasedVisibility() is set to true.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`maximumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setMinimumScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setScaleBasedVisibility`
2017-04-10 17:07:50 +10:00
%End
void setScaleBasedVisibility( bool enabled );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether scale based visibility is enabled for the layer.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param enabled: set to true to enable scale based visibility
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setMinimumScale`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setMaximumScale`
2017-12-15 10:36:55 -04:00
2018-05-25 09:00:58 +10:00
.. seealso:: :py:func:`hasScaleBasedVisibility`
2017-04-10 17:07:50 +10:00
%End
void triggerRepaint( bool deferredUpdate = false );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
Will emit a repaintRequested() signal.
If ``deferredUpdate`` is true then the layer will only be repainted when the canvas is next
re-rendered, and will not trigger any canvas redraws itself.
2017-04-10 17:07:50 +10:00
.. note::
in 2.6 function moved from vector/raster subclasses to QgsMapLayer
%End
void emitStyleChanged();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Triggers an emission of the styleChanged() signal.
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.16
%End
virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the list of dependencies.
.. seealso:: :py:func:`dependencies`
2017-04-10 17:07:50 +10:00
2017-12-15 10:36:55 -04:00
:param layers: set of QgsMapLayerDependency. Only user-defined dependencies will be added
:return: false if a dependency cycle has been detected
2017-04-10 17:07:50 +10:00
.. versionadded:: 3.0
%End
[FEATURE] layer refresh and trigger actions on provider notification [needs-docs] In vector layer properties (only usefull for postgres datasources) **in the rendering tab** A "Refresh layer on notification" checkbox has been added to refresh layer on provider notification. For a postgres datasource, if a `NOTIFY qgis;` command is issued by one of the database clients, a refresh of the layer will occur. If the "Only if message is" checkbox is checked, the notification will trigger the refresh only if the message contend is the one specified, e.g. if the user enters "refresh" in the box right next to the "Only if message is" checkbox, then a `NOTIFY qgis, 'refresh';` command in the datatabase will trigger a layer refresh, but `NOTIFY qgis;` or `NOTIFY qgis, 'something else';` won't. **in the actions tab** A column "On notification" has been added, the action editor widget a has text field "Execute if notification message matches" to specify a filter for notification from the provider. The filter is a Perl-type regex. Note that, as opposed to the "layer refresh" that Exemple: - QGIS side "Execute if notification message matches" `^trigger my action` - Postgres side: `NOTIFY qgis, 'trigger my action'` will trigger the action - Postgres side: `NOTIFY qgis, 'trigger my action some additional data'` will trigger the action - Postgres side: `NOTIFY qgis, 'do not trigger my action some additional data'` will NOT trigger the action Please note that if the `^`, which means "starts with", in `^trigger my action` had been ommited, the last notification would have triggered the action because the notification message contains the `trigger my action` A new qgis variable `notification_message` is available for use in actions, it holds the contend of the notification message. To continue with the previous exemple, if the action is of python type with the code: ```python print('[% @notification_message %]') ``` The three notifictions above will result in two printed lines ``` trigger my action trigger my action some additional data ``` User Warning: For postgres providers, if the "Refresh layer on notification" is checked, or if one layer action has "On notification" specified, a new connection to the database is made to listen to postgres notifications. This olds even if transaction groups are enabled at the project level. Note that once the notification mechanism is started in a QGIS session, it will not stop, even if there is no more need for it (Refresh layer on notification" unchecked and no "On notification" in any action). Consequently the connection listening to notification will remain open. IMPLEMENTATION DETAILS: A notify signal has been added to the abstract QgsVectorDataProvider along with a setListening function that enables/disble the notification mechanism. For the moment only the postgres provider implements the notification. QgsAction has a notificationMessage member function that holds the regex to match to trigger action QgsActionManager becomes a QObject and is doing the filtering and execute actions on notifications. The notification notion extends beyond SRGBD servers (postgres and oracle at least have the notify) and the "watch file" in the delimitedtext provider could also benefit from this interface. For the postgres provider a thread is created with a second connection to the database. This thread is responsible for listening postgres notifications. It would be nice to avoid the creation of one listening chanel per provider in the case transaction groups are enabled. Please note that when listening starts (a thread and connection is created in the postgres provider) it cannot be stopped by removing the connected actions or unchecking the refresh check box. Indeed, since we don't know who needs the signals, we dont't want to stop the service. The service will not restart in the next qgis session though. If this behavior is not deemed appropriate, we could use ``` int QObject::receivers ( const char * signal ) const ``` and have QgsDataProvider::setListening return a bool to tell the caller if the signal has actually been closed.
2017-09-08 16:42:30 +02:00
void setRefreshOnNotifyEnabled( bool enabled );
%Docstring
2017-12-15 10:36:55 -04:00
Set whether provider notification is connected to triggerRepaint
[FEATURE] layer refresh and trigger actions on provider notification [needs-docs] In vector layer properties (only usefull for postgres datasources) **in the rendering tab** A "Refresh layer on notification" checkbox has been added to refresh layer on provider notification. For a postgres datasource, if a `NOTIFY qgis;` command is issued by one of the database clients, a refresh of the layer will occur. If the "Only if message is" checkbox is checked, the notification will trigger the refresh only if the message contend is the one specified, e.g. if the user enters "refresh" in the box right next to the "Only if message is" checkbox, then a `NOTIFY qgis, 'refresh';` command in the datatabase will trigger a layer refresh, but `NOTIFY qgis;` or `NOTIFY qgis, 'something else';` won't. **in the actions tab** A column "On notification" has been added, the action editor widget a has text field "Execute if notification message matches" to specify a filter for notification from the provider. The filter is a Perl-type regex. Note that, as opposed to the "layer refresh" that Exemple: - QGIS side "Execute if notification message matches" `^trigger my action` - Postgres side: `NOTIFY qgis, 'trigger my action'` will trigger the action - Postgres side: `NOTIFY qgis, 'trigger my action some additional data'` will trigger the action - Postgres side: `NOTIFY qgis, 'do not trigger my action some additional data'` will NOT trigger the action Please note that if the `^`, which means "starts with", in `^trigger my action` had been ommited, the last notification would have triggered the action because the notification message contains the `trigger my action` A new qgis variable `notification_message` is available for use in actions, it holds the contend of the notification message. To continue with the previous exemple, if the action is of python type with the code: ```python print('[% @notification_message %]') ``` The three notifictions above will result in two printed lines ``` trigger my action trigger my action some additional data ``` User Warning: For postgres providers, if the "Refresh layer on notification" is checked, or if one layer action has "On notification" specified, a new connection to the database is made to listen to postgres notifications. This olds even if transaction groups are enabled at the project level. Note that once the notification mechanism is started in a QGIS session, it will not stop, even if there is no more need for it (Refresh layer on notification" unchecked and no "On notification" in any action). Consequently the connection listening to notification will remain open. IMPLEMENTATION DETAILS: A notify signal has been added to the abstract QgsVectorDataProvider along with a setListening function that enables/disble the notification mechanism. For the moment only the postgres provider implements the notification. QgsAction has a notificationMessage member function that holds the regex to match to trigger action QgsActionManager becomes a QObject and is doing the filtering and execute actions on notifications. The notification notion extends beyond SRGBD servers (postgres and oracle at least have the notify) and the "watch file" in the delimitedtext provider could also benefit from this interface. For the postgres provider a thread is created with a second connection to the database. This thread is responsible for listening postgres notifications. It would be nice to avoid the creation of one listening chanel per provider in the case transaction groups are enabled. Please note that when listening starts (a thread and connection is created in the postgres provider) it cannot be stopped by removing the connected actions or unchecking the refresh check box. Indeed, since we don't know who needs the signals, we dont't want to stop the service. The service will not restart in the next qgis session though. If this behavior is not deemed appropriate, we could use ``` int QObject::receivers ( const char * signal ) const ``` and have QgsDataProvider::setListening return a bool to tell the caller if the signal has actually been closed.
2017-09-08 16:42:30 +02:00
.. versionadded:: 3.0
%End
void setRefreshOnNofifyMessage( const QString &message );
%Docstring
2017-12-15 10:36:55 -04:00
Set the notification message that triggers repaine
If refresh on notification is enabled, the notification will triggerRepaint only
if the notification message is equal to:param message:
[FEATURE] layer refresh and trigger actions on provider notification [needs-docs] In vector layer properties (only usefull for postgres datasources) **in the rendering tab** A "Refresh layer on notification" checkbox has been added to refresh layer on provider notification. For a postgres datasource, if a `NOTIFY qgis;` command is issued by one of the database clients, a refresh of the layer will occur. If the "Only if message is" checkbox is checked, the notification will trigger the refresh only if the message contend is the one specified, e.g. if the user enters "refresh" in the box right next to the "Only if message is" checkbox, then a `NOTIFY qgis, 'refresh';` command in the datatabase will trigger a layer refresh, but `NOTIFY qgis;` or `NOTIFY qgis, 'something else';` won't. **in the actions tab** A column "On notification" has been added, the action editor widget a has text field "Execute if notification message matches" to specify a filter for notification from the provider. The filter is a Perl-type regex. Note that, as opposed to the "layer refresh" that Exemple: - QGIS side "Execute if notification message matches" `^trigger my action` - Postgres side: `NOTIFY qgis, 'trigger my action'` will trigger the action - Postgres side: `NOTIFY qgis, 'trigger my action some additional data'` will trigger the action - Postgres side: `NOTIFY qgis, 'do not trigger my action some additional data'` will NOT trigger the action Please note that if the `^`, which means "starts with", in `^trigger my action` had been ommited, the last notification would have triggered the action because the notification message contains the `trigger my action` A new qgis variable `notification_message` is available for use in actions, it holds the contend of the notification message. To continue with the previous exemple, if the action is of python type with the code: ```python print('[% @notification_message %]') ``` The three notifictions above will result in two printed lines ``` trigger my action trigger my action some additional data ``` User Warning: For postgres providers, if the "Refresh layer on notification" is checked, or if one layer action has "On notification" specified, a new connection to the database is made to listen to postgres notifications. This olds even if transaction groups are enabled at the project level. Note that once the notification mechanism is started in a QGIS session, it will not stop, even if there is no more need for it (Refresh layer on notification" unchecked and no "On notification" in any action). Consequently the connection listening to notification will remain open. IMPLEMENTATION DETAILS: A notify signal has been added to the abstract QgsVectorDataProvider along with a setListening function that enables/disble the notification mechanism. For the moment only the postgres provider implements the notification. QgsAction has a notificationMessage member function that holds the regex to match to trigger action QgsActionManager becomes a QObject and is doing the filtering and execute actions on notifications. The notification notion extends beyond SRGBD servers (postgres and oracle at least have the notify) and the "watch file" in the delimitedtext provider could also benefit from this interface. For the postgres provider a thread is created with a second connection to the database. This thread is responsible for listening postgres notifications. It would be nice to avoid the creation of one listening chanel per provider in the case transaction groups are enabled. Please note that when listening starts (a thread and connection is created in the postgres provider) it cannot be stopped by removing the connected actions or unchecking the refresh check box. Indeed, since we don't know who needs the signals, we dont't want to stop the service. The service will not restart in the next qgis session though. If this behavior is not deemed appropriate, we could use ``` int QObject::receivers ( const char * signal ) const ``` and have QgsDataProvider::setListening return a bool to tell the caller if the signal has actually been closed.
2017-09-08 16:42:30 +02:00
.. versionadded:: 3.0
%End
signals:
2017-04-10 17:07:50 +10:00
void statusChanged( const QString &status );
%Docstring
Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar)
%End
void nameChanged();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the name has been changed
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.16
%End
void crsChanged();
2017-04-10 17:07:50 +10:00
%Docstring
Emit a signal that layer's CRS has been reset
%End
void repaintRequested( bool deferredUpdate = false );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
By emitting this signal the layer tells that either appearance or content have been changed
and any view showing the rendered layer should refresh itself.
If ``deferredUpdate`` is true then the layer will only be repainted when the canvas is next
re-rendered, and will not trigger any canvas redraws itself.
2017-04-10 17:07:50 +10:00
%End
void recalculateExtents() const;
2017-04-10 17:07:50 +10:00
%Docstring
This is used to send a request that any mapcanvas using this layer update its extents
%End
void dataChanged();
2017-04-10 17:07:50 +10:00
%Docstring
Data of layer changed
%End
void blendModeChanged( QPainter::CompositionMode blendMode );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-19 11:43:52 -04:00
Signal emitted when the blend mode is changed, through :py:func:`QgsMapLayer.setBlendMode()`
2017-04-10 17:07:50 +10:00
%End
void rendererChanged();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Signal emitted when renderer is changed.
.. seealso:: :py:func:`styleChanged`
2017-04-10 17:07:50 +10:00
%End
void styleChanged();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Signal emitted whenever a change affects the layer's style. Ie this may be triggered
by renderer changes, label style changes, or other style changes such as blend
mode or layer opacity changes.
.. seealso:: :py:func:`rendererChanged`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.16
2017-04-10 17:07:50 +10:00
%End
void legendChanged();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Signal emitted when legend of the layer has changed
2017-04-10 17:07:50 +10:00
.. versionadded:: 2.6
%End
void renderer3DChanged();
%Docstring
2017-12-15 10:36:55 -04:00
Signal emitted when 3D renderer associated with the layer has changed.
.. versionadded:: 3.0
2017-04-10 17:07:50 +10:00
%End
2016-06-03 15:13:42 +02:00
void configChanged();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted whenever the configuration is changed. The project listens to this signal
to be marked as dirty.
2017-04-10 17:07:50 +10:00
%End
2016-06-03 15:13:42 +02:00
2016-09-01 09:58:37 +02:00
void dependenciesChanged();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when dependencies are changed.
2017-04-10 17:07:50 +10:00
%End
2016-09-01 09:58:37 +02:00
void willBeDeleted();
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted in the destructor when the layer is about to be deleted,
but it is still in a perfectly valid state: the last chance for
other pieces of code for some cleanup if they use the layer.
2017-04-10 17:07:50 +10:00
.. versionadded:: 3.0
%End
void autoRefreshIntervalChanged( int interval );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the auto refresh interval changes.
.. seealso:: :py:func:`setAutoRefreshInterval`
2017-12-15 10:36:55 -04:00
2017-04-10 17:07:50 +10:00
.. versionadded:: 3.0
2017-04-10 16:41:36 +10:00
%End
void metadataChanged();
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the layer's metadata is changed.
.. seealso:: :py:func:`setMetadata`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`metadata`
2017-12-15 10:36:55 -04:00
2017-04-10 16:41:36 +10:00
.. versionadded:: 3.0
2018-09-11 12:14:50 +02:00
%End
void flagsChanged();
%Docstring
Emitted when layer's flags have been modified.
.. seealso:: :py:func:`setFlags`
.. seealso:: :py:func:`flags`
.. versionadded:: 3.4
%End
void dataSourceChanged();
%Docstring
Emitted whenever the layer's data source has been changed.
.. seealso:: :py:func:`setDataSource`
.. versionadded:: 3.5
2017-04-10 17:07:50 +10:00
%End
protected:
2017-05-16 13:34:18 +02:00
2017-05-17 08:53:52 +02:00
void clone( QgsMapLayer *layer ) const;
2017-05-16 13:34:18 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Copies attributes like name, short name, ... into another layer.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param layer: The copy recipient
2017-05-16 13:34:18 +02:00
.. versionadded:: 3.0
%End
virtual void setExtent( const QgsRectangle &rect );
2017-04-10 17:07:50 +10:00
%Docstring
Sets the extent
2017-04-10 17:07:50 +10:00
%End
void setValid( bool valid );
2017-04-10 17:07:50 +10:00
%Docstring
Sets whether layer is valid or not - should be used in constructor.
2017-04-10 17:07:50 +10:00
%End
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Called by readLayerXML(), used by children to read state specific to them from
project files.
2017-04-10 17:07:50 +10:00
%End
virtual bool writeXml( QDomNode &layer_node, QDomDocument &document, const QgsReadWriteContext &context ) const;
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Called by writeLayerXML(), used by children to write state specific to them to
project files.
%End
virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const;
%Docstring
Called by writeLayerXML(), used by derived classes to encode provider's specific data
source to project files. Typically resolving absolute or relative paths, usernames and
passwords or drivers prefixes ("HDF5:")
:param source: data source to encode, typically :py:func:`QgsMapLayer.source()`
:param context: writing context (e.g. for conversion between relative and absolute paths)
:return: encoded source, typically to be written in the DOM element "datasource"
.. versionadded:: 3.2
%End
virtual QString decodedSource( const QString &source, const QString &dataProvider, const QgsReadWriteContext &context ) const;
%Docstring
Called by readLayerXML(), used by derived classes to decode provider's specific data
source from project files. Typically resolving absolute or relative paths, usernames and
passwords or drivers prefixes ("HDF5:")
:param source: data source to decode, typically read from layer's DOM element "datasource"
:param dataProvider: string identification of data provider (e.g. "ogr"), typically read from layer's DOM element
:param context: reading context (e.g. for conversion between relative and absolute paths)
:return: decoded source, typically to be used as the layer's datasource
.. versionadded:: 3.2
2017-04-10 17:07:50 +10:00
%End
void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = QString() );
2017-04-10 17:07:50 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Read custom properties from project file.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param layerNode: note to read from
:param keyStartsWith: reads only properties starting with the specified string (or all if the string is empty)*
2017-04-10 17:07:50 +10:00
%End
2017-04-10 17:07:50 +10:00
void writeCustomProperties( QDomNode &layerNode, QDomDocument &doc ) const;
%Docstring
Write custom properties to project file.
%End
2017-04-10 17:07:50 +10:00
void readStyleManager( const QDomNode &layerNode );
%Docstring
Read style manager's configuration (if any). To be called by subclasses.
%End
void writeStyleManager( QDomNode &layerNode, QDomDocument &doc ) const;
%Docstring
Write style manager's configuration (if exists). To be called by subclasses.
%End
void writeCommonStyle( QDomElement &layerElement, QDomDocument &document,
const QgsReadWriteContext &context,
StyleCategories categories = AllStyleCategories ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Write style data common to all layer types
.. versionadded:: 3.0
%End
void readCommonStyle( const QDomElement &layerElement, const QgsReadWriteContext &context,
StyleCategories categories = AllStyleCategories );
%Docstring
2017-12-15 10:36:55 -04:00
Read style data common to all layer types
.. versionadded:: 3.0
%End
void setProviderType( const QString &providerType );
%Docstring
Sets the ``providerType`` (provider key)
%End
void appendError( const QgsErrorMessage &error );
2017-04-10 17:07:50 +10:00
%Docstring
Add error message
%End
void setError( const QgsError &error );
2017-04-10 17:07:50 +10:00
%Docstring
Sets error message
2017-04-10 17:07:50 +10:00
%End
bool hasDependencyCycle( const QSet<QgsMapLayerDependency> &layers ) const;
%Docstring
Checks whether a new set of dependencies will introduce a cycle
%End
[FEATURE] layer refresh and trigger actions on provider notification [needs-docs] In vector layer properties (only usefull for postgres datasources) **in the rendering tab** A "Refresh layer on notification" checkbox has been added to refresh layer on provider notification. For a postgres datasource, if a `NOTIFY qgis;` command is issued by one of the database clients, a refresh of the layer will occur. If the "Only if message is" checkbox is checked, the notification will trigger the refresh only if the message contend is the one specified, e.g. if the user enters "refresh" in the box right next to the "Only if message is" checkbox, then a `NOTIFY qgis, 'refresh';` command in the datatabase will trigger a layer refresh, but `NOTIFY qgis;` or `NOTIFY qgis, 'something else';` won't. **in the actions tab** A column "On notification" has been added, the action editor widget a has text field "Execute if notification message matches" to specify a filter for notification from the provider. The filter is a Perl-type regex. Note that, as opposed to the "layer refresh" that Exemple: - QGIS side "Execute if notification message matches" `^trigger my action` - Postgres side: `NOTIFY qgis, 'trigger my action'` will trigger the action - Postgres side: `NOTIFY qgis, 'trigger my action some additional data'` will trigger the action - Postgres side: `NOTIFY qgis, 'do not trigger my action some additional data'` will NOT trigger the action Please note that if the `^`, which means "starts with", in `^trigger my action` had been ommited, the last notification would have triggered the action because the notification message contains the `trigger my action` A new qgis variable `notification_message` is available for use in actions, it holds the contend of the notification message. To continue with the previous exemple, if the action is of python type with the code: ```python print('[% @notification_message %]') ``` The three notifictions above will result in two printed lines ``` trigger my action trigger my action some additional data ``` User Warning: For postgres providers, if the "Refresh layer on notification" is checked, or if one layer action has "On notification" specified, a new connection to the database is made to listen to postgres notifications. This olds even if transaction groups are enabled at the project level. Note that once the notification mechanism is started in a QGIS session, it will not stop, even if there is no more need for it (Refresh layer on notification" unchecked and no "On notification" in any action). Consequently the connection listening to notification will remain open. IMPLEMENTATION DETAILS: A notify signal has been added to the abstract QgsVectorDataProvider along with a setListening function that enables/disble the notification mechanism. For the moment only the postgres provider implements the notification. QgsAction has a notificationMessage member function that holds the regex to match to trigger action QgsActionManager becomes a QObject and is doing the filtering and execute actions on notifications. The notification notion extends beyond SRGBD servers (postgres and oracle at least have the notify) and the "watch file" in the delimitedtext provider could also benefit from this interface. For the postgres provider a thread is created with a second connection to the database. This thread is responsible for listening postgres notifications. It would be nice to avoid the creation of one listening chanel per provider in the case transaction groups are enabled. Please note that when listening starts (a thread and connection is created in the postgres provider) it cannot be stopped by removing the connected actions or unchecking the refresh check box. Indeed, since we don't know who needs the signals, we dont't want to stop the service. The service will not restart in the next qgis session though. If this behavior is not deemed appropriate, we could use ``` int QObject::receivers ( const char * signal ) const ``` and have QgsDataProvider::setListening return a bool to tell the caller if the signal has actually been closed.
2017-09-08 16:42:30 +02:00
};
2017-04-10 17:07:50 +10:00
QFlags<QgsMapLayer::LayerFlag> operator|(QgsMapLayer::LayerFlag f1, QFlags<QgsMapLayer::LayerFlag> f2);
QFlags<QgsMapLayer::StyleCategory> operator|(QgsMapLayer::StyleCategory f1, QFlags<QgsMapLayer::StyleCategory> f2);
2017-04-10 17:07:50 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/