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;
197 errorMessage = QObject::tr(
"The %1 provider does not support database creation" ).arg(
key() );
202 const QString &,
const QString &,
206 const QStringList & )
228 return QList<QPair<QString, QString> >();
233 return QList<QgsDataItemProvider *>();
237 QStringList &, QString &errCause )
239 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
252 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
258 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
263 const QString &,
const QString &,
bool, QString &errCause )
265 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
271 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
282 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
299 return connections<QgsAbstractDatabaseProviderConnection>( cached ) ;
304 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
305 const QStringList constKeys { constConns.keys( ) };
306 for (
const QString &
key : constKeys )
310 return constConns.value(
key );
325 Q_UNUSED( configuration );
338 Q_UNUSED( connection )
346 const bool isNewConnection = !
connections().contains( name );
348 mProviderConnections.clear();
350 if ( !isNewConnection )
360 QMap<QString, T *> result;
362 const QStringList constConnKeys { constConns.keys() };
363 for (
const auto &
c : constConnKeys )
365 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
368 result.insert(
c, casted );
377 const QString &description,
378 const MeshDriverCapabilities &capabilities,
379 const QString &writeDatasetOnfileSuffix )
381 , mDescription( description )
382 , mCapabilities( capabilities )
383 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
388 const QString &description,
389 const MeshDriverCapabilities &capabilities,
390 const QString &writeDatasetOnfileSuffix,
391 const QString &writeMeshFrameOnFileSuffix,
392 int maxVerticesPerface )
394 , mDescription( description )
395 , mCapabilities( capabilities )
396 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
397 , mWriteMeshFrameOnFileSuffix( ( writeMeshFrameOnFileSuffix ) )
398 , mMaxVerticesPerFace( maxVerticesPerface )
404 return mCapabilities;
419 return mWriteDatasetOnFileSuffix;
424 return mWriteMeshFrameOnFileSuffix;
429 return mMaxVerticesPerFace;
VectorExportResult
Vector layer export result codes.
DataType
Raster data types.
The QgsAbstractProviderConnection provides an interface for data provider connections.
virtual void store(const QString &name) const =0
Stores the connection in the settings.
This class represents a coordinate reference system (CRS).
Abstract base class for spatial data provider implementations.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Container of fields for a vector layer.
Custom exception class which is raised when an operation is not supported.
Custom exception class for provider connection related exceptions.
Base class for raster data providers.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
Type
The WKB type describes the number of dimensions a geometry has.
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
Setting options for creating vector data providers.
Mesh - vertices, edges and faces.