QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsquickvaluerelationlistmodel.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsquickvaluerelationlistmodel.h
3  --------------------------------------
4  Date : March 2020
5  Copyright : (C) 2020 by Martin Dobias
6  Email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSQUICKVALUERELATIONLISTMODEL_H
17 #define QGSQUICKVALUERELATIONLISTMODEL_H
18 
19 #include "qgis_quick.h"
20 
21 #include <QAbstractListModel>
22 
24 
35 class QUICK_EXPORT QgsQuickValueRelationListModel : public QAbstractListModel
36 {
37  Q_OBJECT
38  public:
40  QgsQuickValueRelationListModel( QObject *parent = nullptr );
41 
43  Q_INVOKABLE void populate( const QVariantMap &config, const QgsFeature &formFeature = QgsFeature() );
44 
46  Q_INVOKABLE QVariant keyForRow( int row ) const;
48  Q_INVOKABLE int rowForKey( const QVariant &key ) const;
49 
50  int rowCount( const QModelIndex & ) const override;
51  QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;
52 
53  private:
55 };
56 
57 #endif // QGSQUICKVALUERELATIONLISTMODEL_H
qgsvaluerelationfieldformatter.h
QgsQuickValueRelationListModel
Definition: qgsquickvaluerelationlistmodel.h:35
QgsValueRelationFieldFormatter::ValueRelationCache
QVector< QgsValueRelationFieldFormatter::ValueRelationItem > ValueRelationCache
Definition: qgsvaluerelationfieldformatter.h:70
QgsFeature
Definition: qgsfeature.h:55