QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsmaplayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayer.h - description
3  -------------------
4  begin : Fri Jun 28 2002
5  copyright : (C) 2002 by Gary E.Sherman
6  email : sherman at mrcc.com
7 ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSMAPLAYER_H
19 #define QGSMAPLAYER_H
20 
21 #include "qgis_core.h"
22 #include <QDateTime>
23 #include <QDomNode>
24 #include <QImage>
25 #include <QObject>
26 #include <QPainter>
27 #include <QUndoStack>
28 #include <QVariant>
29 #include <QIcon>
30 
31 #include "qgis_sip.h"
32 #include "qgserror.h"
34 #include "qgsrectangle.h"
36 #include "qgsrendercontext.h"
37 #include "qgsmaplayerdependency.h"
38 #include "qgslayermetadata.h"
39 #include "qgsmaplayerstyle.h"
40 #include "qgsreadwritecontext.h"
41 #include "qgsdataprovider.h"
42 
44 class QgsDataProvider;
45 class QgsMapLayerLegend;
48 class QgsProject;
51 
52 class QDomDocument;
53 class QKeyEvent;
54 class QPainter;
55 
56 /*
57  * Constants used to describe copy-paste MIME types
58  */
59 #define QGSCLIPBOARD_MAPLAYER_MIME "application/qgis.maplayer"
60 
61 
68  {
72  MeshLayer,
75 };
76 
82 class CORE_EXPORT QgsMapLayer : public QObject
83 {
84  Q_OBJECT
85 
86  Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
87  Q_PROPERTY( int autoRefreshInterval READ autoRefreshInterval WRITE setAutoRefreshInterval NOTIFY autoRefreshIntervalChanged )
88  Q_PROPERTY( QgsLayerMetadata metadata READ metadata WRITE setMetadata NOTIFY metadataChanged )
89  Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs NOTIFY crsChanged )
90  Q_PROPERTY( QgsMapLayerType type READ type CONSTANT )
91  Q_PROPERTY( bool isValid READ isValid NOTIFY isValidChanged )
92 
93 #ifdef SIP_RUN
95  QgsMapLayer * layer = qobject_cast<QgsMapLayer *>( sipCpp );
96 
97  sipType = 0;
98 
99  if ( layer )
100  {
101  switch ( layer->type() )
102  {
104  sipType = sipType_QgsVectorLayer;
105  break;
107  sipType = sipType_QgsRasterLayer;
108  break;
110  sipType = sipType_QgsPluginLayer;
111  break;
113  sipType = sipType_QgsMeshLayer;
114  break;
116  sipType = sipType_QgsVectorTileLayer;
117  break;
119  sipType = sipType_QgsAnnotationLayer;
120  break;
121  default:
122  sipType = nullptr;
123  break;
124  }
125  }
126  SIP_END
127 #endif
128 
129  public:
130 
136  {
137  Style = 0,
139  };
140 
147  {
148  Identifiable = 1 << 0,
149  Removable = 1 << 1,
150  Searchable = 1 << 2,
151  };
152  Q_ENUM( LayerFlag )
153  Q_DECLARE_FLAGS( LayerFlags, LayerFlag )
154  Q_FLAG( LayerFlags )
155 
156 
161  {
162  LayerConfiguration = 1 << 0,
163  Symbology = 1 << 1,
164  Symbology3D = 1 << 2,
165  Labeling = 1 << 3,
166  Fields = 1 << 4,
167  Forms = 1 << 5,
168  Actions = 1 << 6,
169  MapTips = 1 << 7,
170  Diagrams = 1 << 8,
171  AttributeTable = 1 << 9,
172  Rendering = 1 << 10,
173  CustomProperties = 1 << 11,
174  GeometryOptions = 1 << 12,
175  Relations = 1 << 13,
176  Temporal = 1 << 14,
177  Legend = 1 << 15,
178  AllStyleCategories = LayerConfiguration | Symbology | Symbology3D | Labeling | Fields | Forms | Actions |
179  MapTips | Diagrams | AttributeTable | Rendering | CustomProperties | GeometryOptions | Relations | Temporal | Legend,
180  };
181  Q_ENUM( StyleCategory )
182  Q_DECLARE_FLAGS( StyleCategories, StyleCategory )
183  Q_FLAG( StyleCategories )
184 
185 
191  QgsMapLayer( QgsMapLayerType type = QgsMapLayerType::VectorLayer, const QString &name = QString(), const QString &source = QString() );
192 
193  ~QgsMapLayer() override;
194 
196  QgsMapLayer( QgsMapLayer const & ) = delete;
198  QgsMapLayer &operator=( QgsMapLayer const & ) = delete;
199 
206  virtual QgsMapLayer *clone() const = 0;
207 
211  QgsMapLayerType type() const;
212 
220  QgsMapLayer::LayerFlags flags() const;
221 
229  void setFlags( QgsMapLayer::LayerFlags flags );
230 
236  static QString extensionPropertyType( PropertyType type );
237 
239  QString id() const;
240 
246  void setName( const QString &name );
247 
252  QString name() const;
253 
257  virtual QgsDataProvider *dataProvider();
258 
263  virtual const QgsDataProvider *dataProvider() const SIP_SKIP;
264 
271  void setShortName( const QString &shortName ) { mShortName = shortName; }
272 
278  QString shortName() const;
279 
285  void setTitle( const QString &title ) { mTitle = title; }
286 
293  QString title() const { return mTitle; }
294 
301  void setAbstract( const QString &abstract ) { mAbstract = abstract; }
302 
309  QString abstract() const { return mAbstract; }
310 
317  void setKeywordList( const QString &keywords ) { mKeywordList = keywords; }
318 
325  QString keywordList() const { return mKeywordList; }
326 
327  /* Layer dataUrl information */
328 
336  void setDataUrl( const QString &dataUrl ) { mDataUrl = dataUrl; }
337 
345  QString dataUrl() const { return mDataUrl; }
346 
354  void setDataUrlFormat( const QString &dataUrlFormat ) { mDataUrlFormat = dataUrlFormat; }
355 
363  QString dataUrlFormat() const { return mDataUrlFormat; }
364 
365  /* Layer attribution information */
366 
374  void setAttribution( const QString &attrib ) { mAttribution = attrib; }
375 
383  QString attribution() const { return mAttribution; }
384 
392  void setAttributionUrl( const QString &attribUrl ) { mAttributionUrl = attribUrl; }
393 
401  QString attributionUrl() const { return mAttributionUrl; }
402 
403  /* Layer metadataUrl information */
404 
412  void setMetadataUrl( const QString &metaUrl ) { mMetadataUrl = metaUrl; }
413 
421  QString metadataUrl() const { return mMetadataUrl; }
422 
430  void setMetadataUrlType( const QString &metaUrlType ) { mMetadataUrlType = metaUrlType; }
431 
439  QString metadataUrlType() const { return mMetadataUrlType; }
440 
448  void setMetadataUrlFormat( const QString &metaUrlFormat ) { mMetadataUrlFormat = metaUrlFormat; }
449 
457  QString metadataUrlFormat() const { return mMetadataUrlFormat; }
458 
464  void setBlendMode( QPainter::CompositionMode blendMode );
465 
470  QPainter::CompositionMode blendMode() const;
471 
473  bool readOnly() const { return isReadOnly(); }
474 
478  virtual void reload() {}
479 
485 
487  virtual QgsRectangle extent() const;
488 
494  bool isValid() const;
495 
502  QString publicSource() const;
503 
509  QString source() const;
510 
515  virtual QStringList subLayers() const;
516 
521  virtual void setLayerOrder( const QStringList &layers );
522 
528  virtual void setSubLayerVisibility( const QString &name, bool visible );
529 
531  virtual bool isEditable() const;
532 
537  virtual bool isSpatial() const;
538 
548  virtual bool isTemporary() const;
549 
554  enum ReadFlag
555  {
556  FlagDontResolveLayers = 1 << 0,
557  FlagTrustLayerMetadata = 1 << 1,
558  };
559  Q_DECLARE_FLAGS( ReadFlags, ReadFlag )
560 
561 
578  bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context, QgsMapLayer::ReadFlags flags = QgsMapLayer::ReadFlags() );
579 
597  bool writeLayerXml( QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
598 
603  virtual void resolveReferences( QgsProject *project );
604 
610  Q_INVOKABLE QStringList customPropertyKeys() const;
611 
617  Q_INVOKABLE void setCustomProperty( const QString &key, const QVariant &value );
618 
623  Q_INVOKABLE QVariant customProperty( const QString &value, const QVariant &defaultValue = QVariant() ) const;
624 
629  void setCustomProperties( const QgsObjectCustomProperties &properties );
630 
636  const QgsObjectCustomProperties &customProperties() const;
637 
642  void removeCustomProperty( const QString &key );
643 
649  virtual QgsError error() const;
650 
656 
658  void setCrs( const QgsCoordinateReferenceSystem &srs, bool emitSignal = true );
659 
665  QgsCoordinateTransformContext transformContext( ) const;
666 
667 
673  static QString formatLayerName( const QString &name );
674 
682  virtual QString metadataUri() const;
683 
690  void exportNamedMetadata( QDomDocument &doc, QString &errorMsg ) const;
691 
701  virtual QString saveDefaultMetadata( bool &resultFlag SIP_OUT );
702 
717  QString saveNamedMetadata( const QString &uri, bool &resultFlag );
718 
733  virtual QString loadNamedMetadata( const QString &uri, bool &resultFlag SIP_OUT );
734 
744  virtual QString loadDefaultMetadata( bool &resultFlag );
745 
754  bool loadNamedMetadataFromDatabase( const QString &db, const QString &uri, QString &qmd );
755 
763  bool importNamedMetadata( QDomDocument &document, QString &errorMessage );
764 
772  virtual QString styleURI() const;
773 
783  virtual QString loadDefaultStyle( bool &resultFlag SIP_OUT );
784 
800  virtual QString loadNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
801 
809  virtual bool loadNamedStyleFromDatabase( const QString &db, const QString &uri, QString &qml SIP_OUT );
810 
820  virtual bool importNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT,
821  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
822 
831  virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT, const QgsReadWriteContext &context = QgsReadWriteContext(),
832  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const;
833 
834 
841  virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
842 
852  virtual QString saveDefaultStyle( bool &resultFlag SIP_OUT );
853 
869  virtual QString saveNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, StyleCategories categories = AllStyleCategories );
870 
879  virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
880 
889  virtual QString loadSldStyle( const QString &uri, bool &resultFlag );
890 
891  virtual bool readSld( const QDomNode &node, QString &errorMessage )
892  { Q_UNUSED( node ) errorMessage = QStringLiteral( "Layer type %1 not supported" ).arg( static_cast<int>( type() ) ); return false; }
893 
894 
895 
904  virtual bool readSymbology( const QDomNode &node, QString &errorMessage,
905  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) = 0;
906 
917  virtual bool readStyle( const QDomNode &node, QString &errorMessage,
918  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories );
919 
930  virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
931  StyleCategories categories = AllStyleCategories ) const = 0;
932 
945  virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
946  StyleCategories categories = AllStyleCategories ) const;
947 
948 
964  virtual void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false );
965 
969  QString providerType() const;
970 
972  QUndoStack *undoStack();
973 
978  QUndoStack *undoStackStyles();
979 
983  void setLegendUrl( const QString &legendUrl ) { mLegendUrl = legendUrl; }
984 
988  QString legendUrl() const { return mLegendUrl; }
989 
993  void setLegendUrlFormat( const QString &legendUrlFormat ) { mLegendUrlFormat = legendUrlFormat; }
994 
998  QString legendUrlFormat() const { return mLegendUrlFormat; }
999 
1005  void setLegend( QgsMapLayerLegend *legend SIP_TRANSFER );
1006 
1011  QgsMapLayerLegend *legend() const;
1012 
1017  QgsMapLayerStyleManager *styleManager() const;
1018 
1023  void setRenderer3D( QgsAbstract3DRenderer *renderer SIP_TRANSFER );
1024 
1029  QgsAbstract3DRenderer *renderer3D() const;
1030 
1040  bool isInScaleRange( double scale ) const;
1041 
1052  double minimumScale() const;
1053 
1064  double maximumScale() const;
1065 
1074  bool hasScaleBasedVisibility() const;
1075 
1082  bool hasAutoRefreshEnabled() const;
1083 
1091  int autoRefreshInterval() const;
1092 
1104  void setAutoRefreshInterval( int interval );
1105 
1112  void setAutoRefreshEnabled( bool enabled );
1113 
1120  virtual const QgsLayerMetadata &metadata() const;
1121 
1128  virtual void setMetadata( const QgsLayerMetadata &metadata );
1129 
1134  virtual QString htmlMetadata() const;
1135 
1137  virtual QDateTime timestamp() const;
1138 
1146  virtual QSet<QgsMapLayerDependency> dependencies() const;
1147 
1153  QString refreshOnNotifyMessage() const { return mRefreshOnNofifyMessage; }
1154 
1160  bool isRefreshOnNotifyEnabled() const { return mIsRefreshOnNofifyEnabled; }
1161 
1170  QString originalXmlProperties() const;
1171 
1179  void setOriginalXmlProperties( const QString &originalXmlProperties );
1180 
1185  static QString generateId( const QString &layerName );
1186 
1196  virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
1197 
1203  virtual QgsMapLayerTemporalProperties *temporalProperties() { return nullptr; }
1204 
1205  public slots:
1206 
1216  void setMinimumScale( double scale );
1217 
1227  void setMaximumScale( double scale );
1228 
1236  void setScaleBasedVisibility( bool enabled );
1237 
1246  void triggerRepaint( bool deferredUpdate = false );
1247 
1252  void emitStyleChanged();
1253 
1262  virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers );
1263 
1269  void setRefreshOnNotifyEnabled( bool enabled );
1270 
1278  void setRefreshOnNofifyMessage( const QString &message ) { mRefreshOnNofifyMessage = message; }
1279 
1285  virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ) = 0;
1286 
1287 #ifdef SIP_RUN
1288  SIP_PYOBJECT __repr__();
1289  % MethodCode
1290  QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
1291  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
1292  % End
1293 #endif
1294 
1295  signals:
1296 
1304 
1306  void statusChanged( const QString &status );
1307 
1313  void nameChanged();
1314 
1316  void crsChanged();
1317 
1324  void repaintRequested( bool deferredUpdate = false );
1325 
1327  void recalculateExtents() const;
1328 
1330  void dataChanged();
1331 
1333  void blendModeChanged( QPainter::CompositionMode blendMode );
1334 
1340 
1349 
1355 
1361 
1367 
1372 
1380 
1386  void autoRefreshIntervalChanged( int interval );
1387 
1395 
1403 
1412 
1418  void styleLoaded( QgsMapLayer::StyleCategories categories );
1419 
1426 
1427 
1428  private slots:
1429 
1430  void onNotifiedTriggerRepaint( const QString &message );
1431 
1432  protected:
1433 
1439  void clone( QgsMapLayer *layer ) const;
1440 
1442  virtual void setExtent( const QgsRectangle &rect );
1443 
1445  void setValid( bool valid );
1446 
1451  virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
1452 
1457  virtual bool writeXml( QDomNode &layer_node, QDomDocument &document, const QgsReadWriteContext &context ) const;
1458 
1470  virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const;
1471 
1484  virtual QString decodedSource( const QString &source, const QString &dataProvider, const QgsReadWriteContext &context ) const;
1485 
1491  void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = QString() );
1492 
1494  void writeCustomProperties( QDomNode &layerNode, QDomDocument &doc ) const;
1495 
1497  void readStyleManager( const QDomNode &layerNode );
1499  void writeStyleManager( QDomNode &layerNode, QDomDocument &doc ) const;
1500 
1505  void writeCommonStyle( QDomElement &layerElement, QDomDocument &document,
1506  const QgsReadWriteContext &context,
1507  StyleCategories categories = AllStyleCategories ) const;
1508 
1513  void readCommonStyle( const QDomElement &layerElement, const QgsReadWriteContext &context,
1514  StyleCategories categories = AllStyleCategories );
1515 
1517  void setProviderType( const QString &providerType );
1518 
1519 #ifndef SIP_RUN
1520 #if 0
1521  void connectNotify( const char *signal ) override;
1523 #endif
1524 #endif
1525 
1527  void appendError( const QgsErrorMessage &error ) { mError.append( error );}
1529  void setError( const QgsError &error ) { mError = error;}
1530 
1533 
1535  bool mValid = false;
1536 
1538  QString mDataSource;
1539 
1541  QString mLayerName;
1542 
1543  QString mShortName;
1544  QString mTitle;
1545 
1547  QString mAbstract;
1548  QString mKeywordList;
1549 
1551  QString mDataUrl;
1553 
1555  QString mAttribution;
1557 
1559  QString mMetadataUrl;
1562 
1564  QString mLegendUrl;
1566 
1569 
1571  QSet<QgsMapLayerDependency> mDependencies;
1572 
1578  Q_DECL_DEPRECATED bool hasDependencyCycle( const QSet<QgsMapLayerDependency> & ) const {return false;}
1579 
1580  bool mIsRefreshOnNofifyEnabled = false;
1582 
1584  QString mProviderKey;
1585 
1586  //TODO QGIS 4 - move to readXml as a new argument (breaks API)
1587 
1589  QgsMapLayer::ReadFlags mReadFlags = QgsMapLayer::ReadFlags();
1590 
1596  bool mShouldValidateCrs = true;
1597 
1598  private:
1599 
1600  virtual QString baseURI( PropertyType type ) const;
1601  QString saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1602  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1603  QString loadNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1604  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1605  bool loadNamedPropertyFromDatabase( const QString &db, const QString &uri, QString &xml, QgsMapLayer::PropertyType type );
1606 
1611  virtual bool isReadOnly() const;
1612 
1618 
1620  QString mID;
1621 
1623  QgsMapLayerType mLayerType;
1624 
1625  LayerFlags mFlags = LayerFlags( Identifiable | Removable | Searchable );
1626 
1628  QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
1629 
1631  QString mTag;
1632 
1633  //set some generous defaults for scale based visibility
1634 
1636  double mMinScale = 0;
1638  double mMaxScale = 100000000;
1640  bool mScaleBasedVisibility = false;
1641 
1643  QUndoStack *mUndoStack = nullptr;
1644 
1645  QUndoStack *mUndoStackStyles = nullptr;
1646 
1648  QgsObjectCustomProperties mCustomProperties;
1649 
1651  QgsMapLayerLegend *mLegend = nullptr;
1652 
1654  QgsMapLayerStyleManager *mStyleManager = nullptr;
1655 
1657  QTimer *mRefreshTimer = nullptr;
1658 
1659  QgsLayerMetadata mMetadata;
1660 
1662  QgsAbstract3DRenderer *m3DRenderer = nullptr;
1663 
1669  QString mOriginalXmlProperties;
1670 
1672  bool mRepaintRequestedFired = false;
1673 };
1674 
1676 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::LayerFlags )
1677 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::StyleCategories )
1678 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::ReadFlags )
1679 
1680 
1681 #ifndef SIP_RUN
1682 
1688 typedef QPointer< QgsMapLayer > QgsWeakMapLayerPointer;
1689 
1695 typedef QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList;
1696 #endif
1697 
1698 #endif
QgsMapLayer::setError
void setError(const QgsError &error)
Sets error message.
Definition: qgsmaplayer.h:1529
QgsMapLayer::setAbstract
void setAbstract(const QString &abstract)
Sets the abstract of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:301
QgsMapLayer::willBeDeleted
void willBeDeleted()
Emitted in the destructor when the layer is about to be deleted, but it is still in a perfectly valid...
qgsmaplayerstyle.h
QgsMapLayer::flagsChanged
void flagsChanged()
Emitted when layer's flags have been modified.
QgsMapLayer::dependenciesChanged
void dependenciesChanged()
Emitted when dependencies are changed.
QgsMapLayer::attributionUrl
QString attributionUrl() const
Returns the attribution URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:401
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition: qgscoordinatetransformcontext.h:58
QgsMapLayer::refreshOnNotifyMessage
QString refreshOnNotifyMessage() const
Returns the message that should be notified by the provider to triggerRepaint.
Definition: qgsmaplayer.h:1153
QgsMapLayer::setMetadataUrl
void setMetadataUrl(const QString &metaUrl)
Sets the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:412
QgsMapLayer::configChanged
void configChanged()
Emitted whenever the configuration is changed.
QgsWeakMapLayerPointerList
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
Definition: qgsmaplayer.h:1695
QgsMapLayer::dataUrlFormat
QString dataUrlFormat() const
Returns the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:363
QgsDataProvider::ProviderOptions
Setting options for creating vector data providers.
Definition: qgsdataprovider.h:105
QgsMapLayerType::MeshLayer
@ MeshLayer
Added in 3.2.
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:35
QgsDataProvider
Abstract base class for spatial data provider implementations.
Definition: qgsdataprovider.h:42
qgsrectangle.h
QgsMapLayerType::VectorLayer
@ VectorLayer
QgsMapLayer::clone
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
QgsMapLayer::mLegendUrlFormat
QString mLegendUrlFormat
Definition: qgsmaplayer.h:1565
qgsmaplayerdependency.h
QgsAbstract3DRenderer
Base class for all renderers that may to participate in 3D view.
Definition: qgsabstract3drenderer.h:49
QgsMapLayer::mAttributionUrl
QString mAttributionUrl
Definition: qgsmaplayer.h:1556
qgsreadwritecontext.h
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:51
QgsMapLayer::isRefreshOnNotifyEnabled
bool isRefreshOnNotifyEnabled() const
Returns true if the refresh on provider nofification is enabled.
Definition: qgsmaplayer.h:1160
QgsLayerMetadata
A structured metadata store for a map layer.
Definition: qgslayermetadata.h:57
QgsMapLayerType
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgsmaplayer.h:68
QgsMapLayer::mDataUrlFormat
QString mDataUrlFormat
Definition: qgsmaplayer.h:1552
QgsMapLayer::setMetadataUrlType
void setMetadataUrlType(const QString &metaUrlType)
Set the metadata type of the layer used by QGIS Server in GetCapabilities request MetadataUrlType ind...
Definition: qgsmaplayer.h:430
QgsError
QgsError is container for error messages (report).
Definition: qgserror.h:81
QgsMapLayerLegend
The QgsMapLayerLegend class is abstract interface for implementations of legends for one map layer.
Definition: qgsmaplayerlegend.h:46
QgsMapLayer::statusChanged
void statusChanged(const QString &status)
Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar)
QgsMapLayer::Metadata
@ Metadata
Definition: qgsmaplayer.h:138
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
QgsStyleEntityVisitorInterface
An interface for classes which can visit style entity (e.g.
Definition: qgsstyleentityvisitor.h:34
QgsMapLayer::PropertyType
PropertyType
Maplayer has a style and a metadata property.
Definition: qgsmaplayer.h:136
QgsMapLayer::reload
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:478
QgsMapLayer::ReadFlag
ReadFlag
Flags which control project read behavior.
Definition: qgsmaplayer.h:555
QgsMapLayer::crsChanged
void crsChanged()
Emit a signal that layer's CRS has been reset.
QgsMapLayer::mError
QgsError mError
Error.
Definition: qgsmaplayer.h:1568
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
QgsMapLayer::dataUrl
QString dataUrl() const
Returns the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:345
QgsMapLayer::mProviderKey
QString mProviderKey
Data provider key (name of the data provider)
Definition: qgsmaplayer.h:1584
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:95
QgsMapLayerRenderer
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Definition: qgsmaplayerrenderer.h:51
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsMapLayer::setLegendUrlFormat
void setLegendUrlFormat(const QString &legendUrlFormat)
Sets the format for a URL based layer legend.
Definition: qgsmaplayer.h:993
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
QgsMapLayer::mLayerName
QString mLayerName
Name of the layer - used for display.
Definition: qgsmaplayer.h:1541
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:257
QgsMapLayer::dataSourceChanged
void dataSourceChanged()
Emitted whenever the layer's data source has been changed.
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
qgslayermetadata.h
QgsMapLayerStyleManager
Management of styles for use with one map layer.
Definition: qgsmaplayerstylemanager.h:56
qgsobjectcustomproperties.h
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgserror.h
QgsMapLayer::mExtent
QgsRectangle mExtent
Extent of the layer.
Definition: qgsmaplayer.h:1532
QgsMapLayer::keywordList
QString keywordList() const
Returns the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:325
QgsMapLayer::operator=
QgsMapLayer & operator=(QgsMapLayer const &)=delete
QgsMapLayer cannot be copied.
QgsMapLayer::readSld
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:891
QgsMapLayer::legendUrlFormat
QString legendUrlFormat() const
Returns the format for a URL based layer legend.
Definition: qgsmaplayer.h:998
QgsMapLayer::mMetadataUrl
QString mMetadataUrl
MetadataUrl of the layer.
Definition: qgsmaplayer.h:1559
QgsMapLayer::metadataUrlFormat
QString metadataUrlFormat() const
Returns the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:457
QgsMapLayer::styleChanged
void styleChanged()
Signal emitted whenever a change affects the layer's style.
QgsMapLayer::repaintRequested
void repaintRequested(bool deferredUpdate=false)
By emitting this signal the layer tells that either appearance or content have been changed and any v...
QgsMapLayer::mAttribution
QString mAttribution
Attribution of the layer.
Definition: qgsmaplayer.h:1555
QgsMapLayerType::RasterLayer
@ RasterLayer
QgsMapLayer::mDependencies
QSet< QgsMapLayerDependency > mDependencies
List of layers that may modify this layer on modification.
Definition: qgsmaplayer.h:1571
QgsMapLayer::blendModeChanged
void blendModeChanged(QPainter::CompositionMode blendMode)
Signal emitted when the blend mode is changed, through QgsMapLayer::setBlendMode()
QgsMapLayer::isValidChanged
void isValidChanged()
Emitted when the validity of this layer changed.
qgis_sip.h
QgsMapLayer::nameChanged
void nameChanged()
Emitted when the name has been changed.
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsMapLayer::temporalProperties
virtual QgsMapLayerTemporalProperties * temporalProperties()
Returns the layer's temporal properties.
Definition: qgsmaplayer.h:1203
qgsrendercontext.h
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QgsMapLayer::mTitle
QString mTitle
Definition: qgsmaplayer.h:1544
QgsMapLayer::mDataUrl
QString mDataUrl
DataUrl of the layer.
Definition: qgsmaplayer.h:1551
QgsMapLayer::mMetadataUrlFormat
QString mMetadataUrlFormat
Definition: qgsmaplayer.h:1561
QgsMapLayer::setKeywordList
void setKeywordList(const QString &keywords)
Sets the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:317
QgsMapLayer::title
QString title() const
Returns the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:293
QgsMapLayer::setTitle
void setTitle(const QString &title)
Sets the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:285
QgsMapLayerTemporalProperties
Base class for storage of map layer temporal properties.
Definition: qgsmaplayertemporalproperties.h:43
QgsMapLayer::mDataSource
QString mDataSource
Data source description string, varies by layer type.
Definition: qgsmaplayer.h:1538
QgsWeakMapLayerPointer
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
Definition: qgsmaplayer.h:1688
QgsErrorMessage
QgsErrorMessage represents single error message.
Definition: qgserror.h:33
QgsMapLayer::setTransformContext
virtual void setTransformContext(const QgsCoordinateTransformContext &transformContext)=0
Sets the coordinate transform context to transformContext.
QgsMapLayer::rendererChanged
void rendererChanged()
Signal emitted when renderer is changed.
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:206
QgsMapLayer::beforeResolveReferences
void beforeResolveReferences(QgsProject *project)
Emitted when all layers are loaded and references can be resolved, just before the references of this...
QgsMapLayer::legendChanged
void legendChanged()
Signal emitted when legend of the layer has changed.
QgsMapLayer::setMetadataUrlFormat
void setMetadataUrlFormat(const QString &metaUrlFormat)
Sets the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:448
QgsMapLayer::readSymbology
virtual bool readSymbology(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories)=0
Read the symbology for the current layer from the DOM node supplied.
QgsMapLayer::setAttributionUrl
void setAttributionUrl(const QString &attribUrl)
Sets the attribution URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:392
QgsMapLayer::legendUrl
QString legendUrl() const
Returns the URL for the layer's legend.
Definition: qgsmaplayer.h:988
QgsMapLayer::dataChanged
void dataChanged()
Data of layer changed.
QgsMapLayer::appendError
void appendError(const QgsErrorMessage &error)
Add error message.
Definition: qgsmaplayer.h:1527
QgsMapLayer::LayerFlag
LayerFlag
Flags for the map layer.
Definition: qgsmaplayer.h:147
QgsMapLayer::mAbstract
QString mAbstract
Description of the layer.
Definition: qgsmaplayer.h:1547
QgsMapLayer::writeSymbology
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const =0
Write the style for the layer into the docment provided.
QgsMapLayer::setRefreshOnNofifyMessage
void setRefreshOnNofifyMessage(const QString &message)
Set the notification message that triggers repaint If refresh on notification is enabled,...
Definition: qgsmaplayer.h:1278
QgsMapLayer::setDataUrlFormat
void setDataUrlFormat(const QString &dataUrlFormat)
Sets the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:354
QgsObjectCustomProperties
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML i...
Definition: qgsobjectcustomproperties.h:36
QgsMapLayer
Base class for all map layer types.
Definition: qgsmaplayer.h:83
QgsMapLayer::setLegendUrl
void setLegendUrl(const QString &legendUrl)
Sets the URL for the layer's legend.
Definition: qgsmaplayer.h:983
QgsMapLayer::hasDependencyCycle
Q_DECL_DEPRECATED bool hasDependencyCycle(const QSet< QgsMapLayerDependency > &) const
Checks whether a new set of dependencies will introduce a cycle this method is now deprecated and alw...
Definition: qgsmaplayer.h:1578
QgsMapLayer::readOnly
bool readOnly() const
Returns if this layer is read only.
Definition: qgsmaplayer.h:473
QgsMapLayer::recalculateExtents
void recalculateExtents() const
This is used to send a request that any mapcanvas using this layer update its extents.
QgsMapLayerType::VectorTileLayer
@ VectorTileLayer
Added in 3.14.
QgsMapLayer::metadataUrl
QString metadataUrl() const
Returns the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:421
QgsMapLayer::StyleCategory
StyleCategory
Categories of style to distinguish appropriate sections for import/export.
Definition: qgsmaplayer.h:161
QgsMapLayer::QgsMapLayer
QgsMapLayer(QgsMapLayer const &)=delete
QgsMapLayer cannot be copied.
QgsMapLayer::styleLoaded
void styleLoaded(QgsMapLayer::StyleCategories categories)
Emitted when a style has been loaded.
qgsdataprovider.h
QgsMapLayer::setAttribution
void setAttribution(const QString &attrib)
Sets the attribution of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:374
QgsMapLayer::mRefreshOnNofifyMessage
QString mRefreshOnNofifyMessage
Definition: qgsmaplayer.h:1581
QgsMapLayer::mLegendUrl
QString mLegendUrl
WMS legend.
Definition: qgsmaplayer.h:1564
QgsMapLayer::setDataUrl
void setDataUrl(const QString &dataUrl)
Sets the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:336
QgsMapLayer::AllStyleCategories
@ AllStyleCategories
Definition: qgsmaplayer.h:178
QgsMapLayer::attribution
QString attribution() const
Returns the attribution of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:383
QgsMapLayer::metadataUrlType
QString metadataUrlType() const
Returns the metadata type of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:439
SIP_END
#define SIP_END
Definition: qgis_sip.h:194
qgscoordinatereferencesystem.h
QgsMapLayer::renderer3DChanged
void renderer3DChanged()
Signal emitted when 3D renderer associated with the layer has changed.
QgsMapLayer::mKeywordList
QString mKeywordList
Definition: qgsmaplayer.h:1548
QgsMapLayerType::PluginLayer
@ PluginLayer
QgsMapLayer::autoRefreshIntervalChanged
void autoRefreshIntervalChanged(int interval)
Emitted when the auto refresh interval changes.
QgsMapLayer::mShortName
QString mShortName
Definition: qgsmaplayer.h:1543
QgsMapLayer::createMapRenderer
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)=0
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context.
QgsMapLayer::metadataChanged
void metadataChanged()
Emitted when the layer's metadata is changed.
QgsMapLayer::mMetadataUrlType
QString mMetadataUrlType
Definition: qgsmaplayer.h:1560