mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
Source select widget: configure from layer URI
This commit is contained in:
parent
153a34e2dc
commit
fa9fc3ee34
@ -55,6 +55,7 @@ of feature and attribute information from a spatial datasource.
|
||||
CreateLabeling,
|
||||
ReloadData,
|
||||
FeatureSymbology,
|
||||
ConfigureSourceSelectFromUri,
|
||||
};
|
||||
|
||||
typedef QFlags<QgsVectorDataProvider::Capability> Capabilities;
|
||||
|
@ -78,6 +78,21 @@ this method on every reopening.
|
||||
This should clear any selection that has previously been done.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
virtual bool configureFromUri( const QString &uri );
|
||||
%Docstring
|
||||
Configure the widget from a layer ``uri`` by selecting the layer path or connection options.
|
||||
The base implementation does nothing and returns ``False``: providers with ConfigureSourceSelectFromUri capability
|
||||
must override to implement this functionality.
|
||||
|
||||
.. note::
|
||||
|
||||
Not all data providers may be able to configure the widget from the provided uri, in that case this method returns ``False``.
|
||||
|
||||
:return: ``True`` on success.
|
||||
|
||||
.. versionadded:: 3.38
|
||||
%End
|
||||
|
||||
signals:
|
||||
|
@ -96,6 +96,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
|
||||
CreateLabeling = 1 << 25, //!< Provider can set labeling settings using backend-specific formatting information. Since QGIS 3.6. See QgsVectorDataProvider::createLabeling().
|
||||
ReloadData = 1 << 26, //!< Provider is able to force reload data
|
||||
FeatureSymbology = 1 << 27, //!< Provider is able retrieve embedded symbology associated with individual features. Since QGIS 3.20.
|
||||
ConfigureSourceSelectFromUri = 1 << 28, //!< Provider is able to configure the source select widget from a layer URI. Since QGIS 3.38.
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS( Capabilities, Capability )
|
||||
|
@ -65,3 +65,9 @@ void QgsAbstractDataSourceWidget::addButtonClicked()
|
||||
void QgsAbstractDataSourceWidget::reset()
|
||||
{
|
||||
}
|
||||
|
||||
bool QgsAbstractDataSourceWidget::configureFromUri( const QString &uri )
|
||||
{
|
||||
Q_UNUSED( uri );
|
||||
return false;
|
||||
}
|
||||
|
@ -96,6 +96,16 @@ class GUI_EXPORT QgsAbstractDataSourceWidget : public QDialog
|
||||
*/
|
||||
virtual void reset();
|
||||
|
||||
/**
|
||||
* Configure the widget from a layer \a uri by selecting the layer path or connection options.
|
||||
* The base implementation does nothing and returns FALSE: providers with ConfigureSourceSelectFromUri capability
|
||||
* must override to implement this functionality.
|
||||
* \note Not all data providers may be able to configure the widget from the provided uri, in that case this method returns FALSE.
|
||||
* \return TRUE on success.
|
||||
* \since 3.38
|
||||
*/
|
||||
virtual bool configureFromUri( const QString &uri );
|
||||
|
||||
signals:
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user