26 QString
const &description,
27 QString
const &library )
29 , mDescription( description )
35 , mDescription( description )
36 , mCreateFunction( createFunc )
41 qDeleteAll( mProviderConnections );
56 return QgsProviderMetadata::ProviderMetadataCapabilities();
61 return QgsProviderMetadata::ProviderCapabilities();
71 return mCreateFunction;
91 return QList<QgsMeshDriverMetadata>();
101 return QList<QgsMapLayerType>();
111 QgsDataProvider::ReadFlags flags )
113 if ( mCreateFunction )
115 return mCreateFunction( uri, options, flags );
122 if ( value.toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
123 value.toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
124 value.toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
126 uri[ parameter ] =
true;
128 else if ( value.toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
129 value.toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
130 value.toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
132 uri[ parameter ] =
false;
138 if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
139 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
140 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
144 else if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
145 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
146 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
156 return QVariantMap();
167 bool, QMap<int, int> &,
168 QString &errorMessage,
const QMap<QString, QVariant> * )
170 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createEmptyLayer" ) );
171 return QgsVectorLayerExporter::ExportError::ErrProviderUnsupportedFeature;
175 const QString &,
const QString &,
179 const QStringList & )
195 return QList<QPair<QString, QString> >();
200 return QList<QgsDataItemProvider *>();
204 QStringList &, QString &errCause )
206 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
212 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
218 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
223 const QString &,
const QString &,
bool, QString &errCause )
225 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
231 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
237 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
254 return connections<QgsAbstractDatabaseProviderConnection>( cached ) ;
259 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
260 const QStringList constKeys { constConns.keys( ) };
261 for (
const QString &
key : constKeys )
265 return constConns.value(
key );
280 Q_UNUSED( configuration );
293 Q_UNUSED( connection )
301 const bool isNewConnection = !
connections().contains( name );
303 mProviderConnections.clear();
305 if ( !isNewConnection )
315 QMap<QString, T *> result;
317 const QStringList constConnKeys { constConns.keys() };
318 for (
const auto &
c : constConnKeys )
320 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
323 result.insert(
c, casted );
332 : mName( name ), mDescription( description ), mCapabilities( capabilities ), mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
338 return mCapabilities;
353 return mWriteDatasetOnFileSuffix;
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.
Container of fields for a vector layer.
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.