QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
25 QString
const &description,
26 QString
const &library )
28 , mDescription( description )
34 , mDescription( description )
35 , mCreateFunction( createFunc )
40 qDeleteAll( mProviderConnections );
60 return mCreateFunction;
80 return QList<QgsMeshDriverMetadata>();
85 if ( mCreateFunction )
87 return mCreateFunction( uri, options );
94 if ( value.toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
95 value.toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
96 value.toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
98 uri[ parameter ] =
true;
100 else if ( value.toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
101 value.toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
102 value.toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
104 uri[ parameter ] =
false;
110 if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
111 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
112 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
116 else if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
117 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
118 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
128 return QVariantMap();
139 bool, QMap<int, int> &,
140 QString &errorMessage,
const QMap<QString, QVariant> * )
142 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createEmptyLayer" ) );
143 return QgsVectorLayerExporter::ExportError::ErrProviderUnsupportedFeature;
147 const QString &,
const QString &,
151 const QStringList & )
158 return QList<QPair<QString, QString> >();
163 return QList<QgsDataItemProvider *>();
167 QStringList &, QString &errCause )
169 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
175 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
181 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
186 const QString &,
const QString &,
bool, QString &errCause )
188 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
194 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
200 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
217 return connections<QgsAbstractDatabaseProviderConnection>( cached ) ;
222 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
223 const QStringList constKeys { constConns.keys( ) };
224 for (
const QString &
key : constKeys )
228 return constConns.value(
key );
243 Q_UNUSED( configuration );
256 Q_UNUSED( connection )
264 const bool isNewConnection = !
connections().contains( name );
266 mProviderConnections.clear();
268 if ( !isNewConnection )
278 QMap<QString, T *> result;
280 const QStringList constConnKeys { constConns.keys() };
281 for (
const auto &
c : constConnKeys )
283 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
286 result.insert(
c, casted );
295 : mName( name ), mDescription( description ), mCapabilities( capabilities )
301 return mCapabilities;
DataType
Raster data types.
Setting options for creating vector data providers.
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
The QgsAbstractProviderConnection provides an interface for data provider connections.
virtual void store(const QString &name) const =0
Stores the connection in the settings.