|
QGIS API Documentation 3.99.0-Master (2fe06baccd8)
|
Holds parent-child relations as well as item data contained in a QgsAttributesFormModel. More...
#include <qgsattributesformmodel.h>

Signals | |
| void | addedChildren (QgsAttributesFormItem *item, int indexFrom, int indexTo) |
| Notifies other objects when children have been added to the item, informing the indices where added children are located. | |
Public Member Functions | |
| QgsAttributesFormItem ()=default | |
| QgsAttributesFormItem (QgsAttributesFormData::AttributesFormItemType itemType, const QgsAttributesFormData::AttributeFormItemData &data, const QString &name, const QString &displayName=QString(), QgsAttributesFormItem *parent=nullptr) | |
| Constructor for QgsAttributesFormItem, with the given itemType, the given data and the given name. | |
| QgsAttributesFormItem (QgsAttributesFormData::AttributesFormItemType itemType, const QString &name, const QString &displayName=QString(), QgsAttributesFormItem *parent=nullptr) | |
| Constructor for QgsAttributesFormItem, with the given itemType and the given name. | |
| void | addChild (std::unique_ptr< QgsAttributesFormItem > &&child) |
| Appends a child to this item. | |
| QgsAttributesFormItem * | child (int row) |
| Access the child item located at row position. | |
| int | childCount () const |
| Returns the number of children items for the given item. | |
| QVariant | data (int role) const |
| Returns the data stored in the item, corresponding to the given role. | |
| void | deleteChildAtIndex (int index) |
| Deletes the child of the item placed at the given index. | |
| void | deleteChildren () |
| Deletes all child items from this item. | |
| QString | displayName () const |
| Returns the display name of the item. | |
| QgsAttributesFormItem * | firstChildRecursive (const QgsAttributesFormData::AttributesFormItemType &itemType, const QString &itemId) const |
| Access the first child item that matches itemType and itemId, recursively. | |
| QgsAttributesFormItem * | firstTopChild (const QgsAttributesFormData::AttributesFormItemType itemType, const QString &itemId) const |
| Access the first top-level child item that matches itemType and itemId. | |
| QIcon | icon () const |
| Returns the icon of the item. | |
| QString | id () const |
| Returns the id of the item. | |
| void | insertChild (int position, std::unique_ptr< QgsAttributesFormItem > &&item) |
| Inserts a child item to the item at a given position. | |
| QString | name () const |
| Returns the name of the item. | |
| QgsAttributesFormItem * | parent () |
| Returns the parent object of the item. | |
| int | row () const |
| Returns the position of the item regarding its parent. | |
| bool | setData (int role, const QVariant &value) |
| Stores a data value in a given role inside the item. | |
| void | setIcon (const QIcon &icon) |
| Sets an icon for the item. | |
| QgsAttributesFormData::AttributesFormItemType | type () const |
| Returns the type of the item. | |
Static Public Member Functions | |
| static bool | isGroup (QgsAttributesFormItem *item) |
| Returns whether the item is a group. | |
Holds parent-child relations as well as item data contained in a QgsAttributesFormModel.
Definition at line 378 of file qgsattributesformmodel.h.
|
default |
|
explicit |
Constructor for QgsAttributesFormItem, with the given itemType and the given name.
If displayName is specified then it will be used as the preferred display name for the item. If it is not specified, name will be displayed instead.
If parent is specified, the item will be added as child of the parent item. If it is not specified then it will be set when manually added to another item.
Definition at line 179 of file qgsattributesformmodel.cpp.
|
explicit |
Constructor for QgsAttributesFormItem, with the given itemType, the given data and the given name.
If displayName is specified then it will be used as the preferred display name for the item. If it is not specified, name will be displayed instead.
If parent is specified, the item will be added as child of the parent item. If it is not specified then it will be set when manually added to another item.
Definition at line 186 of file qgsattributesformmodel.cpp.
| void QgsAttributesFormItem::addChild | ( | std::unique_ptr< QgsAttributesFormItem > && | child | ) |
Appends a child to this item.
Takes ownership of the child.
Definition at line 261 of file qgsattributesformmodel.cpp.
|
signal |
Notifies other objects when children have been added to the item, informing the indices where added children are located.
| QgsAttributesFormItem * QgsAttributesFormItem::child | ( | int | row | ) |
Access the child item located at row position.
If there is no child item for the given row position, a nullptr is returned.
Definition at line 194 of file qgsattributesformmodel.cpp.
| int QgsAttributesFormItem::childCount | ( | ) | const |
Returns the number of children items for the given item.
Definition at line 239 of file qgsattributesformmodel.cpp.
| QVariant QgsAttributesFormItem::data | ( | int | role | ) | const |
Returns the data stored in the item, corresponding to the given role.
Definition at line 309 of file qgsattributesformmodel.cpp.
| void QgsAttributesFormItem::deleteChildAtIndex | ( | int | index | ) |
Deletes the child of the item placed at the given index.
Definition at line 293 of file qgsattributesformmodel.cpp.
| void QgsAttributesFormItem::deleteChildren | ( | ) |
Deletes all child items from this item.
Definition at line 299 of file qgsattributesformmodel.cpp.
|
inline |
Returns the display name of the item.
Definition at line 495 of file qgsattributesformmodel.h.
| QgsAttributesFormItem * QgsAttributesFormItem::firstChildRecursive | ( | const QgsAttributesFormData::AttributesFormItemType & | itemType, |
| const QString & | itemId ) const |
Access the first child item that matches itemType and itemId, recursively.
If there is no matching child item in the whole item hierarchy, a nullptr is returned.
Definition at line 218 of file qgsattributesformmodel.cpp.
| QgsAttributesFormItem * QgsAttributesFormItem::firstTopChild | ( | const QgsAttributesFormData::AttributesFormItemType | itemType, |
| const QString & | itemId ) const |
Access the first top-level child item that matches itemType and itemId.
If there is no top-level matching child item, a nullptr is returned.
Definition at line 202 of file qgsattributesformmodel.cpp.
|
inline |
Returns the icon of the item.
Definition at line 502 of file qgsattributesformmodel.h.
|
inline |
Returns the id of the item.
Definition at line 485 of file qgsattributesformmodel.h.
| void QgsAttributesFormItem::insertChild | ( | int | position, |
| std::unique_ptr< QgsAttributesFormItem > && | item ) |
Inserts a child item to the item at a given position.
Takes ownership of the child item.
Definition at line 277 of file qgsattributesformmodel.cpp.
|
static |
Returns whether the item is a group.
That is, a container or a widget type (e.g., Fields, Relations, Actions, etc.) item.
Definition at line 304 of file qgsattributesformmodel.cpp.
|
inline |
Returns the name of the item.
Definition at line 490 of file qgsattributesformmodel.h.
|
inline |
Returns the parent object of the item.
If item is a top-level item, its parent is the root object and a nullptr is returned.
Definition at line 440 of file qgsattributesformmodel.h.
| int QgsAttributesFormItem::row | ( | ) | const |
Returns the position of the item regarding its parent.
Definition at line 244 of file qgsattributesformmodel.cpp.
| bool QgsAttributesFormItem::setData | ( | int | role, |
| const QVariant & | value ) |
Stores a data value in a given role inside the item.
Definition at line 330 of file qgsattributesformmodel.cpp.
|
inline |
|
inline |
Returns the type of the item.
Definition at line 480 of file qgsattributesformmodel.h.