Class: QgsFieldsItem¶
A browser item which contains a collection of field items.
QgsFieldsItem contains internal logic to retrieve the fields
and the corresponding vector layer instance from a connection URI, the
schema and the table name.
Added in version 3.16.
Class Hierarchy¶
Base classes¶
Base class for all items in the model. |
|
Methods
Returns |
|
Returns the connection URI |
|
Creates and returns a (possibly |
|
Returns the schema name |
|
Returns the table name |
|
Returns the (possibly |
- class qgis.core.QgsFieldsItem[source]¶
Bases:
QgsDataItem- __init__(parent: QgsDataItem | None, path: str | None, connectionUri: str | None, providerKey: str | None, schema: str | None, tableName: str | None)
Constructor for QgsFieldsItem, with the specified
parentitem.The
pathargument gives the item path in the browser tree. Thepathstring can take any form, butQgsDataItemitems pointing to different logical locations should always use a different itempath. TheconnectionUriargument is the connection part of the layer URI that it is used internally to create a connection and retrieve fields information. TheproviderKeystring can be used to specify the key for theQgsDataItemProviderthat created this item. TheschemaandtableNameare used to retrieve the layer and field information from theconnectionUri.- Parameters:
parent (Optional[QgsDataItem])
path (Optional[str])
connectionUri (Optional[str])
providerKey (Optional[str])
schema (Optional[str])
tableName (Optional[str])
- canRenameFields(self) bool[source]¶
Returns
Trueif the connection supports renaming fields.Added in version 3.28.
- Return type:
bool
- layer(self) QgsVectorLayer | None[source]¶
Creates and returns a (possibly
None) layer from the connection URI and schema/table information- Return type:
Optional[QgsVectorLayer]
- tableProperty(self) QgsAbstractDatabaseProviderConnection.TableProperty | None[source]¶
Returns the (possibly
None) properties of the table this fields belong to.Added in version 3.16.
- Return type:
Optional[QgsAbstractDatabaseProviderConnection.TableProperty]