QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
27 QString
const &description,
28 QString
const &library )
30 , mDescription( description )
36 , mDescription( description )
37 , mCreateFunction( createFunc )
42 qDeleteAll( mProviderConnections );
62 return QgsProviderMetadata::ProviderMetadataCapabilities();
67 return QgsProviderMetadata::ProviderCapabilities();
82 return mCreateFunction;
102 return QList<QgsMeshDriverMetadata>();
112 return QList<QgsMapLayerType>();
122 return QStringList();
127 return QList<QgsProviderSublayerDetails>();
132 QgsDataProvider::ReadFlags flags )
134 if ( mCreateFunction )
136 return mCreateFunction( uri, options, flags );
143 if ( value.toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
144 value.toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
145 value.toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
147 uri[ parameter ] =
true;
149 else if ( value.toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
150 value.toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
151 value.toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
153 uri[ parameter ] =
false;
159 if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
160 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
161 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
165 else if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
166 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
167 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
177 return QVariantMap();
188 bool, QMap<int, int> &,
189 QString &errorMessage,
const QMap<QString, QVariant> * )
191 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createEmptyLayer" ) );
192 return Qgis::VectorExportResult::ErrorProviderUnsupportedFeature;
196 const QString &,
const QString &,
200 const QStringList & )
222 return QList<QPair<QString, QString> >();
227 return QList<QgsDataItemProvider *>();
231 QStringList &, QString &errCause )
233 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
245 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
251 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
256 const QString &,
const QString &,
bool, QString &errCause )
258 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
264 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
275 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
292 return connections<QgsAbstractDatabaseProviderConnection>( cached ) ;
297 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
298 const QStringList constKeys { constConns.keys( ) };
299 for (
const QString &
key : constKeys )
303 return constConns.value(
key );
318 Q_UNUSED( configuration );
331 Q_UNUSED( connection )
339 const bool isNewConnection = !
connections().contains( name );
341 mProviderConnections.clear();
343 if ( !isNewConnection )
353 QMap<QString, T *> result;
355 const QStringList constConnKeys { constConns.keys() };
356 for (
const auto &
c : constConnKeys )
358 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
361 result.insert(
c, casted );
370 const QString &description,
371 const MeshDriverCapabilities &capabilities,
372 const QString &writeDatasetOnfileSuffix )
374 , mDescription( description )
375 , mCapabilities( capabilities )
376 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
381 const QString &description,
382 const MeshDriverCapabilities &capabilities,
383 const QString &writeDatasetOnfileSuffix,
384 const QString &writeMeshFrameOnFileSuffix,
385 int maxVerticesPerface )
387 , mDescription( description )
388 , mCapabilities( capabilities )
389 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
390 , mWriteMeshFrameOnFileSuffix( ( writeMeshFrameOnFileSuffix ) )
391 , mMaxVerticesPerFace( maxVerticesPerface )
397 return mCapabilities;
412 return mWriteDatasetOnFileSuffix;
417 return mWriteMeshFrameOnFileSuffix;
422 return mMaxVerticesPerFace;
Setting options for creating vector data providers.
Abstract base class for spatial data provider implementations.
VectorExportResult
Vector layer export result codes.
Container of fields for a vector layer.
DataType
Raster data types.
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.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
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
Custom exception class which is raised when an operation is not supported.
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.