QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsabstractdbtablemodel.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsabstractdbtablemodel.h
3  --------------------------------------
4  Date : 08.11.2021
5  Copyright : (C) 2021 Denis Rouzaud
6  Email : [email protected]
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 QGSABSTRACTDBTABLEMODEL_H
17 #define QGSABSTRACTDBTABLEMODEL_H
18 
19 #include "qgis_core.h"
20 
21 #include <QStandardItemModel>
22 
28 class CORE_EXPORT QgsAbstractDbTableModel : public QStandardItemModel
29 {
30  Q_OBJECT
31  public:
33  explicit QgsAbstractDbTableModel( QObject *parent = nullptr )
34  : QStandardItemModel( parent )
35  {}
36 
38  virtual QStringList columns() const = 0;
39 
41  virtual int defaultSearchColumn() const = 0;
42 
44  virtual bool searchableColumn( int column ) const {Q_UNUSED( column ) return true;}
45 
47  virtual void setSql( const QModelIndex &index, const QString &sql ) = 0;
48 };
49 
50 #endif // QGSABSTRACTDBTABLEMODEL_H
QgsAbstractDbTableModel
The QgsAbstractDbTableModel class is a pure virtual model class for results in a database source widg...
Definition: qgsabstractdbtablemodel.h:28