27 QString
const &description,
28 QString
const &library )
30 , mDescription( description )
36 , mDescription( description )
37 , mCreateFunction( createFunc )
42 qDeleteAll( mProviderConnections );
57 return QgsProviderMetadata::ProviderMetadataCapabilities();
62 return QgsProviderMetadata::ProviderCapabilities();
72 return mCreateFunction;
92 return QList<QgsMeshDriverMetadata>();
102 return QList<QgsMapLayerType>();
112 return QStringList();
117 return QList<QgsProviderSublayerDetails>();
122 QgsDataProvider::ReadFlags flags )
124 if ( mCreateFunction )
126 return mCreateFunction( uri, options, flags );
133 if ( value.toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
134 value.toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
135 value.toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
137 uri[ parameter ] =
true;
139 else if ( value.toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
140 value.toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
141 value.toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
143 uri[ parameter ] =
false;
149 if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
150 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
151 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
155 else if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
156 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
157 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
167 return QVariantMap();
178 bool, QMap<int, int> &,
179 QString &errorMessage,
const QMap<QString, QVariant> * )
181 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createEmptyLayer" ) );
182 return Qgis::VectorExportResult::ErrorProviderUnsupportedFeature;
186 const QString &,
const QString &,
190 const QStringList & )
212 return QList<QPair<QString, QString> >();
217 return QList<QgsDataItemProvider *>();
221 QStringList &, QString &errCause )
223 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
235 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
241 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
246 const QString &,
const QString &,
bool, QString &errCause )
248 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
254 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
265 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
282 return connections<QgsAbstractDatabaseProviderConnection>( cached ) ;
287 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
288 const QStringList constKeys { constConns.keys( ) };
289 for (
const QString &
key : constKeys )
293 return constConns.value(
key );
308 Q_UNUSED( configuration );
321 Q_UNUSED( connection )
329 const bool isNewConnection = !
connections().contains( name );
331 mProviderConnections.clear();
333 if ( !isNewConnection )
343 QMap<QString, T *> result;
345 const QStringList constConnKeys { constConns.keys() };
346 for (
const auto &
c : constConnKeys )
348 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
351 result.insert(
c, casted );
360 const QString &description,
361 const MeshDriverCapabilities &capabilities,
362 const QString &writeDatasetOnfileSuffix )
364 , mDescription( description )
365 , mCapabilities( capabilities )
366 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
371 const QString &description,
372 const MeshDriverCapabilities &capabilities,
373 const QString &writeDatasetOnfileSuffix,
374 const QString &writeMeshFrameOnFileSuffix,
375 int maxVerticesPerface )
377 , mDescription( description )
378 , mCapabilities( capabilities )
379 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
380 , mWriteMeshFrameOnFileSuffix( ( writeMeshFrameOnFileSuffix ) )
381 , mMaxVerticesPerFace( maxVerticesPerface )
387 return mCapabilities;
402 return mWriteDatasetOnFileSuffix;
407 return mWriteMeshFrameOnFileSuffix;
412 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.