17#ifndef QGSFIELDSITEM_H
18#define QGSFIELDSITEM_H
28using namespace Qt::StringLiterals;
65 SIP_PYOBJECT __repr__();
67 QString str = u
"<QgsFieldsItem: %1>"_s.arg( sipCpp->path() );
68 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
74 QIcon
icon()
override;
122 QString mConnectionUri;
123 bool mCanRename =
false;
124 std::unique_ptr<QgsAbstractDatabaseProviderConnection::TableProperty> mTableProperty;
152 SIP_PYOBJECT __repr__();
154 QString str = u
"<QgsFieldItem: %1>"_s.arg( sipCpp->name() );
155 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
159 QIcon
icon()
override;
Base class for all items in the model.
QgsDataItem(Qgis::BrowserItemType type, QgsDataItem *parent, const QString &name, const QString &path, const QString &providerKey=QString())
Constructor for QgsDataItem, with the specified parent item.
virtual QVector< QgsDataItem * > createChildren()
Create children.
QgsDataItem * parent() const
Gets item parent.
QString providerKey() const
Returns the provider key that created this item (e.g.
virtual bool equal(const QgsDataItem *other)
Returns true if this item is equal to another item (by testing item type and path).
QgsFieldItem(QgsDataItem *parent, const QgsField &field)
Constructor for QgsFieldItem, with the specified parent item and field.
QgsField field() const
Returns the field definition.
Encapsulate a field in an attribute table or data source.
QString tableName() const
Returns the table name.
QgsFieldsItem(QgsDataItem *parent, const QString &path, const QString &connectionUri, const QString &providerKey, const QString &schema, const QString &tableName)
Constructor for QgsFieldsItem, with the specified parent item.
QgsAbstractDatabaseProviderConnection::TableProperty * tableProperty() const
Returns the (possibly nullptr) properties of the table this fields belong to.
QString connectionUri() const
Returns the connection URI.
QgsVectorLayer * layer()
Creates and returns a (possibly nullptr) layer from the connection URI and schema/table information.
bool canRenameFields() const
Returns true if the connection supports renaming fields.
QgsFields fields() const
Returns the fields contained by the item.
QString schema() const
Returns the schema name.
Container of fields for a vector layer.
Represents a vector layer which manages a vector based dataset.
The TableProperty class represents a database table or view.