25 QString
const &description,
26 QString
const &library )
28 , mDescription( description )
34 , mDescription( description )
35 , mCreateFunction( createFunc )
40 qDeleteAll( mProviderConnections );
60 return mCreateFunction;
80 if ( mCreateFunction )
82 return mCreateFunction( uri, options );
95 bool, QMap<int, int> &,
96 QString &errorMessage,
const QMap<QString, QVariant> * )
98 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createEmptyLayer" ) );
99 return QgsVectorLayerExporter::ExportError::ErrProviderUnsupportedFeature;
103 const QString &,
const QString &,
107 const QStringList & )
114 return QList<QPair<QString, QString> >();
119 return QList<QgsDataItemProvider *>();
123 QStringList &, QString &errCause )
125 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
131 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
137 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
142 const QString &,
const QString &,
bool, QString &errCause )
144 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
150 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
156 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
173 return connections<QgsAbstractDatabaseProviderConnection>( cached ) ;
178 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
179 const QStringList constKeys { constConns.keys( ) };
180 for (
const QString &
key : constKeys )
184 return constConns.value(
key );
199 Q_UNUSED( configuration );
212 Q_UNUSED( connection );
221 mProviderConnections.clear();
228 QMap<QString, T *> result;
230 const QStringList constConnKeys { constConns.keys() };
231 for (
const auto &
c : constConnKeys )
233 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
236 result.insert(
c, casted );
virtual void store(const QString &name) const =0
Stores the connection in the settings.
DataType
Raster data types.
Container of fields for a vector layer.
Abstract base class for spatial data provider implementations.
The QgsAbstractProviderConnection provides an interface for data provider connections.
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
Type
The WKB type describes the number of dimensions a geometry has.
Setting options for creating vector data providers.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
This class represents a coordinate reference system (CRS).
Custom exception class for provider connection related exceptions.
Base class for raster data providers.