17 #ifndef QGSVIRTUALLAYERDEFINITION_H 18 #define QGSVIRTUALLAYERDEFINITION_H 48 , mProvider( provider )
49 , mEncoding( encoding )
151 bool hasSourceLayer(
const QString& name )
const;
154 bool hasReferencedLayers()
const;
163 SourceLayers mSourceLayers;
bool isReferenced() const
Is it a live layer or not ?
const SourceLayers & sourceLayers() const
Get access to the source layers.
void setFields(const QgsFields &fields)
Set field definitions.
SourceLayer(const QString &name, const QString &source, const QString &provider, const QString &encoding)
Constructor variant to build a layer with a provider and a source.
QString name() const
Name of the layer.
QString uid() const
Get the name of the field with unique identifiers.
QString encoding() const
Optional encoding for the provider.
Container of fields for a vector layer.
QString source() const
The source url used by the provider to build the layer.
void setFilePath(const QString &filePath)
Set the file path.
QString filePath() const
Get the file path. May be empty.
QString reference() const
The reference (id) of the live layer.
void setQuery(const QString &query)
Set the SQL query.
void setGeometryField(const QString &geometryField)
Set the name of the geometry field.
const QgsFields & fields() const
Get field definitions.
QString geometryField() const
Get the name of the geometry field. Empty if no geometry field.
void setGeometryWkbType(QgsWKBTypes::Type t)
Set the type of the geometry.
SourceLayer(const QString &name, const QString &ref)
Constructor variant to build a live layer reference.
bool hasDefinedGeometry() const
Convenient method to test if the geometry is defined (not NoGeometry and not Unknown) ...
void setUid(const QString &uid)
Set the name of the field with unique identifiers.
QgsWKBTypes::Type geometryWkbType() const
Get the type of the geometry QgsWKBTypes::NoGeometry to hide any geometry QgsWKBTypes::Unknown for un...
void setGeometrySrid(long srid)
Set the SRID of the geometry.
QString provider() const
Provider key.
QList< SourceLayer > SourceLayers
List of source layers.
QString query() const
Get the SQL query.
A SourceLayer is either a reference to a live layer in the registry or all the parameters needed to l...
Class to manipulate the definition of a virtual layer.
long geometrySrid() const
Get the SRID of the geometry.