QGIS API Documentation 3.43.0-Master (56aa1fd18d7)
|
Manages available widgets when configuring attributes forms. More...
#include <qgsattributesformmodel.h>
Public Slots | |
void | populate () override |
void | populateLayerActions (const QList< QgsAction > actions) |
Refresh layer actions in the model to keep an updated action list. | |
![]() | |
virtual void | populate ()=0 |
Populates the model with initial data read from the layer. | |
Public Member Functions | |
QgsAttributesAvailableWidgetsModel (QgsVectorLayer *layer, QgsProject *project, QObject *parent=nullptr) | |
Constructor for QgsAttributesAvailableWidgetsModel, with the given parent. | |
QModelIndex | actionContainer () const |
Returns the action container in this model, expected to be placed at the third top-level row. | |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
QModelIndex | fieldContainer () const |
Returns the field container in this model, expected to be placed at the first top-level row. | |
QModelIndex | fieldModelIndex (const QString &fieldName) const |
Returns the model index that corresponds to the field with the given fieldName. | |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
QStringList | mimeTypes () const override |
QModelIndex | relationContainer () const |
Returns the relation container in this model, expected to be placed at the second top-level row. | |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
Qt::DropActions | supportedDragActions () const override |
![]() | |
QgsAttributesFormModel (QgsVectorLayer *layer, QgsProject *project, QObject *parent=nullptr) | |
Constructor for QgsAttributesFormModel, with the given parent. | |
~QgsAttributesFormModel () override | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | firstRecursiveMatchingModelIndex (const QgsAttributesFormData::AttributesFormItemType &itemType, const QString &itemId) const |
Returns the first model index that matches the given itemType and itemId, recursively. | |
QModelIndex | firstTopMatchingModelIndex (const QgsAttributesFormData::AttributesFormItemType &itemType, const QString &itemId) const |
Returns the first top-level model index that matches the given itemType and itemId. | |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | parent (const QModelIndex &index) const override |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
void | setShowAliases (bool show) |
Sets whether field aliases should be preferred over field names as item text. | |
bool | showAliases () const |
Returns whether field aliases are preferred over field names as item text. | |
Additional Inherited Members | |
![]() | |
enum | ItemRoles { ItemDataRole = Qt::UserRole , ItemFieldConfigRole , ItemNameRole , ItemIdRole , ItemTypeRole , ItemDisplayRole } |
Custom model roles. More... | |
![]() | |
bool | indexLessThan (const QModelIndex &a, const QModelIndex &b) const |
Auxiliary function to sort indexes, returning true if index a is less than index b. | |
QgsAttributesFormItem * | itemForIndex (const QModelIndex &index) const |
Returns the underlying item that corresponds to the given index. | |
QVector< int > | rootToLeafPath (QgsAttributesFormItem *item) const |
Returns a QVector of iterative positions from root item to the given item. | |
![]() | |
QgsVectorLayer * | mLayer |
QgsProject * | mProject |
std::unique_ptr< QgsAttributesFormItem > | mRootItem |
bool | mShowAliases = false |
Manages available widgets when configuring attributes forms.
Definition at line 644 of file qgsattributesformmodel.h.
|
explicit |
Constructor for QgsAttributesAvailableWidgetsModel, with the given parent.
The given layer and project are the data sources to populate the model.
Definition at line 464 of file qgsattributesformmodel.cpp.
QModelIndex QgsAttributesAvailableWidgetsModel::actionContainer | ( | ) | const |
Returns the action container in this model, expected to be placed at the third top-level row.
If there is no action container set, an invalid index is returned.
Definition at line 830 of file qgsattributesformmodel.cpp.
|
override |
Definition at line 640 of file qgsattributesformmodel.cpp.
QModelIndex QgsAttributesAvailableWidgetsModel::fieldContainer | ( | ) | const |
Returns the field container in this model, expected to be placed at the first top-level row.
If there is no field container set, an invalid index is returned.
Definition at line 806 of file qgsattributesformmodel.cpp.
QModelIndex QgsAttributesAvailableWidgetsModel::fieldModelIndex | ( | const QString & | fieldName | ) | const |
Returns the model index that corresponds to the field with the given fieldName.
Definition at line 842 of file qgsattributesformmodel.cpp.
|
override |
Definition at line 469 of file qgsattributesformmodel.cpp.
|
override |
Definition at line 485 of file qgsattributesformmodel.cpp.
|
override |
Definition at line 769 of file qgsattributesformmodel.cpp.
|
override |
Definition at line 764 of file qgsattributesformmodel.cpp.
|
overrideslot |
Definition at line 491 of file qgsattributesformmodel.cpp.
|
slot |
Refresh layer actions in the model to keep an updated action list.
actions | Up-to-date list of actions |
Definition at line 592 of file qgsattributesformmodel.cpp.
QModelIndex QgsAttributesAvailableWidgetsModel::relationContainer | ( | ) | const |
Returns the relation container in this model, expected to be placed at the second top-level row.
If there is no relation container set, an invalid index is returned.
Definition at line 818 of file qgsattributesformmodel.cpp.
|
override |
Definition at line 745 of file qgsattributesformmodel.cpp.
|
override |
Definition at line 759 of file qgsattributesformmodel.cpp.