mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Further updates from review
This commit is contained in:
parent
aead182b21
commit
d155b1c877
@ -138,17 +138,29 @@ Returns pyramid resampling methods available for provider
|
||||
|
||||
virtual QVariantMap decodeUri( const QString &uri );
|
||||
%Docstring
|
||||
Decodes URI
|
||||
Breaks a provider data source URI into its component paths (e.g. file path, layer name).
|
||||
|
||||
:param uri: uri string
|
||||
|
||||
:return: map containing components. Standard components include "path", "layerName", "url".
|
||||
|
||||
.. note::
|
||||
|
||||
this function may not be supported by all providers, an empty map will be returned in such case
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
virtual QList< QgsDataItemProvider * > dataItemProviders() const;
|
||||
virtual QList< QgsDataItemProvider * > dataItemProviders() const /Factory/;
|
||||
%Docstring
|
||||
Returns data item providers. Caller is responsible for ownership of the item providers
|
||||
|
||||
.. seealso:: :py:func:`QgsProviderGuiMetadata.dataItemGuiProviders`
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created data item providers is passed to the caller.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
|
@ -152,10 +152,14 @@ responsible for deleting the returned widget.
|
||||
.. deprecated:: QGIS 3.10 - use QgsGui.providerGuiRegistry()->createDataSourceWidget() instead
|
||||
%End
|
||||
|
||||
QList< QgsDataItemProvider * > dataItemProviders( const QString &providerKey ) const;
|
||||
QList< QgsDataItemProvider * > dataItemProviders( const QString &providerKey ) const /Factory/;
|
||||
%Docstring
|
||||
Returns list of data item providers of the provider
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created data item providers is passed to the caller.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
|
@ -31,24 +31,37 @@ Constructor for provider gui metadata
|
||||
|
||||
virtual ~QgsProviderGuiMetadata();
|
||||
|
||||
virtual QList<QgsDataItemGuiProvider *> dataItemGuiProviders();
|
||||
%Docstring
|
||||
Returns data item gui providers
|
||||
%End
|
||||
|
||||
virtual void registerGui( QMainWindow *widget );
|
||||
%Docstring
|
||||
Assigns parent to widget
|
||||
Called during GUI initialization - allows provider to do its internal initialization
|
||||
of GUI components, possibly making use of the passed pointer to the QGIS main window.
|
||||
%End
|
||||
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders();
|
||||
virtual QList<QgsDataItemGuiProvider *> dataItemGuiProviders() /Factory/;
|
||||
%Docstring
|
||||
Returns data item gui providers
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created data item gui providers is passed to the caller.
|
||||
%End
|
||||
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders() /Factory/;
|
||||
%Docstring
|
||||
Returns project storage gui providers
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created project storage gui providers is passed to the caller.
|
||||
%End
|
||||
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders();
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders() /Factory/;
|
||||
%Docstring
|
||||
Returns source select providers
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created source select providers is passed to the caller.
|
||||
%End
|
||||
|
||||
QString key() const;
|
||||
|
@ -21,7 +21,7 @@ QgsProviderGuiRegistry is not usually directly created, but rather accessed thro
|
||||
:py:func:`QgsGui.providerGuiRegistry()`
|
||||
|
||||
setPluginPath() should be called (once) to load dynamic providers. Static providers are
|
||||
loaded in constructopr
|
||||
loaded in constructor.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
@ -50,25 +50,35 @@ Returns metadata of the provider or ``None`` if not found
|
||||
|
||||
void registerGuis( QMainWindow *widget );
|
||||
%Docstring
|
||||
Calls registerGui function of all providers
|
||||
Called during GUI initialization - allows providers to do its internal initialization
|
||||
of GUI components, possibly making use of the passed pointer to the QGIS main window.
|
||||
%End
|
||||
|
||||
virtual const QList<QgsDataItemGuiProvider *> dataItemGuiProviders( const QString &providerKey );
|
||||
virtual const QList<QgsDataItemGuiProvider *> dataItemGuiProviders( const QString &providerKey ) /Factory/;
|
||||
%Docstring
|
||||
Returns all data item gui providers registered in provider with ``providerKey``
|
||||
Caller receiver ownership of created data item providers
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created data item providers is passed to the caller.
|
||||
%End
|
||||
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders( const QString &providerKey );
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders( const QString &providerKey ) /Factory/;
|
||||
%Docstring
|
||||
Returns all source select providers registered in provider with ``providerKey``
|
||||
Caller receiver ownership of created data item providers
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created source select providers is passed to the caller.
|
||||
%End
|
||||
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders( const QString &providerKey );
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders( const QString &providerKey ) /Factory/;
|
||||
%Docstring
|
||||
Returns all project storage gui providers registered in provider with ``providerKey``
|
||||
Caller receiver ownership of created data item providers
|
||||
|
||||
.. note::
|
||||
|
||||
Ownership of created project storage gui providers is passed to the caller.
|
||||
%End
|
||||
|
||||
|
||||
|
@ -3015,17 +3015,18 @@ bool QgsGdalProvider::remove()
|
||||
*/
|
||||
QString QgsGdalProviderMetadata::filters( FilterType type )
|
||||
{
|
||||
if ( type == QgsProviderMetadata::FilterType::FilterRaster )
|
||||
switch ( type )
|
||||
{
|
||||
QString fileFiltersString;
|
||||
QStringList exts;
|
||||
QStringList wildcards;
|
||||
buildSupportedRasterFileFilterAndExtensions( fileFiltersString, exts, wildcards );
|
||||
return fileFiltersString;
|
||||
}
|
||||
else
|
||||
{
|
||||
return QString();
|
||||
case QgsProviderMetadata::FilterType::FilterRaster:
|
||||
{
|
||||
QString fileFiltersString;
|
||||
QStringList exts;
|
||||
QStringList wildcards;
|
||||
buildSupportedRasterFileFilterAndExtensions( fileFiltersString, exts, wildcards );
|
||||
return fileFiltersString;
|
||||
}
|
||||
default:
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3190,7 +3191,7 @@ GDALRasterBandH QgsGdalProvider::getBand( int bandNo ) const
|
||||
// see ticket #284
|
||||
QList<QPair<QString, QString> > QgsGdalProviderMetadata::pyramidResamplingMethods()
|
||||
{
|
||||
QList<QPair<QString, QString> > methods;
|
||||
static QList<QPair<QString, QString> > methods;
|
||||
|
||||
if ( methods.isEmpty() )
|
||||
{
|
||||
|
@ -6608,13 +6608,12 @@ QgsOgrProviderMetadata::QgsOgrProviderMetadata()
|
||||
|
||||
QString QgsOgrProviderMetadata::filters( FilterType type )
|
||||
{
|
||||
if ( type == QgsProviderMetadata::FilterType::FilterVector )
|
||||
switch ( type )
|
||||
{
|
||||
return QgsOgrProviderUtils::fileVectorFilters();
|
||||
}
|
||||
else
|
||||
{
|
||||
return QString();
|
||||
case QgsProviderMetadata::FilterType::FilterVector:
|
||||
return QgsOgrProviderUtils::fileVectorFilters();
|
||||
default:
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,10 @@ class CORE_EXPORT QgsProviderMetadata
|
||||
virtual QList<QPair<QString, QString> > pyramidResamplingMethods();
|
||||
|
||||
/**
|
||||
* Decodes URI
|
||||
* Breaks a provider data source URI into its component paths (e.g. file path, layer name).
|
||||
* \param uri uri string
|
||||
* \returns map containing components. Standard components include "path", "layerName", "url".
|
||||
* \note this function may not be supported by all providers, an empty map will be returned in such case
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
virtual QVariantMap decodeUri( const QString &uri );
|
||||
@ -195,9 +198,10 @@ class CORE_EXPORT QgsProviderMetadata
|
||||
/**
|
||||
* Returns data item providers. Caller is responsible for ownership of the item providers
|
||||
* \see QgsProviderGuiMetadata::dataItemGuiProviders()
|
||||
* \note Ownership of created data item providers is passed to the caller.
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
virtual QList< QgsDataItemProvider * > dataItemProviders() const;
|
||||
virtual QList< QgsDataItemProvider * > dataItemProviders() const SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Lists stored layer styles in the provider defined by \a uri
|
||||
|
@ -181,10 +181,11 @@ class CORE_EXPORT QgsProviderRegistry
|
||||
Q_DECL_DEPRECATED QWidget *createSelectionWidget( const QString &providerKey, QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags(), QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None ) SIP_DEPRECATED;
|
||||
|
||||
/**
|
||||
* Returns list of data item providers of the provider
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
QList< QgsDataItemProvider * > dataItemProviders( const QString &providerKey ) const;
|
||||
* Returns list of data item providers of the provider
|
||||
* \note Ownership of created data item providers is passed to the caller.
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
QList< QgsDataItemProvider * > dataItemProviders( const QString &providerKey ) const SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Lists stored layer styles in the provider defined by \a providerKey and \a uri
|
||||
|
@ -45,17 +45,29 @@ class GUI_EXPORT QgsProviderGuiMetadata
|
||||
|
||||
virtual ~QgsProviderGuiMetadata();
|
||||
|
||||
//! Returns data item gui providers
|
||||
virtual QList<QgsDataItemGuiProvider *> dataItemGuiProviders();
|
||||
|
||||
//! Assigns parent to widget
|
||||
/**
|
||||
* Called during GUI initialization - allows provider to do its internal initialization
|
||||
* of GUI components, possibly making use of the passed pointer to the QGIS main window.
|
||||
*/
|
||||
virtual void registerGui( QMainWindow *widget );
|
||||
|
||||
//! Returns project storage gui providers
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders();
|
||||
/**
|
||||
* Returns data item gui providers
|
||||
* \note Ownership of created data item gui providers is passed to the caller.
|
||||
*/
|
||||
virtual QList<QgsDataItemGuiProvider *> dataItemGuiProviders() SIP_FACTORY;
|
||||
|
||||
//! Returns source select providers
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders();
|
||||
/**
|
||||
* Returns project storage gui providers
|
||||
* \note Ownership of created project storage gui providers is passed to the caller.
|
||||
*/
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders() SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Returns source select providers
|
||||
* \note Ownership of created source select providers is passed to the caller.
|
||||
*/
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders() SIP_FACTORY;
|
||||
|
||||
//! Returns unique provider key
|
||||
QString key() const;
|
||||
|
@ -42,7 +42,7 @@ class QgsProjectStorageGuiProvider;
|
||||
* QgsGui::providerGuiRegistry().
|
||||
*
|
||||
* setPluginPath() should be called (once) to load dynamic providers. Static providers are
|
||||
* loaded in constructopr
|
||||
* loaded in constructor.
|
||||
*
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
@ -62,26 +62,29 @@ class GUI_EXPORT QgsProviderGuiRegistry
|
||||
//! Returns metadata of the provider or NULLPTR if not found
|
||||
const QgsProviderGuiMetadata *providerMetadata( const QString &providerKey ) const;
|
||||
|
||||
//! Calls registerGui function of all providers
|
||||
/**
|
||||
* Called during GUI initialization - allows providers to do its internal initialization
|
||||
* of GUI components, possibly making use of the passed pointer to the QGIS main window.
|
||||
*/
|
||||
void registerGuis( QMainWindow *widget );
|
||||
|
||||
/**
|
||||
* Returns all data item gui providers registered in provider with \a providerKey
|
||||
* Caller receiver ownership of created data item providers
|
||||
* \note Ownership of created data item providers is passed to the caller.
|
||||
*/
|
||||
virtual const QList<QgsDataItemGuiProvider *> dataItemGuiProviders( const QString &providerKey );
|
||||
virtual const QList<QgsDataItemGuiProvider *> dataItemGuiProviders( const QString &providerKey ) SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Returns all source select providers registered in provider with \a providerKey
|
||||
* Caller receiver ownership of created data item providers
|
||||
* \note Ownership of created source select providers is passed to the caller.
|
||||
*/
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders( const QString &providerKey );
|
||||
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders( const QString &providerKey ) SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Returns all project storage gui providers registered in provider with \a providerKey
|
||||
* Caller receiver ownership of created data item providers
|
||||
* \note Ownership of created project storage gui providers is passed to the caller.
|
||||
*/
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders( const QString &providerKey );
|
||||
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders( const QString &providerKey ) SIP_FACTORY;
|
||||
|
||||
//! Type for data provider metadata associative container
|
||||
SIP_SKIP typedef std::map<QString, QgsProviderGuiMetadata *> GuiProviders;
|
||||
|
@ -587,22 +587,25 @@ QList<QgsSourceSelectProvider *> QgsMdalProviderGuiMetadata::sourceSelectProvide
|
||||
|
||||
QString QgsMdalProviderMetadata::filters( FilterType type )
|
||||
{
|
||||
if ( type == QgsProviderMetadata::FilterType::FilterMesh )
|
||||
switch ( type )
|
||||
{
|
||||
QString fileMeshFiltersString;
|
||||
QString fileMeshDatasetFiltersString;
|
||||
QgsMdalProvider::fileMeshFilters( fileMeshFiltersString, fileMeshDatasetFiltersString );
|
||||
return fileMeshFiltersString;
|
||||
case QgsProviderMetadata::FilterType::FilterMesh:
|
||||
{
|
||||
QString fileMeshFiltersString;
|
||||
QString fileMeshDatasetFiltersString;
|
||||
QgsMdalProvider::fileMeshFilters( fileMeshFiltersString, fileMeshDatasetFiltersString );
|
||||
return fileMeshFiltersString;
|
||||
}
|
||||
case QgsProviderMetadata::FilterType::FilterMeshDataset:
|
||||
{
|
||||
QString fileMeshFiltersString;
|
||||
QString fileMeshDatasetFiltersString;
|
||||
QgsMdalProvider::fileMeshFilters( fileMeshFiltersString, fileMeshDatasetFiltersString );
|
||||
return fileMeshDatasetFiltersString;
|
||||
}
|
||||
default:
|
||||
return QString();
|
||||
}
|
||||
else if ( type == QgsProviderMetadata::FilterType::FilterMeshDataset )
|
||||
{
|
||||
QString fileMeshFiltersString;
|
||||
QString fileMeshDatasetFiltersString;
|
||||
QgsMdalProvider::fileMeshFilters( fileMeshFiltersString, fileMeshDatasetFiltersString );
|
||||
return fileMeshDatasetFiltersString;
|
||||
}
|
||||
else
|
||||
return QString();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user