Skip to content
Permalink
Browse files
Add uri to QgsProviderSublayerDetails
  • Loading branch information
nyalldawson committed Jun 23, 2021
1 parent 55e20eb commit 07f5812383ba4d71633f69440c08f294cbaefc5f
@@ -59,6 +59,20 @@ Returns the layer type.
Sets the layer ``type``.

.. seealso:: :py:func:`type`
%End

QString uri() const;
%Docstring
Returns the layer's URI.

.. seealso:: :py:func:`setUri`
%End

void setUri( const QString &uri );
%Docstring
Sets the layer's ``uri``.

.. seealso:: :py:func:`uri`
%End

QString name() const;
@@ -72,6 +72,20 @@ class CORE_EXPORT QgsProviderSublayerDetails
*/
void setType( QgsMapLayerType type ) { mType = type; }

/**
* Returns the layer's URI.
*
* \see setUri()
*/
QString uri() const { return mUri; }

/**
* Sets the layer's \a uri.
*
* \see uri()
*/
void setUri( const QString &uri ) { mUri = uri; }

/**
* Returns the layer's name.
*
@@ -196,6 +210,7 @@ class CORE_EXPORT QgsProviderSublayerDetails

QString mProviderKey;
QgsMapLayerType mType = QgsMapLayerType::VectorLayer;
QString mUri;
int mLayerNumber = 0;
QString mName;
QString mDescription;
@@ -39,6 +39,9 @@ def testGettersSetters(self):
d.setType(QgsMapLayerType.MeshLayer)
self.assertEqual(d.type(), QgsMapLayerType.MeshLayer)

d.setUri('some uri')
self.assertEqual(d.uri(), 'some uri')

d.setName('name')
self.assertEqual(d.name(), 'name')

0 comments on commit 07f5812

Please sign in to comment.