QGIS API Documentation  3.17.0-Master (a035f434f4)
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,
76 };
77 
83 class CORE_EXPORT QgsMapLayer : public QObject
84 {
85  Q_OBJECT
86 
87  Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
88  Q_PROPERTY( int autoRefreshInterval READ autoRefreshInterval WRITE setAutoRefreshInterval NOTIFY autoRefreshIntervalChanged )
89  Q_PROPERTY( QgsLayerMetadata metadata READ metadata WRITE setMetadata NOTIFY metadataChanged )
90  Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs NOTIFY crsChanged )
91  Q_PROPERTY( QgsMapLayerType type READ type CONSTANT )
92  Q_PROPERTY( bool isValid READ isValid NOTIFY isValidChanged )
93  Q_PROPERTY( double opacity READ opacity WRITE setOpacity NOTIFY opacityChanged )
94 
95 #ifdef SIP_RUN
97  QgsMapLayer * layer = qobject_cast<QgsMapLayer *>( sipCpp );
98 
99  sipType = 0;
100 
101  if ( layer )
102  {
103  switch ( layer->type() )
104  {
106  sipType = sipType_QgsVectorLayer;
107  break;
109  sipType = sipType_QgsRasterLayer;
110  break;
112  sipType = sipType_QgsPluginLayer;
113  break;
115  sipType = sipType_QgsMeshLayer;
116  break;
118  sipType = sipType_QgsVectorTileLayer;
119  break;
121  sipType = sipType_QgsAnnotationLayer;
122  break;
124  sipType = sipType_QgsPointCloudLayer;
125  break;
126  default:
127  sipType = nullptr;
128  break;
129  }
130  }
131  SIP_END
132 #endif
133 
134  public:
135 
141  {
142  Style = 0,
144  };
145 
152  {
153  Identifiable = 1 << 0,
154  Removable = 1 << 1,
155  Searchable = 1 << 2,
156  Private = 1 << 3,
157  };
158  Q_ENUM( LayerFlag )
159  Q_DECLARE_FLAGS( LayerFlags, LayerFlag )
160  Q_FLAG( LayerFlags )
161 
162 
167  {
168  LayerConfiguration = 1 << 0,
169  Symbology = 1 << 1,
170  Symbology3D = 1 << 2,
171  Labeling = 1 << 3,
172  Fields = 1 << 4,
173  Forms = 1 << 5,
174  Actions = 1 << 6,
175  MapTips = 1 << 7,
176  Diagrams = 1 << 8,
177  AttributeTable = 1 << 9,
178  Rendering = 1 << 10,
179  CustomProperties = 1 << 11,
180  GeometryOptions = 1 << 12,
181  Relations = 1 << 13,
182  Temporal = 1 << 14,
183  Legend = 1 << 15,
184  AllStyleCategories = LayerConfiguration | Symbology | Symbology3D | Labeling | Fields | Forms | Actions |
185  MapTips | Diagrams | AttributeTable | Rendering | CustomProperties | GeometryOptions | Relations | Temporal | Legend,
186  };
187  Q_ENUM( StyleCategory )
188  Q_DECLARE_FLAGS( StyleCategories, StyleCategory )
189  Q_FLAG( StyleCategories )
190 
191 
197  QgsMapLayer( QgsMapLayerType type = QgsMapLayerType::VectorLayer, const QString &name = QString(), const QString &source = QString() );
198 
199  ~QgsMapLayer() override;
200 
202  QgsMapLayer( QgsMapLayer const & ) = delete;
204  QgsMapLayer &operator=( QgsMapLayer const & ) = delete;
205 
212  virtual QgsMapLayer *clone() const = 0;
213 
217  QgsMapLayerType type() const;
218 
226  QgsMapLayer::LayerFlags flags() const;
227 
235  void setFlags( QgsMapLayer::LayerFlags flags );
236 
242  static QString extensionPropertyType( PropertyType type );
243 
245  QString id() const;
246 
252  void setName( const QString &name );
253 
258  QString name() const;
259 
263  virtual QgsDataProvider *dataProvider();
264 
269  virtual const QgsDataProvider *dataProvider() const SIP_SKIP;
270 
277  void setShortName( const QString &shortName ) { mShortName = shortName; }
278 
284  QString shortName() const;
285 
291  void setTitle( const QString &title ) { mTitle = title; }
292 
299  QString title() const { return mTitle; }
300 
307  void setAbstract( const QString &abstract ) { mAbstract = abstract; }
308 
315  QString abstract() const { return mAbstract; }
316 
323  void setKeywordList( const QString &keywords ) { mKeywordList = keywords; }
324 
331  QString keywordList() const { return mKeywordList; }
332 
333  /* Layer dataUrl information */
334 
342  void setDataUrl( const QString &dataUrl ) { mDataUrl = dataUrl; }
343 
351  QString dataUrl() const { return mDataUrl; }
352 
360  void setDataUrlFormat( const QString &dataUrlFormat ) { mDataUrlFormat = dataUrlFormat; }
361 
369  QString dataUrlFormat() const { return mDataUrlFormat; }
370 
371  /* Layer attribution information */
372 
380  void setAttribution( const QString &attrib ) { mAttribution = attrib; }
381 
389  QString attribution() const { return mAttribution; }
390 
398  void setAttributionUrl( const QString &attribUrl ) { mAttributionUrl = attribUrl; }
399 
407  QString attributionUrl() const { return mAttributionUrl; }
408 
409  /* Layer metadataUrl information */
410 
418  void setMetadataUrl( const QString &metaUrl ) { mMetadataUrl = metaUrl; }
419 
427  QString metadataUrl() const { return mMetadataUrl; }
428 
436  void setMetadataUrlType( const QString &metaUrlType ) { mMetadataUrlType = metaUrlType; }
437 
445  QString metadataUrlType() const { return mMetadataUrlType; }
446 
454  void setMetadataUrlFormat( const QString &metaUrlFormat ) { mMetadataUrlFormat = metaUrlFormat; }
455 
463  QString metadataUrlFormat() const { return mMetadataUrlFormat; }
464 
470  void setBlendMode( QPainter::CompositionMode blendMode );
471 
476  QPainter::CompositionMode blendMode() const;
477 
486  virtual void setOpacity( double opacity );
487 
496  virtual double opacity() const;
497 
499  bool readOnly() const { return isReadOnly(); }
500 
504  virtual void reload() {}
505 
510  virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) = 0 SIP_FACTORY;
511 
513  virtual QgsRectangle extent() const;
514 
520  bool isValid() const;
521 
528  QString publicSource() const;
529 
535  QString source() const;
536 
541  virtual QStringList subLayers() const;
542 
547  virtual void setLayerOrder( const QStringList &layers );
548 
554  virtual void setSubLayerVisibility( const QString &name, bool visible );
555 
557  virtual bool isEditable() const;
558 
563  virtual bool isSpatial() const;
564 
574  virtual bool isTemporary() const;
575 
580  enum ReadFlag
581  {
582  FlagDontResolveLayers = 1 << 0,
583  FlagTrustLayerMetadata = 1 << 1,
584  };
585  Q_DECLARE_FLAGS( ReadFlags, ReadFlag )
586 
587 
604  bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context, QgsMapLayer::ReadFlags flags = QgsMapLayer::ReadFlags() );
605 
623  bool writeLayerXml( QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
624 
629  virtual void resolveReferences( QgsProject *project );
630 
636  Q_INVOKABLE QStringList customPropertyKeys() const;
637 
643  Q_INVOKABLE void setCustomProperty( const QString &key, const QVariant &value );
644 
649  Q_INVOKABLE QVariant customProperty( const QString &value, const QVariant &defaultValue = QVariant() ) const;
650 
655  void setCustomProperties( const QgsObjectCustomProperties &properties );
656 
662  const QgsObjectCustomProperties &customProperties() const;
663 
668  void removeCustomProperty( const QString &key );
669 
675  virtual QgsError error() const;
676 
682 
684  void setCrs( const QgsCoordinateReferenceSystem &srs, bool emitSignal = true );
685 
691  QgsCoordinateTransformContext transformContext( ) const;
692 
693 
699  static QString formatLayerName( const QString &name );
700 
708  virtual QString metadataUri() const;
709 
716  void exportNamedMetadata( QDomDocument &doc, QString &errorMsg ) const;
717 
727  virtual QString saveDefaultMetadata( bool &resultFlag SIP_OUT );
728 
743  QString saveNamedMetadata( const QString &uri, bool &resultFlag );
744 
759  virtual QString loadNamedMetadata( const QString &uri, bool &resultFlag SIP_OUT );
760 
770  virtual QString loadDefaultMetadata( bool &resultFlag );
771 
780  bool loadNamedMetadataFromDatabase( const QString &db, const QString &uri, QString &qmd );
781 
789  bool importNamedMetadata( QDomDocument &document, QString &errorMessage );
790 
798  virtual QString styleURI() const;
799 
809  virtual QString loadDefaultStyle( bool &resultFlag SIP_OUT );
810 
826  virtual QString loadNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
827 
835  virtual bool loadNamedStyleFromDatabase( const QString &db, const QString &uri, QString &qml SIP_OUT );
836 
846  virtual bool importNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT,
847  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
848 
857  virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT, const QgsReadWriteContext &context = QgsReadWriteContext(),
858  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const;
859 
860 
867  virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
868 
878  virtual QString saveDefaultStyle( bool &resultFlag SIP_OUT );
879 
895  virtual QString saveNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, StyleCategories categories = AllStyleCategories );
896 
905  virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
906 
915  virtual QString loadSldStyle( const QString &uri, bool &resultFlag );
916 
917  virtual bool readSld( const QDomNode &node, QString &errorMessage )
918  { Q_UNUSED( node ) errorMessage = QStringLiteral( "Layer type %1 not supported" ).arg( static_cast<int>( type() ) ); return false; }
919 
920 
921 
930  virtual bool readSymbology( const QDomNode &node, QString &errorMessage,
931  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) = 0;
932 
943  virtual bool readStyle( const QDomNode &node, QString &errorMessage,
944  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories );
945 
956  virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
957  StyleCategories categories = AllStyleCategories ) const = 0;
958 
971  virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
972  StyleCategories categories = AllStyleCategories ) const;
973 
974 
990  virtual void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false );
991 
995  QString providerType() const;
996 
998  QUndoStack *undoStack();
999 
1004  QUndoStack *undoStackStyles();
1005 
1009  void setLegendUrl( const QString &legendUrl ) { mLegendUrl = legendUrl; }
1010 
1014  QString legendUrl() const { return mLegendUrl; }
1015 
1019  void setLegendUrlFormat( const QString &legendUrlFormat ) { mLegendUrlFormat = legendUrlFormat; }
1020 
1024  QString legendUrlFormat() const { return mLegendUrlFormat; }
1025 
1031  void setLegend( QgsMapLayerLegend *legend SIP_TRANSFER );
1032 
1037  QgsMapLayerLegend *legend() const;
1038 
1043  QgsMapLayerStyleManager *styleManager() const;
1044 
1049  void setRenderer3D( QgsAbstract3DRenderer *renderer SIP_TRANSFER );
1050 
1055  QgsAbstract3DRenderer *renderer3D() const;
1056 
1066  bool isInScaleRange( double scale ) const;
1067 
1078  double minimumScale() const;
1079 
1090  double maximumScale() const;
1091 
1100  bool hasScaleBasedVisibility() const;
1101 
1108  bool hasAutoRefreshEnabled() const;
1109 
1117  int autoRefreshInterval() const;
1118 
1130  void setAutoRefreshInterval( int interval );
1131 
1138  void setAutoRefreshEnabled( bool enabled );
1139 
1146  virtual const QgsLayerMetadata &metadata() const;
1147 
1154  virtual void setMetadata( const QgsLayerMetadata &metadata );
1155 
1160  virtual QString htmlMetadata() const;
1161 
1163  virtual QDateTime timestamp() const;
1164 
1172  virtual QSet<QgsMapLayerDependency> dependencies() const;
1173 
1179  QString refreshOnNotifyMessage() const { return mRefreshOnNofifyMessage; }
1180 
1186  bool isRefreshOnNotifyEnabled() const { return mIsRefreshOnNofifyEnabled; }
1187 
1196  QString originalXmlProperties() const;
1197 
1205  void setOriginalXmlProperties( const QString &originalXmlProperties );
1206 
1211  static QString generateId( const QString &layerName );
1212 
1222  virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
1223 
1229  virtual QgsMapLayerTemporalProperties *temporalProperties() { return nullptr; }
1230 
1231  public slots:
1232 
1242  void setMinimumScale( double scale );
1243 
1253  void setMaximumScale( double scale );
1254 
1262  void setScaleBasedVisibility( bool enabled );
1263 
1272  void triggerRepaint( bool deferredUpdate = false );
1273 
1278  void emitStyleChanged();
1279 
1288  virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers );
1289 
1295  void setRefreshOnNotifyEnabled( bool enabled );
1296 
1304  void setRefreshOnNofifyMessage( const QString &message ) { mRefreshOnNofifyMessage = message; }
1305 
1311  virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ) = 0;
1312 
1313 #ifdef SIP_RUN
1314  SIP_PYOBJECT __repr__();
1315  % MethodCode
1316  QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
1317  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
1318  % End
1319 #endif
1320 
1321  signals:
1322 
1329  void beforeResolveReferences( QgsProject *project );
1330 
1332  void statusChanged( const QString &status );
1333 
1339  void nameChanged();
1340 
1342  void crsChanged();
1343 
1350  void repaintRequested( bool deferredUpdate = false );
1351 
1353  void recalculateExtents() const;
1354 
1356  void dataChanged();
1357 
1359  void blendModeChanged( QPainter::CompositionMode blendMode );
1360 
1369  void opacityChanged( double opacity );
1370 
1375  void rendererChanged();
1376 
1384  void styleChanged();
1385 
1390  void legendChanged();
1391 
1396  void renderer3DChanged();
1397 
1402  void configChanged();
1403 
1407  void dependenciesChanged();
1408 
1415  void willBeDeleted();
1416 
1422  void autoRefreshIntervalChanged( int interval );
1423 
1430  void metadataChanged();
1431 
1438  void flagsChanged();
1439 
1447  void dataSourceChanged();
1448 
1454  void styleLoaded( QgsMapLayer::StyleCategories categories );
1455 
1461  void isValidChanged();
1462 
1468  void customPropertyChanged( const QString &key );
1469 
1470  private slots:
1471 
1472  void onNotifiedTriggerRepaint( const QString &message );
1473 
1474  protected:
1475 
1481  void clone( QgsMapLayer *layer ) const;
1482 
1484  virtual void setExtent( const QgsRectangle &rect );
1485 
1487  void setValid( bool valid );
1488 
1493  virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
1494 
1499  virtual bool writeXml( QDomNode &layer_node, QDomDocument &document, const QgsReadWriteContext &context ) const;
1500 
1512  virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const;
1513 
1526  virtual QString decodedSource( const QString &source, const QString &dataProvider, const QgsReadWriteContext &context ) const;
1527 
1533  void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = QString() );
1534 
1536  void writeCustomProperties( QDomNode &layerNode, QDomDocument &doc ) const;
1537 
1539  void readStyleManager( const QDomNode &layerNode );
1541  void writeStyleManager( QDomNode &layerNode, QDomDocument &doc ) const;
1542 
1547  void writeCommonStyle( QDomElement &layerElement, QDomDocument &document,
1548  const QgsReadWriteContext &context,
1549  StyleCategories categories = AllStyleCategories ) const;
1550 
1555  void readCommonStyle( const QDomElement &layerElement, const QgsReadWriteContext &context,
1556  StyleCategories categories = AllStyleCategories );
1557 
1559  void setProviderType( const QString &providerType );
1560 
1561 #ifndef SIP_RUN
1562 #if 0
1563  void connectNotify( const char *signal ) override;
1565 #endif
1566 #endif
1567 
1569  void appendError( const QgsErrorMessage &error ) { mError.append( error );}
1571  void setError( const QgsError &error ) { mError = error;}
1572 
1575 
1577  bool mValid = false;
1578 
1580  QString mDataSource;
1581 
1583  QString mLayerName;
1584 
1585  QString mShortName;
1586  QString mTitle;
1587 
1589  QString mAbstract;
1590  QString mKeywordList;
1591 
1593  QString mDataUrl;
1595 
1597  QString mAttribution;
1599 
1601  QString mMetadataUrl;
1604 
1606  QString mLegendUrl;
1608 
1611 
1613  QSet<QgsMapLayerDependency> mDependencies;
1614 
1620  Q_DECL_DEPRECATED bool hasDependencyCycle( const QSet<QgsMapLayerDependency> & ) const {return false;}
1621 
1622  bool mIsRefreshOnNofifyEnabled = false;
1624 
1626  QString mProviderKey;
1627 
1628  //TODO QGIS 4 - move to readXml as a new argument (breaks API)
1629 
1631  QgsMapLayer::ReadFlags mReadFlags = QgsMapLayer::ReadFlags();
1632 
1638  bool mShouldValidateCrs = true;
1639 
1645  double mLayerOpacity = 1.0;
1646 
1647  private:
1648 
1649  virtual QString baseURI( PropertyType type ) const;
1650  QString saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1651  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1652  QString loadNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1653  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1654  bool loadNamedPropertyFromDatabase( const QString &db, const QString &uri, QString &xml, QgsMapLayer::PropertyType type );
1655 
1660  virtual bool isReadOnly() const;
1661 
1667 
1669  QString mID;
1670 
1672  QgsMapLayerType mLayerType;
1673 
1674  LayerFlags mFlags = LayerFlags( Identifiable | Removable | Searchable );
1675 
1677  QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
1678 
1680  QString mTag;
1681 
1682  //set some generous defaults for scale based visibility
1683 
1685  double mMinScale = 0;
1687  double mMaxScale = 100000000;
1689  bool mScaleBasedVisibility = false;
1690 
1692  QUndoStack *mUndoStack = nullptr;
1693 
1694  QUndoStack *mUndoStackStyles = nullptr;
1695 
1697  QgsObjectCustomProperties mCustomProperties;
1698 
1700  QgsMapLayerLegend *mLegend = nullptr;
1701 
1703  QgsMapLayerStyleManager *mStyleManager = nullptr;
1704 
1706  QTimer *mRefreshTimer = nullptr;
1707 
1708  QgsLayerMetadata mMetadata;
1709 
1711  QgsAbstract3DRenderer *m3DRenderer = nullptr;
1712 
1718  QString mOriginalXmlProperties;
1719 
1721  bool mRepaintRequestedFired = false;
1722 };
1723 
1725 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::LayerFlags )
1726 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::StyleCategories )
1727 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::ReadFlags )
1728 
1729 
1730 #ifndef SIP_RUN
1731 
1737 typedef QPointer< QgsMapLayer > QgsWeakMapLayerPointer;
1738 
1744 typedef QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList;
1745 #endif
1746 
1747 #endif
QString attributionUrl() const
Returns the attribution URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:407
QString mShortName
Definition: qgsmaplayer.h:1585
void setMetadataUrl(const QString &metaUrl)
Sets the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:418
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:369
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Base class for all map layer types.
Definition: qgsmaplayer.h:83
Base class for all renderers that may to participate in 3D view.
QString mAttributionUrl
Definition: qgsmaplayer.h:1598
QString mKeywordList
Definition: qgsmaplayer.h:1590
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
QString mDataUrlFormat
Definition: qgsmaplayer.h:1594
QString dataUrl() const
Returns the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:351
QString mProviderKey
Data provider key (name of the data provider)
Definition: qgsmaplayer.h:1626
PropertyType
Maplayer has a style and a metadata property.
Definition: qgsmaplayer.h:140
QString mLegendUrlFormat
Definition: qgsmaplayer.h:1607
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:504
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition: qgis_sip.h:257
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.
void setMetadataUrlType(const QString &metaUrlType)
Set the metadata type of the layer used by QGIS Server in GetCapabilities request MetadataUrlType ind...
Definition: qgsmaplayer.h:436
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:1737
QString mLayerName
Name of the layer - used for display.
Definition: qgsmaplayer.h:1583
bool isRefreshOnNotifyEnabled() const
Returns true if the refresh on provider nofification is enabled.
Definition: qgsmaplayer.h:1186
QgsError mError
Error.
Definition: qgsmaplayer.h:1610
virtual QgsMapLayerTemporalProperties * temporalProperties()
Returns the layer&#39;s temporal properties.
Definition: qgsmaplayer.h:1229
QgsRectangle mExtent
Extent of the layer.
Definition: qgsmaplayer.h:1574
QString mMetadataUrl
MetadataUrl of the layer.
Definition: qgsmaplayer.h:1601
void setLegendUrlFormat(const QString &legendUrlFormat)
Sets the format for a URL based layer legend.
Definition: qgsmaplayer.h:1019
QString metadataUrlFormat() const
Returns the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:463
void setKeywordList(const QString &keywords)
Sets the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:323
ReadFlag
Flags which control project read behavior.
Definition: qgsmaplayer.h:580
void setTitle(const QString &title)
Sets the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:291
#define SIP_SKIP
Definition: qgis_sip.h:126
QSet< QgsMapLayerDependency > mDependencies
List of layers that may modify this layer on modification.
Definition: qgsmaplayer.h:1613
QString keywordList() const
Returns the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:331
QString mDataUrl
DataUrl of the layer.
Definition: qgsmaplayer.h:1593
#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:194
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
QString legendUrl() const
Returns the URL for the layer&#39;s legend.
Definition: qgsmaplayer.h:1014
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Definition: qgsproject.h:94
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:360
QString mTitle
Definition: qgsmaplayer.h:1586
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:917
QString legendUrlFormat() const
Returns the format for a URL based layer legend.
Definition: qgsmaplayer.h:1024
QString mMetadataUrlFormat
Definition: qgsmaplayer.h:1603
void setLegendUrl(const QString &legendUrl)
Sets the URL for the layer&#39;s legend.
Definition: qgsmaplayer.h:1009
void setMetadataUrlFormat(const QString &metaUrlFormat)
Sets the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:454
QString title() const
Returns the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:299
LayerFlag
Flags for the map layer.
Definition: qgsmaplayer.h:151
StyleCategory
Categories of style to distinguish appropriate sections for import/export.
Definition: qgsmaplayer.h:166
QString mAttribution
Attribution of the layer.
Definition: qgsmaplayer.h:1597
QString mAbstract
Description of the layer.
Definition: qgsmaplayer.h:1589
A structured metadata store for a map layer.
QString mRefreshOnNofifyMessage
Definition: qgsmaplayer.h:1623
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:1620
QString mDataSource
Data source description string, varies by layer type.
Definition: qgsmaplayer.h:1580
QgsError is container for error messages (report).
Definition: qgserror.h:80
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
Definition: qgsmaplayer.h:1744
#define SIP_OUT
Definition: qgis_sip.h:58
QString mLegendUrl
WMS legend.
Definition: qgsmaplayer.h:1606
This class represents a coordinate reference system (CRS).
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
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:398
void appendError(const QgsErrorMessage &error)
Add error message.
Definition: qgsmaplayer.h:1569
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:499
QString metadataUrl() const
Returns the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:427
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:380
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:1304
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:1179
void setDataUrl(const QString &dataUrl)
Sets the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:342
QString mMetadataUrlType
Definition: qgsmaplayer.h:1602
void setError(const QgsError &error)
Sets error message.
Definition: qgsmaplayer.h:1571
void setAbstract(const QString &abstract)
Sets the abstract of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:307
QString attribution() const
Returns the attribution of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:389
QString metadataUrlType() const
Returns the metadata type of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:445