QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
16 #ifndef QQGSDATAPROVIDER_H
17 #define QQGSDATAPROVIDER_H
19 #include "qgis_core.h"
23 #include <QStringList>
46 if ( qobject_cast<QgsVectorDataProvider *>( sipCpp ) )
48 sipType = sipType_QgsVectorDataProvider;
50 else if ( qobject_cast<QgsRasterDataProvider *>( sipCpp ) )
52 sipType = sipType_QgsRasterDataProvider;
54 else if ( qobject_cast<QgsMeshDataProvider *>( sipCpp ) )
56 sipType = sipType_QgsMeshDataProvider;
75 NoDataCapabilities = 0,
81 Q_DECLARE_FLAGS( DataCapabilities, DataCapability )
130 mDataSourceURI = uri;
144 if ( expandAuthConfig && mDataSourceURI.contains( QLatin1String(
"authcfg" ) ) )
147 return uri.
uri( expandAuthConfig );
151 return mDataSourceURI;
172 mDataSourceURI = uri.
uri(
true );
214 virtual
bool isValid() const = 0;
220 virtual
void updateExtents()
236 Q_UNUSED( updateFeatureCount )
268 return QStringList();
280 return QStringList();
301 if ( layers.count() < 1 )
315 if ( name.isEmpty() || !vis )
338 virtual QString name()
const = 0;
353 virtual QString description()
const = 0;
393 virtual void reloadData();
396 virtual QDateTime
timestamp()
const {
return mTimestamp; }
463 void setProviderProperty( ProviderProperty property,
const QVariant &value );
471 void setProviderProperty(
int property,
const QVariant &value );
479 QVariant providerProperty( ProviderProperty property,
const QVariant &defaultValue = QVariant() )
const;
487 QVariant providerProperty(
int property,
const QVariant &defaultValue )
const;
499 virtual void setListening(
bool isListening );
511 double lastRenderingTimeMs = -1;
514 double maxRenderingTimeMs = MAXIMUM_LAYER_PREVIEW_TIME_MS;
579 static QString sublayerSeparator();
589 void fullExtentCalculated();
612 void notify( const QString &msg );
620 QDateTime mTimestamp;
637 QString mDataSourceURI;
639 QMap< int, QVariant > mProviderProperties;
646 mutable QMutex mOptionsMutex;
652 virtual void reloadProviderData() {}
virtual QStringList subLayerStyles() const
Sub-layer styles for each sub-layer handled by this provider, in order from bottom to top.
virtual uint subLayerCount() const
Returns the number of layers for the current data source.
virtual bool supportsSubsetString() const
Returns true if the provider supports setting of subset strings.
Setting options for creating vector data providers.
virtual void setSubLayerVisibility(const QString &name, bool vis)
Set the visibility of the given sublayer name.
const QgsCoordinateReferenceSystem & crs
virtual bool setSubsetString(const QString &subset, bool updateFeatureCount=true)
Set the subset string used to create a subset of features in the layer.
virtual void invalidateConnections(const QString &connection)
Invalidate connections corresponding to specified name.
virtual QgsError error() const
Gets current status error.
virtual QString dataSourceUri(bool expandAuthConfig=false) const
Gets the data source specification.
void append(const QString &message, const QString &tag)
Append new error message.
ProviderProperty
Properties are used to pass custom configuration options into data providers.
virtual QDateTime timestamp() const
Time stamp of data source in the moment when data/metadata were loaded by provider.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
@ EvaluateDefaultValues
Evaluate default values on provider side when calling QgsVectorDataProvider::defaultValue( int index ...
void setUri(const QgsDataSourceUri &uri)
Set the data source specification.
virtual bool writeLayerMetadata(const QgsLayerMetadata &metadata)
Writes layer metadata to the underlying provider source.
virtual bool enterUpdateMode()
Enter update mode.
Stores settings related to the context in which a preview job runs.
void setError(const QgsError &error)
Sets error message.
virtual QDateTime dataTimestamp() const
Current time stamp of data source.
virtual QString fileVectorFilters() const
Returns vector file filter string.
virtual void setDataSourceUri(const QString &uri)
Set the data source specification.
QgsCoordinateTransformContext transformContext
QString uri(bool expandAuthConfig=true) const
Returns the complete URI as a string.
QgsDataSourceUri uri() const
Gets the data source specification.
virtual bool leaveUpdateMode()
Leave update mode.
virtual QString subsetString() const
Returns the subset definition string (typically sql) currently in use by the layer and used by the pr...
virtual QgsLayerMetadata layerMetadata() const
Returns layer metadata collected from the provider's source.
virtual QString dataComment() const
Returns a short comment for the data that this provider is providing access to (e....
DataCapability
Used in browser model to understand which items for which providers should be populated.
virtual void setLayerOrder(const QStringList &layers)
Reorder the list of layer names to be rendered by this provider (in order from bottom to top)
virtual QString fileRasterFilters() const
Returns raster file filter string.
virtual QStringList subLayers() const
Sub-layers handled by this provider, in order from bottom to top.