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
parent
item.The
path
argument gives the item path in the browser tree. Thepath
string can take any form, butQgsDataItem
items pointing to different logical locations should always use a different itempath
. TheconnectionUri
argument is the connection part of the layer URI that it is used internally to create a connection and retrieve fields information. TheproviderKey
string can be used to specify the key for theQgsDataItemProvider
that created this item. Theschema
andtableName
are 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
True
if 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]