QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
25 QString
const &description,
26 QString
const &library )
28 , mDescription( description )
34 , mDescription( description )
35 , mCreateFunction( createFunc )
40 qDeleteAll( mProviderConnections );
60 return mCreateFunction;
80 return QList<QgsMeshDriverMetadata>();
85 QgsDataProvider::ReadFlags flags )
87 if ( mCreateFunction )
89 return mCreateFunction( uri, options, flags );
96 if ( value.toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
97 value.toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
98 value.toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
100 uri[ parameter ] =
true;
102 else if ( value.toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
103 value.toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
104 value.toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
106 uri[ parameter ] =
false;
112 if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
113 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
114 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
118 else if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
119 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
120 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
130 return QVariantMap();
141 bool, QMap<int, int> &,
142 QString &errorMessage,
const QMap<QString, QVariant> * )
144 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createEmptyLayer" ) );
145 return QgsVectorLayerExporter::ExportError::ErrProviderUnsupportedFeature;
149 const QString &,
const QString &,
153 const QStringList & )
169 return QList<QPair<QString, QString> >();
174 return QList<QgsDataItemProvider *>();
178 QStringList &, QString &errCause )
180 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
186 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
192 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
197 const QString &,
const QString &,
bool, QString &errCause )
199 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
205 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
211 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
228 return connections<QgsAbstractDatabaseProviderConnection>( cached ) ;
233 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
234 const QStringList constKeys { constConns.keys( ) };
235 for (
const QString &
key : constKeys )
239 return constConns.value(
key );
254 Q_UNUSED( configuration );
267 Q_UNUSED( connection )
275 const bool isNewConnection = !
connections().contains( name );
277 mProviderConnections.clear();
279 if ( !isNewConnection )
289 QMap<QString, T *> result;
291 const QStringList constConnKeys { constConns.keys() };
292 for (
const auto &
c : constConnKeys )
294 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
297 result.insert(
c, casted );
306 : mName( name ), mDescription( description ), mCapabilities( capabilities ), mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
312 return mCapabilities;
327 return mWriteDatasetOnFileSuffix;
DataType
Raster data types.
Setting options for creating vector data providers.
Abstract base class for spatial data provider implementations.
Container of fields for a vector layer.
Type
The WKB type describes the number of dimensions a geometry has.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
Mesh - vertices, edges and faces.
Custom exception class for provider connection related exceptions.
This class represents a coordinate reference system (CRS).
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
The QgsAbstractProviderConnection provides an interface for data provider connections.
Base class for raster data providers.
virtual void store(const QString &name) const =0
Stores the connection in the settings.