QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
#include <qgsquickvaluerelationlistmodel.h>
Public Member Functions | |
QgsQuickValueRelationListModel (QObject *parent=nullptr) | |
Constructs an empty list model. More... | |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
Q_INVOKABLE QVariant | keyForRow (int row) const |
Returns key for the given rown number (invalid variant if outside of the valid range) More... | |
Q_INVOKABLE void | populate (const QVariantMap &config, const QgsFeature &formFeature=QgsFeature()) |
Populates the model from vector layer's widget configuration. More... | |
int | rowCount (const QModelIndex &) const override |
Q_INVOKABLE int | rowForKey (const QVariant &key) const |
Returns row number. More... | |
List model for combo box in Value Relation widget. The model keeps a list of key-value pairs fetched from a vector layer. "Values" are the human readable descriptions (QString), "keys" are unique identifiers of items (QVariant).
Definition at line 35 of file qgsquickvaluerelationlistmodel.h.
QgsQuickValueRelationListModel::QgsQuickValueRelationListModel | ( | QObject * | parent = nullptr | ) |
Constructs an empty list model.
Definition at line 21 of file qgsquickvaluerelationlistmodel.cpp.
|
override |
Definition at line 59 of file qgsquickvaluerelationlistmodel.cpp.
QVariant QgsQuickValueRelationListModel::keyForRow | ( | int | row | ) | const |
Returns key for the given rown number (invalid variant if outside of the valid range)
Definition at line 33 of file qgsquickvaluerelationlistmodel.cpp.
void QgsQuickValueRelationListModel::populate | ( | const QVariantMap & | config, |
const QgsFeature & | formFeature = QgsFeature() |
||
) |
Populates the model from vector layer's widget configuration.
Definition at line 26 of file qgsquickvaluerelationlistmodel.cpp.
|
override |
Definition at line 54 of file qgsquickvaluerelationlistmodel.cpp.
int QgsQuickValueRelationListModel::rowForKey | ( | const QVariant & | key | ) | const |
Returns row number.
Definition at line 43 of file qgsquickvaluerelationlistmodel.cpp.