Class: QgsRelationshipsItem

Contains a collection of relationship items.

Added in version 3.28.

Class Hierarchy

Inheritance diagram of qgis.core.QgsRelationshipsItem

Base classes

QgsDataItem

Base class for all items in the model.

QObject

Methods

connectionUri

Returns the connection URI

schema

Returns the schema for filtering relationships, if set.

tableName

Returns the table name for filtering relationships, if set.

class qgis.core.QgsRelationshipsItem[source]

Bases: QgsDataItem

__init__(parent: QgsDataItem | None, path: str | None, connectionUri: str | None, providerKey: str | None, schema: str | None = '', tableName: str | None = '')

Constructor for QgsRelationshipsItem, with the specified parent item.

The path argument gives the item path in the browser tree. The path string can take any form, but QgsDataItem items pointing to different logical locations should always use a different item path. The connectionUri argument is the connection part of the layer URI that it is used internally to create a connection and retrieve fields information. The providerKey string can be used to specify the key for the QgsDataItemProvider that created this item.

The optional schema and tableName arguments can be used to restrict the visible relationships to those with a matching parent table.

Parameters:
  • parent (Optional[QgsDataItem])

  • path (Optional[str])

  • connectionUri (Optional[str])

  • providerKey (Optional[str])

  • schema (Optional[str] = '')

  • tableName (Optional[str] = '')

connectionUri(self) str[source]

Returns the connection URI

Return type:

str

schema(self) str[source]

Returns the schema for filtering relationships, if set.

See also

tableName()

Return type:

str

tableName(self) str[source]

Returns the table name for filtering relationships, if set.

See also

schema()

Return type:

str