QGIS API Documentation  3.13.0-Master (b0e71a822e)
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,
74 };
75 
81 class CORE_EXPORT QgsMapLayer : public QObject
82 {
83  Q_OBJECT
84 
85  Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
86  Q_PROPERTY( int autoRefreshInterval READ autoRefreshInterval WRITE setAutoRefreshInterval NOTIFY autoRefreshIntervalChanged )
87  Q_PROPERTY( QgsLayerMetadata metadata READ metadata WRITE setMetadata NOTIFY metadataChanged )
88  Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs NOTIFY crsChanged )
89 
90 #ifdef SIP_RUN
92  QgsMapLayer * layer = qobject_cast<QgsMapLayer *>( sipCpp );
93 
94  sipType = 0;
95 
96  if ( layer )
97  {
98  switch ( layer->type() )
99  {
101  sipType = sipType_QgsVectorLayer;
102  break;
104  sipType = sipType_QgsRasterLayer;
105  break;
107  sipType = sipType_QgsPluginLayer;
108  break;
110  sipType = sipType_QgsMeshLayer;
111  break;
113  sipType = sipType_QgsVectorTileLayer;
114  break;
115  default:
116  sipType = nullptr;
117  break;
118  }
119  }
120  SIP_END
121 #endif
122 
123  public:
124 
130  {
131  Style = 0,
133  };
134 
141  {
142  Identifiable = 1 << 0,
143  Removable = 1 << 1,
144  Searchable = 1 << 2,
145  };
146  Q_ENUM( LayerFlag )
147  Q_DECLARE_FLAGS( LayerFlags, LayerFlag )
148  Q_FLAG( LayerFlags )
149 
150 
155  {
156  LayerConfiguration = 1 << 0,
157  Symbology = 1 << 1,
158  Symbology3D = 1 << 2,
159  Labeling = 1 << 3,
160  Fields = 1 << 4,
161  Forms = 1 << 5,
162  Actions = 1 << 6,
163  MapTips = 1 << 7,
164  Diagrams = 1 << 8,
165  AttributeTable = 1 << 9,
166  Rendering = 1 << 10,
167  CustomProperties = 1 << 11,
168  GeometryOptions = 1 << 12,
169  Relations = 1 << 13,
170  Temporal = 1 << 14,
171  AllStyleCategories = LayerConfiguration | Symbology | Symbology3D | Labeling | Fields | Forms | Actions |
172  MapTips | Diagrams | AttributeTable | Rendering | CustomProperties | GeometryOptions | Relations | Temporal,
173  };
174  Q_ENUM( StyleCategory )
175  Q_DECLARE_FLAGS( StyleCategories, StyleCategory )
176  Q_FLAG( StyleCategories )
177 
178 
184  QgsMapLayer( QgsMapLayerType type = QgsMapLayerType::VectorLayer, const QString &name = QString(), const QString &source = QString() );
185 
186  ~QgsMapLayer() override;
187 
189  QgsMapLayer( QgsMapLayer const & ) = delete;
191  QgsMapLayer &operator=( QgsMapLayer const & ) = delete;
192 
199  virtual QgsMapLayer *clone() const = 0;
200 
204  QgsMapLayerType type() const;
205 
213  QgsMapLayer::LayerFlags flags() const;
214 
222  void setFlags( QgsMapLayer::LayerFlags flags );
223 
229  static QString extensionPropertyType( PropertyType type );
230 
232  QString id() const;
233 
239  void setName( const QString &name );
240 
245  QString name() const;
246 
250  virtual QgsDataProvider *dataProvider();
251 
256  virtual const QgsDataProvider *dataProvider() const SIP_SKIP;
257 
264  void setShortName( const QString &shortName ) { mShortName = shortName; }
265 
271  QString shortName() const;
272 
278  void setTitle( const QString &title ) { mTitle = title; }
279 
286  QString title() const { return mTitle; }
287 
294  void setAbstract( const QString &abstract ) { mAbstract = abstract; }
295 
302  QString abstract() const { return mAbstract; }
303 
310  void setKeywordList( const QString &keywords ) { mKeywordList = keywords; }
311 
318  QString keywordList() const { return mKeywordList; }
319 
320  /* Layer dataUrl information */
321 
329  void setDataUrl( const QString &dataUrl ) { mDataUrl = dataUrl; }
330 
338  QString dataUrl() const { return mDataUrl; }
339 
347  void setDataUrlFormat( const QString &dataUrlFormat ) { mDataUrlFormat = dataUrlFormat; }
348 
356  QString dataUrlFormat() const { return mDataUrlFormat; }
357 
358  /* Layer attribution information */
359 
367  void setAttribution( const QString &attrib ) { mAttribution = attrib; }
368 
376  QString attribution() const { return mAttribution; }
377 
385  void setAttributionUrl( const QString &attribUrl ) { mAttributionUrl = attribUrl; }
386 
394  QString attributionUrl() const { return mAttributionUrl; }
395 
396  /* Layer metadataUrl information */
397 
405  void setMetadataUrl( const QString &metaUrl ) { mMetadataUrl = metaUrl; }
406 
414  QString metadataUrl() const { return mMetadataUrl; }
415 
423  void setMetadataUrlType( const QString &metaUrlType ) { mMetadataUrlType = metaUrlType; }
424 
432  QString metadataUrlType() const { return mMetadataUrlType; }
433 
441  void setMetadataUrlFormat( const QString &metaUrlFormat ) { mMetadataUrlFormat = metaUrlFormat; }
442 
450  QString metadataUrlFormat() const { return mMetadataUrlFormat; }
451 
457  void setBlendMode( QPainter::CompositionMode blendMode );
458 
463  QPainter::CompositionMode blendMode() const;
464 
466  bool readOnly() const { return isReadOnly(); }
467 
471  virtual void reload() {}
472 
477  virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) = 0 SIP_FACTORY;
478 
480  virtual QgsRectangle extent() const;
481 
487  bool isValid() const;
488 
495  QString publicSource() const;
496 
502  QString source() const;
503 
508  virtual QStringList subLayers() const;
509 
514  virtual void setLayerOrder( const QStringList &layers );
515 
521  virtual void setSubLayerVisibility( const QString &name, bool visible );
522 
524  virtual bool isEditable() const;
525 
530  virtual bool isSpatial() const;
531 
540  virtual bool isTemporary() const;
541 
546  enum ReadFlag
547  {
548  FlagDontResolveLayers = 1 << 0,
549  };
550  Q_DECLARE_FLAGS( ReadFlags, ReadFlag )
551 
552 
569  bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context, QgsMapLayer::ReadFlags flags = nullptr );
570 
588  bool writeLayerXml( QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
589 
594  virtual void resolveReferences( QgsProject *project );
595 
601  Q_INVOKABLE QStringList customPropertyKeys() const;
602 
608  Q_INVOKABLE void setCustomProperty( const QString &key, const QVariant &value );
609 
614  Q_INVOKABLE QVariant customProperty( const QString &value, const QVariant &defaultValue = QVariant() ) const;
615 
620  void setCustomProperties( const QgsObjectCustomProperties &properties );
621 
627  const QgsObjectCustomProperties &customProperties() const;
628 
633  void removeCustomProperty( const QString &key );
634 
640  virtual QgsError error() const;
641 
647 
649  void setCrs( const QgsCoordinateReferenceSystem &srs, bool emitSignal = true );
650 
656  QgsCoordinateTransformContext transformContext( ) const;
657 
658 
664  static QString formatLayerName( const QString &name );
665 
673  virtual QString metadataUri() const;
674 
681  void exportNamedMetadata( QDomDocument &doc, QString &errorMsg ) const;
682 
692  virtual QString saveDefaultMetadata( bool &resultFlag SIP_OUT );
693 
708  QString saveNamedMetadata( const QString &uri, bool &resultFlag );
709 
724  virtual QString loadNamedMetadata( const QString &uri, bool &resultFlag SIP_OUT );
725 
735  QString loadDefaultMetadata( bool &resultFlag );
736 
745  bool loadNamedMetadataFromDatabase( const QString &db, const QString &uri, QString &qmd );
746 
754  bool importNamedMetadata( QDomDocument &document, QString &errorMessage );
755 
763  virtual QString styleURI() const;
764 
774  virtual QString loadDefaultStyle( bool &resultFlag SIP_OUT );
775 
791  virtual QString loadNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
792 
800  virtual bool loadNamedStyleFromDatabase( const QString &db, const QString &uri, QString &qml SIP_OUT );
801 
811  virtual bool importNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT,
812  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
813 
822  virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT, const QgsReadWriteContext &context = QgsReadWriteContext(),
823  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const;
824 
825 
832  virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
833 
843  virtual QString saveDefaultStyle( bool &resultFlag SIP_OUT );
844 
860  virtual QString saveNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, StyleCategories categories = AllStyleCategories );
861 
870  virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
871 
880  virtual QString loadSldStyle( const QString &uri, bool &resultFlag );
881 
882  virtual bool readSld( const QDomNode &node, QString &errorMessage )
883  { Q_UNUSED( node ) errorMessage = QStringLiteral( "Layer type %1 not supported" ).arg( static_cast<int>( type() ) ); return false; }
884 
885 
886 
895  virtual bool readSymbology( const QDomNode &node, QString &errorMessage,
896  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) = 0;
897 
908  virtual bool readStyle( const QDomNode &node, QString &errorMessage,
909  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories );
910 
921  virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
922  StyleCategories categories = AllStyleCategories ) const = 0;
923 
936  virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
937  StyleCategories categories = AllStyleCategories ) const;
938 
939 
955  virtual void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false );
956 
960  QString providerType() const;
961 
963  QUndoStack *undoStack();
964 
969  QUndoStack *undoStackStyles();
970 
974  void setLegendUrl( const QString &legendUrl ) { mLegendUrl = legendUrl; }
975 
979  QString legendUrl() const { return mLegendUrl; }
980 
984  void setLegendUrlFormat( const QString &legendUrlFormat ) { mLegendUrlFormat = legendUrlFormat; }
985 
989  QString legendUrlFormat() const { return mLegendUrlFormat; }
990 
996  void setLegend( QgsMapLayerLegend *legend SIP_TRANSFER );
997 
1002  QgsMapLayerLegend *legend() const;
1003 
1008  QgsMapLayerStyleManager *styleManager() const;
1009 
1014  void setRenderer3D( QgsAbstract3DRenderer *renderer SIP_TRANSFER );
1015 
1020  QgsAbstract3DRenderer *renderer3D() const;
1021 
1031  bool isInScaleRange( double scale ) const;
1032 
1043  double minimumScale() const;
1044 
1055  double maximumScale() const;
1056 
1065  bool hasScaleBasedVisibility() const;
1066 
1073  bool hasAutoRefreshEnabled() const;
1074 
1082  int autoRefreshInterval() const;
1083 
1095  void setAutoRefreshInterval( int interval );
1096 
1103  void setAutoRefreshEnabled( bool enabled );
1104 
1111  virtual const QgsLayerMetadata &metadata() const;
1112 
1119  virtual void setMetadata( const QgsLayerMetadata &metadata );
1120 
1125  virtual QString htmlMetadata() const;
1126 
1128  virtual QDateTime timestamp() const;
1129 
1137  virtual QSet<QgsMapLayerDependency> dependencies() const;
1138 
1144  QString refreshOnNotifyMessage() const { return mRefreshOnNofifyMessage; }
1145 
1151  bool isRefreshOnNotifyEnabled() const { return mIsRefreshOnNofifyEnabled; }
1152 
1161  QString originalXmlProperties() const;
1162 
1170  void setOriginalXmlProperties( const QString &originalXmlProperties );
1171 
1176  static QString generateId( const QString &layerName );
1177 
1187  virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
1188 
1194  virtual QgsMapLayerTemporalProperties *temporalProperties() { return nullptr; }
1195 
1196  public slots:
1197 
1207  void setMinimumScale( double scale );
1208 
1218  void setMaximumScale( double scale );
1219 
1227  void setScaleBasedVisibility( bool enabled );
1228 
1237  void triggerRepaint( bool deferredUpdate = false );
1238 
1243  void emitStyleChanged();
1244 
1253  virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers );
1254 
1260  void setRefreshOnNotifyEnabled( bool enabled );
1261 
1269  void setRefreshOnNofifyMessage( const QString &message ) { mRefreshOnNofifyMessage = message; }
1270 
1276  virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ) = 0;
1277 
1278 #ifdef SIP_RUN
1279  SIP_PYOBJECT __repr__();
1280  % MethodCode
1281  QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
1282  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
1283  % End
1284 #endif
1285 
1286  signals:
1287 
1294  void beforeResolveReferences( QgsProject *project );
1295 
1297  void statusChanged( const QString &status );
1298 
1304  void nameChanged();
1305 
1307  void crsChanged();
1308 
1315  void repaintRequested( bool deferredUpdate = false );
1316 
1318  void recalculateExtents() const;
1319 
1321  void dataChanged();
1322 
1324  void blendModeChanged( QPainter::CompositionMode blendMode );
1325 
1330  void rendererChanged();
1331 
1339  void styleChanged();
1340 
1345  void legendChanged();
1346 
1351  void renderer3DChanged();
1352 
1357  void configChanged();
1358 
1362  void dependenciesChanged();
1363 
1370  void willBeDeleted();
1371 
1377  void autoRefreshIntervalChanged( int interval );
1378 
1385  void metadataChanged();
1386 
1393  void flagsChanged();
1394 
1402  void dataSourceChanged();
1403 
1409  void styleLoaded( QgsMapLayer::StyleCategories categories );
1410 
1411 
1412  private slots:
1413 
1414  void onNotifiedTriggerRepaint( const QString &message );
1415 
1416  protected:
1417 
1423  void clone( QgsMapLayer *layer ) const;
1424 
1426  virtual void setExtent( const QgsRectangle &rect );
1427 
1429  void setValid( bool valid );
1430 
1435  virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
1436 
1441  virtual bool writeXml( QDomNode &layer_node, QDomDocument &document, const QgsReadWriteContext &context ) const;
1442 
1454  virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const;
1455 
1468  virtual QString decodedSource( const QString &source, const QString &dataProvider, const QgsReadWriteContext &context ) const;
1469 
1474  void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = QString() );
1475 
1477  void writeCustomProperties( QDomNode &layerNode, QDomDocument &doc ) const;
1478 
1480  void readStyleManager( const QDomNode &layerNode );
1482  void writeStyleManager( QDomNode &layerNode, QDomDocument &doc ) const;
1483 
1488  void writeCommonStyle( QDomElement &layerElement, QDomDocument &document,
1489  const QgsReadWriteContext &context,
1490  StyleCategories categories = AllStyleCategories ) const;
1491 
1496  void readCommonStyle( const QDomElement &layerElement, const QgsReadWriteContext &context,
1497  StyleCategories categories = AllStyleCategories );
1498 
1500  void setProviderType( const QString &providerType );
1501 
1502 #ifndef SIP_RUN
1503 #if 0
1504  void connectNotify( const char *signal ) override;
1506 #endif
1507 #endif
1508 
1510  void appendError( const QgsErrorMessage &error ) { mError.append( error );}
1512  void setError( const QgsError &error ) { mError = error;}
1513 
1516 
1518  bool mValid = false;
1519 
1521  QString mDataSource;
1522 
1524  QString mLayerName;
1525 
1526  QString mShortName;
1527  QString mTitle;
1528 
1530  QString mAbstract;
1531  QString mKeywordList;
1532 
1534  QString mDataUrl;
1536 
1538  QString mAttribution;
1540 
1542  QString mMetadataUrl;
1545 
1547  QString mLegendUrl;
1549 
1552 
1554  QSet<QgsMapLayerDependency> mDependencies;
1555 
1561  Q_DECL_DEPRECATED bool hasDependencyCycle( const QSet<QgsMapLayerDependency> & ) const {return false;}
1562 
1563  bool mIsRefreshOnNofifyEnabled = false;
1565 
1567  QString mProviderKey;
1568 
1569  //TODO QGIS 4 - move to readXml as a new argument (breaks API)
1570 
1572  QgsMapLayer::ReadFlags mReadFlags = nullptr;
1573 
1579  bool mShouldValidateCrs = true;
1580 
1581  private:
1582 
1583  virtual QString baseURI( PropertyType type ) const;
1584  QString saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1585  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1586  QString loadNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1587  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1588  bool loadNamedPropertyFromDatabase( const QString &db, const QString &uri, QString &xml, QgsMapLayer::PropertyType type );
1589 
1594  virtual bool isReadOnly() const;
1595 
1600 
1602  QString mID;
1603 
1605  QgsMapLayerType mLayerType;
1606 
1607  LayerFlags mFlags = LayerFlags( Identifiable | Removable | Searchable );
1608 
1610  QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
1611 
1613  QString mTag;
1614 
1615  //set some generous defaults for scale based visibility
1616 
1618  double mMinScale = 0;
1620  double mMaxScale = 100000000;
1622  bool mScaleBasedVisibility = false;
1623 
1625  QUndoStack *mUndoStack = nullptr;
1626 
1627  QUndoStack *mUndoStackStyles = nullptr;
1628 
1630  QgsObjectCustomProperties mCustomProperties;
1631 
1633  QgsMapLayerLegend *mLegend = nullptr;
1634 
1636  QgsMapLayerStyleManager *mStyleManager = nullptr;
1637 
1639  QTimer *mRefreshTimer = nullptr;
1640 
1641  QgsLayerMetadata mMetadata;
1642 
1644  QgsAbstract3DRenderer *m3DRenderer = nullptr;
1645 
1651  QString mOriginalXmlProperties;
1652 
1654  bool mRepaintRequestedFired = false;
1655 };
1656 
1658 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::LayerFlags )
1659 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::StyleCategories )
1660 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::ReadFlags )
1661 
1662 
1663 #ifndef SIP_RUN
1664 
1670 typedef QPointer< QgsMapLayer > QgsWeakMapLayerPointer;
1671 
1677 typedef QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList;
1678 #endif
1679 
1680 #endif
QString attributionUrl() const
Returns the attribution URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:394
QString mShortName
Definition: qgsmaplayer.h:1526
void setMetadataUrl(const QString &metaUrl)
Sets the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:405
The class is used as a container of context for various read/write operations on other objects...
QString dataUrlFormat() const
Returns the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:356
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Base class for all map layer types.
Definition: qgsmaplayer.h:81
Base class for all renderers that may to participate in 3D view.
QString mAttributionUrl
Definition: qgsmaplayer.h:1539
QString mKeywordList
Definition: qgsmaplayer.h:1531
QString mDataUrlFormat
Definition: qgsmaplayer.h:1535
QString dataUrl() const
Returns the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:338
QString mProviderKey
Data provider key (name of the data provider)
Definition: qgsmaplayer.h:1567
PropertyType
Maplayer has a style and a metadata property.
Definition: qgsmaplayer.h:129
QString mLegendUrlFormat
Definition: qgsmaplayer.h:1548
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:471
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:252
void setMetadataUrlType(const QString &metaUrlType)
Set the metadata type of the layer used by QGIS Server in GetCapabilities request MetadataUrlType ind...
Definition: qgsmaplayer.h:423
Abstract base class for spatial data provider implementations.
const QgsCoordinateReferenceSystem & crs
An interface for classes which can visit style entity (e.g.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
Definition: qgsmaplayer.h:1670
QString mLayerName
Name of the layer - used for display.
Definition: qgsmaplayer.h:1524
bool isRefreshOnNotifyEnabled() const
Returns true if the refresh on provider nofification is enabled.
Definition: qgsmaplayer.h:1151
QgsError mError
Error.
Definition: qgsmaplayer.h:1551
virtual QgsMapLayerTemporalProperties * temporalProperties()
Returns the layer&#39;s temporal properties.
Definition: qgsmaplayer.h:1194
QgsRectangle mExtent
Extent of the layer.
Definition: qgsmaplayer.h:1515
QString mMetadataUrl
MetadataUrl of the layer.
Definition: qgsmaplayer.h:1542
void setLegendUrlFormat(const QString &legendUrlFormat)
Sets the format for a URL based layer legend.
Definition: qgsmaplayer.h:984
QString metadataUrlFormat() const
Returns the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:450
void setKeywordList(const QString &keywords)
Sets the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:310
ReadFlag
Flags which control project read behavior.
Definition: qgsmaplayer.h:546
void setTitle(const QString &title)
Sets the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:278
#define SIP_SKIP
Definition: qgis_sip.h:126
QSet< QgsMapLayerDependency > mDependencies
List of layers that may modify this layer on modification.
Definition: qgsmaplayer.h:1554
QString keywordList() const
Returns the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:318
QString mDataUrl
DataUrl of the layer.
Definition: qgsmaplayer.h:1534
#define SIP_TRANSFER
Definition: qgis_sip.h:36
The QgsMapLayerLegend class is abstract interface for implementations of legends for one map layer...
#define SIP_END
Definition: qgis_sip.h:189
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
QString legendUrl() const
Returns the URL for the layer&#39;s legend.
Definition: qgsmaplayer.h:979
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Definition: qgsproject.h:92
QgsErrorMessage represents single error message.
Definition: qgserror.h:32
#define SIP_FACTORY
Definition: qgis_sip.h:76
Contains information about the context in which a coordinate transform is executed.
void setDataUrlFormat(const QString &dataUrlFormat)
Sets the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:347
QString mTitle
Definition: qgsmaplayer.h:1527
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:882
QString legendUrlFormat() const
Returns the format for a URL based layer legend.
Definition: qgsmaplayer.h:989
QString mMetadataUrlFormat
Definition: qgsmaplayer.h:1544
void setLegendUrl(const QString &legendUrl)
Sets the URL for the layer&#39;s legend.
Definition: qgsmaplayer.h:974
void setMetadataUrlFormat(const QString &metaUrlFormat)
Sets the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:441
QString title() const
Returns the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:286
LayerFlag
Flags for the map layer.
Definition: qgsmaplayer.h:140
StyleCategory
Categories of style to distinguish appropriate sections for import/export.
Definition: qgsmaplayer.h:154
QString mAttribution
Attribution of the layer.
Definition: qgsmaplayer.h:1538
QString mAbstract
Description of the layer.
Definition: qgsmaplayer.h:1530
A structured metadata store for a map layer.
QString mRefreshOnNofifyMessage
Definition: qgsmaplayer.h:1564
Base class for storage of map layer temporal properties.
Contains information about the context of a rendering operation.
Setting options for creating vector data providers.
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:1561
QString mDataSource
Data source description string, varies by layer type.
Definition: qgsmaplayer.h:1521
QgsError is container for error messages (report).
Definition: qgserror.h:80
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
Definition: qgsmaplayer.h:1677
#define SIP_OUT
Definition: qgis_sip.h:58
QString mLegendUrl
WMS legend.
Definition: qgsmaplayer.h:1547
This class represents a coordinate reference system (CRS).
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML i...
void setAttributionUrl(const QString &attribUrl)
Sets the attribution URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:385
void appendError(const QgsErrorMessage &error)
Add error message.
Definition: qgsmaplayer.h:1510
Base class for utility classes that encapsulate information necessary for rendering of map layers...
bool readOnly() const
Returns if this layer is read only.
Definition: qgsmaplayer.h:466
QString metadataUrl() const
Returns the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:414
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgsmaplayer.h:67
void setAttribution(const QString &attrib)
Sets the attribution of the layer used by QGIS Server in GetCapabilities request. ...
Definition: qgsmaplayer.h:367
void setRefreshOnNofifyMessage(const QString &message)
Set the notification message that triggers repaint If refresh on notification is enabled, the notification will triggerRepaint only if the notification message is equal to.
Definition: qgsmaplayer.h:1269
Management of styles for use with one map layer.
QString refreshOnNotifyMessage() const
Returns the message that should be notified by the provider to triggerRepaint.
Definition: qgsmaplayer.h:1144
void setDataUrl(const QString &dataUrl)
Sets the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:329
QString mMetadataUrlType
Definition: qgsmaplayer.h:1543
void setError(const QgsError &error)
Sets error message.
Definition: qgsmaplayer.h:1512
void setAbstract(const QString &abstract)
Sets the abstract of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:294
QString attribution() const
Returns the attribution of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:376
QString metadataUrlType() const
Returns the metadata type of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:432