QGIS API Documentation  3.13.0-Master (13337b20cd)
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;
50 
51 class QDomDocument;
52 class QKeyEvent;
53 class QPainter;
54 
55 /*
56  * Constants used to describe copy-paste MIME types
57  */
58 #define QGSCLIPBOARD_MAPLAYER_MIME "application/qgis.maplayer"
59 
60 
67  {
71  MeshLayer
72 };
73 
79 class CORE_EXPORT QgsMapLayer : public QObject
80 {
81  Q_OBJECT
82 
83  Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
84  Q_PROPERTY( int autoRefreshInterval READ autoRefreshInterval WRITE setAutoRefreshInterval NOTIFY autoRefreshIntervalChanged )
85  Q_PROPERTY( QgsLayerMetadata metadata READ metadata WRITE setMetadata NOTIFY metadataChanged )
86  Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs NOTIFY crsChanged )
87 
88 #ifdef SIP_RUN
90  QgsMapLayer * layer = qobject_cast<QgsMapLayer *>( sipCpp );
91 
92  sipType = 0;
93 
94  if ( layer )
95  {
96  switch ( layer->type() )
97  {
99  sipType = sipType_QgsVectorLayer;
100  break;
102  sipType = sipType_QgsRasterLayer;
103  break;
105  sipType = sipType_QgsPluginLayer;
106  break;
108  sipType = sipType_QgsMeshLayer;
109  break;
110  default:
111  sipType = nullptr;
112  break;
113  }
114  }
115  SIP_END
116 #endif
117 
118  public:
119 
125  {
126  Style = 0,
128  };
129 
136  {
137  Identifiable = 1 << 0,
138  Removable = 1 << 1,
139  Searchable = 1 << 2,
140  };
141  Q_ENUM( LayerFlag )
142  Q_DECLARE_FLAGS( LayerFlags, LayerFlag )
143  Q_FLAG( LayerFlags )
144 
145 
150  {
151  LayerConfiguration = 1 << 0,
152  Symbology = 1 << 1,
153  Symbology3D = 1 << 2,
154  Labeling = 1 << 3,
155  Fields = 1 << 4,
156  Forms = 1 << 5,
157  Actions = 1 << 6,
158  MapTips = 1 << 7,
159  Diagrams = 1 << 8,
160  AttributeTable = 1 << 9,
161  Rendering = 1 << 10,
162  CustomProperties = 1 << 11,
163  GeometryOptions = 1 << 12,
164  Relations = 1 << 13,
165  AllStyleCategories = LayerConfiguration | Symbology | Symbology3D | Labeling | Fields | Forms | Actions |
166  MapTips | Diagrams | AttributeTable | Rendering | CustomProperties | GeometryOptions | Relations,
167  };
168  Q_ENUM( StyleCategory )
169  Q_DECLARE_FLAGS( StyleCategories, StyleCategory )
170  Q_FLAG( StyleCategories )
171 
172 
178  QgsMapLayer( QgsMapLayerType type = QgsMapLayerType::VectorLayer, const QString &name = QString(), const QString &source = QString() );
179 
180  ~QgsMapLayer() override;
181 
183  QgsMapLayer( QgsMapLayer const & ) = delete;
185  QgsMapLayer &operator=( QgsMapLayer const & ) = delete;
186 
193  virtual QgsMapLayer *clone() const = 0;
194 
198  QgsMapLayerType type() const;
199 
207  QgsMapLayer::LayerFlags flags() const;
208 
216  void setFlags( QgsMapLayer::LayerFlags flags );
217 
223  static QString extensionPropertyType( PropertyType type );
224 
226  QString id() const;
227 
233  void setName( const QString &name );
234 
239  QString name() const;
240 
244  virtual QgsDataProvider *dataProvider();
245 
250  virtual const QgsDataProvider *dataProvider() const SIP_SKIP;
251 
258  void setShortName( const QString &shortName ) { mShortName = shortName; }
259 
265  QString shortName() const;
266 
272  void setTitle( const QString &title ) { mTitle = title; }
273 
280  QString title() const { return mTitle; }
281 
288  void setAbstract( const QString &abstract ) { mAbstract = abstract; }
289 
296  QString abstract() const { return mAbstract; }
297 
304  void setKeywordList( const QString &keywords ) { mKeywordList = keywords; }
305 
312  QString keywordList() const { return mKeywordList; }
313 
314  /* Layer dataUrl information */
315 
323  void setDataUrl( const QString &dataUrl ) { mDataUrl = dataUrl; }
324 
332  QString dataUrl() const { return mDataUrl; }
333 
341  void setDataUrlFormat( const QString &dataUrlFormat ) { mDataUrlFormat = dataUrlFormat; }
342 
350  QString dataUrlFormat() const { return mDataUrlFormat; }
351 
352  /* Layer attribution information */
353 
361  void setAttribution( const QString &attrib ) { mAttribution = attrib; }
362 
370  QString attribution() const { return mAttribution; }
371 
379  void setAttributionUrl( const QString &attribUrl ) { mAttributionUrl = attribUrl; }
380 
388  QString attributionUrl() const { return mAttributionUrl; }
389 
390  /* Layer metadataUrl information */
391 
399  void setMetadataUrl( const QString &metaUrl ) { mMetadataUrl = metaUrl; }
400 
408  QString metadataUrl() const { return mMetadataUrl; }
409 
417  void setMetadataUrlType( const QString &metaUrlType ) { mMetadataUrlType = metaUrlType; }
418 
426  QString metadataUrlType() const { return mMetadataUrlType; }
427 
435  void setMetadataUrlFormat( const QString &metaUrlFormat ) { mMetadataUrlFormat = metaUrlFormat; }
436 
444  QString metadataUrlFormat() const { return mMetadataUrlFormat; }
445 
451  void setBlendMode( QPainter::CompositionMode blendMode );
452 
457  QPainter::CompositionMode blendMode() const;
458 
460  bool readOnly() const { return isReadOnly(); }
461 
465  virtual void reload() {}
466 
471  virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) = 0 SIP_FACTORY;
472 
474  virtual QgsRectangle extent() const;
475 
481  bool isValid() const;
482 
489  QString publicSource() const;
490 
496  QString source() const;
497 
502  virtual QStringList subLayers() const;
503 
508  virtual void setLayerOrder( const QStringList &layers );
509 
515  virtual void setSubLayerVisibility( const QString &name, bool visible );
516 
518  virtual bool isEditable() const;
519 
524  virtual bool isSpatial() const;
525 
534  virtual bool isTemporary() const;
535 
540  enum ReadFlag
541  {
542  FlagDontResolveLayers = 1 << 0,
543  };
544  Q_DECLARE_FLAGS( ReadFlags, ReadFlag )
545 
546 
563  bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context, QgsMapLayer::ReadFlags flags = nullptr );
564 
582  bool writeLayerXml( QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
583 
588  virtual void resolveReferences( QgsProject *project );
589 
595  Q_INVOKABLE QStringList customPropertyKeys() const;
596 
602  Q_INVOKABLE void setCustomProperty( const QString &key, const QVariant &value );
603 
608  Q_INVOKABLE QVariant customProperty( const QString &value, const QVariant &defaultValue = QVariant() ) const;
609 
614  void setCustomProperties( const QgsObjectCustomProperties &properties );
615 
620  void removeCustomProperty( const QString &key );
621 
627  virtual QgsError error() const;
628 
634 
636  void setCrs( const QgsCoordinateReferenceSystem &srs, bool emitSignal = true );
637 
643  QgsCoordinateTransformContext transformContext( ) const;
644 
645 
651  static QString formatLayerName( const QString &name );
652 
660  virtual QString metadataUri() const;
661 
668  void exportNamedMetadata( QDomDocument &doc, QString &errorMsg ) const;
669 
679  virtual QString saveDefaultMetadata( bool &resultFlag SIP_OUT );
680 
695  QString saveNamedMetadata( const QString &uri, bool &resultFlag );
696 
711  virtual QString loadNamedMetadata( const QString &uri, bool &resultFlag SIP_OUT );
712 
722  QString loadDefaultMetadata( bool &resultFlag );
723 
732  bool loadNamedMetadataFromDatabase( const QString &db, const QString &uri, QString &qmd );
733 
741  bool importNamedMetadata( QDomDocument &document, QString &errorMessage );
742 
750  virtual QString styleURI() const;
751 
761  virtual QString loadDefaultStyle( bool &resultFlag SIP_OUT );
762 
778  virtual QString loadNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
779 
787  virtual bool loadNamedStyleFromDatabase( const QString &db, const QString &uri, QString &qml SIP_OUT );
788 
798  virtual bool importNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT,
799  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
800 
809  virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg SIP_OUT, const QgsReadWriteContext &context = QgsReadWriteContext(),
810  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const;
811 
812 
819  virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
820 
830  virtual QString saveDefaultStyle( bool &resultFlag SIP_OUT );
831 
847  virtual QString saveNamedStyle( const QString &uri, bool &resultFlag SIP_OUT, StyleCategories categories = AllStyleCategories );
848 
857  virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
858 
867  virtual QString loadSldStyle( const QString &uri, bool &resultFlag );
868 
869  virtual bool readSld( const QDomNode &node, QString &errorMessage )
870  { Q_UNUSED( node ) errorMessage = QStringLiteral( "Layer type %1 not supported" ).arg( static_cast<int>( type() ) ); return false; }
871 
872 
873 
882  virtual bool readSymbology( const QDomNode &node, QString &errorMessage,
883  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) = 0;
884 
895  virtual bool readStyle( const QDomNode &node, QString &errorMessage,
896  QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories );
897 
908  virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
909  StyleCategories categories = AllStyleCategories ) const = 0;
910 
923  virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
924  StyleCategories categories = AllStyleCategories ) const;
925 
926 
942  virtual void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false );
943 
947  QString providerType() const;
948 
950  QUndoStack *undoStack();
951 
956  QUndoStack *undoStackStyles();
957 
961  void setLegendUrl( const QString &legendUrl ) { mLegendUrl = legendUrl; }
962 
966  QString legendUrl() const { return mLegendUrl; }
967 
971  void setLegendUrlFormat( const QString &legendUrlFormat ) { mLegendUrlFormat = legendUrlFormat; }
972 
976  QString legendUrlFormat() const { return mLegendUrlFormat; }
977 
983  void setLegend( QgsMapLayerLegend *legend SIP_TRANSFER );
984 
989  QgsMapLayerLegend *legend() const;
990 
995  QgsMapLayerStyleManager *styleManager() const;
996 
1001  void setRenderer3D( QgsAbstract3DRenderer *renderer SIP_TRANSFER );
1002 
1007  QgsAbstract3DRenderer *renderer3D() const;
1008 
1018  bool isInScaleRange( double scale ) const;
1019 
1030  double minimumScale() const;
1031 
1042  double maximumScale() const;
1043 
1052  bool hasScaleBasedVisibility() const;
1053 
1060  bool hasAutoRefreshEnabled() const;
1061 
1069  int autoRefreshInterval() const;
1070 
1082  void setAutoRefreshInterval( int interval );
1083 
1090  void setAutoRefreshEnabled( bool enabled );
1091 
1098  virtual const QgsLayerMetadata &metadata() const;
1099 
1106  virtual void setMetadata( const QgsLayerMetadata &metadata );
1107 
1112  virtual QString htmlMetadata() const;
1113 
1115  virtual QDateTime timestamp() const;
1116 
1124  virtual QSet<QgsMapLayerDependency> dependencies() const;
1125 
1131  QString refreshOnNotifyMessage() const { return mRefreshOnNofifyMessage; }
1132 
1138  bool isRefreshOnNotifyEnabled() const { return mIsRefreshOnNofifyEnabled; }
1139 
1148  QString originalXmlProperties() const;
1149 
1157  void setOriginalXmlProperties( const QString &originalXmlProperties );
1158 
1163  static QString generateId( const QString &layerName );
1164 
1174  virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
1175 
1176  public slots:
1177 
1187  void setMinimumScale( double scale );
1188 
1198  void setMaximumScale( double scale );
1199 
1207  void setScaleBasedVisibility( bool enabled );
1208 
1217  void triggerRepaint( bool deferredUpdate = false );
1218 
1223  void emitStyleChanged();
1224 
1233  virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers );
1234 
1240  void setRefreshOnNotifyEnabled( bool enabled );
1241 
1249  void setRefreshOnNofifyMessage( const QString &message ) { mRefreshOnNofifyMessage = message; }
1250 
1256  virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ) = 0;
1257 
1258 #ifdef SIP_RUN
1259  SIP_PYOBJECT __repr__();
1260  % MethodCode
1261  QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider()->name() );
1262  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
1263  % End
1264 #endif
1265 
1266  signals:
1267 
1274  void beforeResolveReferences( QgsProject *project );
1275 
1277  void statusChanged( const QString &status );
1278 
1284  void nameChanged();
1285 
1287  void crsChanged();
1288 
1295  void repaintRequested( bool deferredUpdate = false );
1296 
1298  void recalculateExtents() const;
1299 
1301  void dataChanged();
1302 
1304  void blendModeChanged( QPainter::CompositionMode blendMode );
1305 
1310  void rendererChanged();
1311 
1319  void styleChanged();
1320 
1325  void legendChanged();
1326 
1331  void renderer3DChanged();
1332 
1337  void configChanged();
1338 
1342  void dependenciesChanged();
1343 
1350  void willBeDeleted();
1351 
1357  void autoRefreshIntervalChanged( int interval );
1358 
1365  void metadataChanged();
1366 
1373  void flagsChanged();
1374 
1382  void dataSourceChanged();
1383 
1389  void styleLoaded( QgsMapLayer::StyleCategories categories );
1390 
1391 
1392  private slots:
1393 
1394  void onNotifiedTriggerRepaint( const QString &message );
1395 
1396  protected:
1397 
1403  void clone( QgsMapLayer *layer ) const;
1404 
1406  virtual void setExtent( const QgsRectangle &rect );
1407 
1409  void setValid( bool valid );
1410 
1415  virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
1416 
1421  virtual bool writeXml( QDomNode &layer_node, QDomDocument &document, const QgsReadWriteContext &context ) const;
1422 
1434  virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const;
1435 
1448  virtual QString decodedSource( const QString &source, const QString &dataProvider, const QgsReadWriteContext &context ) const;
1449 
1454  void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = QString() );
1455 
1457  void writeCustomProperties( QDomNode &layerNode, QDomDocument &doc ) const;
1458 
1460  void readStyleManager( const QDomNode &layerNode );
1462  void writeStyleManager( QDomNode &layerNode, QDomDocument &doc ) const;
1463 
1468  void writeCommonStyle( QDomElement &layerElement, QDomDocument &document,
1469  const QgsReadWriteContext &context,
1470  StyleCategories categories = AllStyleCategories ) const;
1471 
1476  void readCommonStyle( const QDomElement &layerElement, const QgsReadWriteContext &context,
1477  StyleCategories categories = AllStyleCategories );
1478 
1480  void setProviderType( const QString &providerType );
1481 
1482 #ifndef SIP_RUN
1483 #if 0
1484  void connectNotify( const char *signal ) override;
1486 #endif
1487 #endif
1488 
1490  void appendError( const QgsErrorMessage &error ) { mError.append( error );}
1492  void setError( const QgsError &error ) { mError = error;}
1493 
1496 
1498  bool mValid = false;
1499 
1501  QString mDataSource;
1502 
1504  QString mLayerName;
1505 
1506  QString mShortName;
1507  QString mTitle;
1508 
1510  QString mAbstract;
1511  QString mKeywordList;
1512 
1514  QString mDataUrl;
1516 
1518  QString mAttribution;
1520 
1522  QString mMetadataUrl;
1525 
1527  QString mLegendUrl;
1529 
1532 
1534  QSet<QgsMapLayerDependency> mDependencies;
1535 
1541  Q_DECL_DEPRECATED bool hasDependencyCycle( const QSet<QgsMapLayerDependency> & ) const {return false;}
1542 
1543  bool mIsRefreshOnNofifyEnabled = false;
1545 
1547  QString mProviderKey;
1548 
1549  //TODO QGIS 4 - move to readXml as a new argument (breaks API)
1550 
1552  QgsMapLayer::ReadFlags mReadFlags = nullptr;
1553 
1559  bool mShouldValidateCrs = true;
1560 
1561  private:
1562 
1563  virtual QString baseURI( PropertyType type ) const;
1564  QString saveNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1565  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1566  QString loadNamedProperty( const QString &uri, QgsMapLayer::PropertyType type,
1567  bool &resultFlag, StyleCategories categories = AllStyleCategories );
1568  bool loadNamedPropertyFromDatabase( const QString &db, const QString &uri, QString &xml, QgsMapLayer::PropertyType type );
1569 
1574  virtual bool isReadOnly() const;
1575 
1580 
1582  QString mID;
1583 
1585  QgsMapLayerType mLayerType;
1586 
1587  LayerFlags mFlags = LayerFlags( Identifiable | Removable | Searchable );
1588 
1590  QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
1591 
1593  QString mTag;
1594 
1595  //set some generous defaults for scale based visibility
1596 
1598  double mMinScale = 0;
1600  double mMaxScale = 100000000;
1602  bool mScaleBasedVisibility = false;
1603 
1605  QUndoStack *mUndoStack = nullptr;
1606 
1607  QUndoStack *mUndoStackStyles = nullptr;
1608 
1610  QgsObjectCustomProperties mCustomProperties;
1611 
1613  QgsMapLayerLegend *mLegend = nullptr;
1614 
1616  QgsMapLayerStyleManager *mStyleManager = nullptr;
1617 
1619  QTimer *mRefreshTimer = nullptr;
1620 
1621  QgsLayerMetadata mMetadata;
1622 
1624  QgsAbstract3DRenderer *m3DRenderer = nullptr;
1625 
1631  QString mOriginalXmlProperties;
1632 
1634  bool mRepaintRequestedFired = false;
1635 };
1636 
1638 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::LayerFlags )
1639 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::StyleCategories )
1640 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayer::ReadFlags )
1641 
1642 
1643 #ifndef SIP_RUN
1644 
1650 typedef QPointer< QgsMapLayer > QgsWeakMapLayerPointer;
1651 
1657 typedef QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList;
1658 #endif
1659 
1660 #endif
QString attributionUrl() const
Returns the attribution URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:388
QString mShortName
Definition: qgsmaplayer.h:1506
void setMetadataUrl(const QString &metaUrl)
Sets the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:399
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:350
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Base class for all map layer types.
Definition: qgsmaplayer.h:79
Base class for all renderers that may to participate in 3D view.
QString mAttributionUrl
Definition: qgsmaplayer.h:1519
QString mKeywordList
Definition: qgsmaplayer.h:1511
QString mDataUrlFormat
Definition: qgsmaplayer.h:1515
QString dataUrl() const
Returns the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:332
QString mProviderKey
Data provider key (name of the data provider)
Definition: qgsmaplayer.h:1547
PropertyType
Maplayer has a style and a metadata property.
Definition: qgsmaplayer.h:124
QString mLegendUrlFormat
Definition: qgsmaplayer.h:1528
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:465
#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:417
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:1650
QString mLayerName
Name of the layer - used for display.
Definition: qgsmaplayer.h:1504
bool isRefreshOnNotifyEnabled() const
Returns true if the refresh on provider nofification is enabled.
Definition: qgsmaplayer.h:1138
QgsError mError
Error.
Definition: qgsmaplayer.h:1531
QgsRectangle mExtent
Extent of the layer.
Definition: qgsmaplayer.h:1495
QString mMetadataUrl
MetadataUrl of the layer.
Definition: qgsmaplayer.h:1522
void setLegendUrlFormat(const QString &legendUrlFormat)
Sets the format for a URL based layer legend.
Definition: qgsmaplayer.h:971
QString metadataUrlFormat() const
Returns the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:444
void setKeywordList(const QString &keywords)
Sets the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:304
ReadFlag
Flags which control project read behavior.
Definition: qgsmaplayer.h:540
void setTitle(const QString &title)
Sets the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:272
#define SIP_SKIP
Definition: qgis_sip.h:126
QSet< QgsMapLayerDependency > mDependencies
List of layers that may modify this layer on modification.
Definition: qgsmaplayer.h:1534
QString keywordList() const
Returns the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:312
QString mDataUrl
DataUrl of the layer.
Definition: qgsmaplayer.h:1514
#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:966
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Definition: qgsproject.h:91
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:341
QString mTitle
Definition: qgsmaplayer.h:1507
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:869
QString legendUrlFormat() const
Returns the format for a URL based layer legend.
Definition: qgsmaplayer.h:976
QString mMetadataUrlFormat
Definition: qgsmaplayer.h:1524
void setLegendUrl(const QString &legendUrl)
Sets the URL for the layer&#39;s legend.
Definition: qgsmaplayer.h:961
void setMetadataUrlFormat(const QString &metaUrlFormat)
Sets the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:435
QString title() const
Returns the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:280
LayerFlag
Flags for the map layer.
Definition: qgsmaplayer.h:135
StyleCategory
Categories of style to distinguish appropriate sections for import/export.
Definition: qgsmaplayer.h:149
QString mAttribution
Attribution of the layer.
Definition: qgsmaplayer.h:1518
QString mAbstract
Description of the layer.
Definition: qgsmaplayer.h:1510
A structured metadata store for a map layer.
QString mRefreshOnNofifyMessage
Definition: qgsmaplayer.h:1544
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:1541
QString mDataSource
Data source description string, varies by layer type.
Definition: qgsmaplayer.h:1501
QgsError is container for error messages (report).
Definition: qgserror.h:80
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
Definition: qgsmaplayer.h:1657
#define SIP_OUT
Definition: qgis_sip.h:58
QString mLegendUrl
WMS legend.
Definition: qgsmaplayer.h:1527
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:379
void appendError(const QgsErrorMessage &error)
Add error message.
Definition: qgsmaplayer.h:1490
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:460
QString metadataUrl() const
Returns the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:408
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgsmaplayer.h:66
void setAttribution(const QString &attrib)
Sets the attribution of the layer used by QGIS Server in GetCapabilities request. ...
Definition: qgsmaplayer.h:361
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:1249
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:1131
void setDataUrl(const QString &dataUrl)
Sets the DataUrl of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:323
QString mMetadataUrlType
Definition: qgsmaplayer.h:1523
void setError(const QgsError &error)
Sets error message.
Definition: qgsmaplayer.h:1492
void setAbstract(const QString &abstract)
Sets the abstract of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:288
QString attribution() const
Returns the attribution of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:370
QString metadataUrlType() const
Returns the metadata type of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:426