QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
providers
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 : denis@opengis.ch
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
45
{
46
Q_UNUSED( column )
47
return
true
;
48
}
49
51
virtual
void
setSql
(
const
QModelIndex &index,
const
QString &sql ) = 0;
52
};
53
54
#endif
// QGSABSTRACTDBTABLEMODEL_H
QgsAbstractDbTableModel::setSql
virtual void setSql(const QModelIndex &index, const QString &sql)=0
Sets an sql statement that belongs to a cell specified by a model index.
QgsAbstractDbTableModel::searchableColumn
virtual bool searchableColumn(int column) const
Returns if the column should be searchable at the given index.
Definition
qgsabstractdbtablemodel.h:44
QgsAbstractDbTableModel::defaultSearchColumn
virtual int defaultSearchColumn() const =0
Returns the index of the column used by default to filter the results (probably the table name column...
QgsAbstractDbTableModel::QgsAbstractDbTableModel
QgsAbstractDbTableModel(QObject *parent=nullptr)
Constructor.
Definition
qgsabstractdbtablemodel.h:33
QgsAbstractDbTableModel::columns
virtual QStringList columns() const =0
Returns the list of columns in the table.
Generated on
for QGIS API Documentation by
1.17.0