QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsmaplayerfactory.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaplayerfactory.h
3 --------------------------------------
4 Date : March 2021
5 Copyright : (C) 2021 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot 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 QGSMAPLAYERFACTORY_H
19#define QGSMAPLAYERFACTORY_H
20
21#include "qgis.h"
22#include "qgis_core.h"
24
25#include <QString>
26
27class QgsMapLayer;
28
29
36class CORE_EXPORT QgsMapLayerFactory
37{
38 public:
39
50 static Qgis::LayerType typeFromString( const QString &string, bool &ok SIP_OUT );
51
57 static QString typeToString( Qgis::LayerType type );
58
94
102 static QgsMapLayer *createLayer( const QString &uri, const QString &name, Qgis::LayerType type, const LayerOptions &options,
103 const QString &provider = QString() ) SIP_FACTORY;
104
105};
106
107#endif // QGSMAPLAYERFACTORY_H
LayerType
Types of layers that can be added to a map.
Definition qgis.h:190
Contains information about the context in which a coordinate transform is executed.
Contains utility functions for creating map layers.
static QString typeToString(Qgis::LayerType type)
Converts a map layer type to a string value.
static Qgis::LayerType typeFromString(const QString &string, bool &ok)
Returns the map layer type corresponding a string value.
static QgsMapLayer * createLayer(const QString &uri, const QString &name, Qgis::LayerType type, const LayerOptions &options, const QString &provider=QString())
Creates a map layer, given a uri, name, layer type and provider name.
Base class for all map layer types.
Definition qgsmaplayer.h:80
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_FACTORY
Definition qgis_sip.h:84
Setting options for loading layers.
LayerOptions(const QgsCoordinateTransformContext &transformContext)
Constructor for LayerOptions with transformContext.
QgsCoordinateTransformContext transformContext
Transform context.
bool loadAllStoredStyles
Controls whether the stored styles will be all loaded.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.