16#ifndef QGSDATABASETABLECOMBOBOX_H
17#define QGSDATABASETABLECOMBOBOX_H
23#include <QSortFilterProxyModel>
30class GUI_EXPORT QgsDatabaseTableComboBoxSortModel:
public QSortFilterProxyModel
34 explicit QgsDatabaseTableComboBoxSortModel( QObject *parent =
nullptr );
36 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right )
const override;
80 void setAllowEmptyTable(
bool allowEmpty );
86 bool allowEmptyTable()
const;
91 QString currentTable()
const;
96 QString currentSchema()
const;
110 void setTable(
const QString &table,
const QString &schema = QString() );
117 void setConnectionName(
const QString &connection,
const QString &provider = QString() );
122 void setSchema(
const QString &schema );
127 void refreshTables();
131 void tableChanged(
const QString &table,
const QString &schema = QString() );
134 void indexChanged(
int i );
140 bool mAllowEmpty =
false;
145 QSortFilterProxyModel *mSortModel =
nullptr;
146 QComboBox *mComboBox =
nullptr;
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
The QgsDatabaseTableComboBox class is a combo box which displays the list of tables for a specific da...
void tableChanged(const QString &table, const QString &schema=QString())
Emitted whenever the currently selected table changes.
QComboBox * comboBox()
Returns the combobox portion of the widget.
A model containing tables from a database connection.