16#ifndef QGSDATABASESCHEMACOMBOBOX_H
17#define QGSDATABASESCHEMACOMBOBOX_H
23#include <QSortFilterProxyModel>
30class GUI_EXPORT QgsDatabaseSchemaComboBoxSortModel :
public QSortFilterProxyModel
34 explicit QgsDatabaseSchemaComboBoxSortModel( QObject *parent =
nullptr );
37 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right )
const override;
98 void setSchema(
const QString &schema );
105 void setConnectionName(
const QString &connection,
const QString &provider = QString() );
110 void refreshSchemas();
117 void indexChanged(
int i );
123 bool mAllowEmpty =
false;
126 QSortFilterProxyModel *mSortModel =
nullptr;
127 QComboBox *mComboBox =
nullptr;
Provides common functionality for database based connections.
QgsDatabaseSchemaComboBox(const QString &provider, const QString &connection, QWidget *parent=nullptr)
Constructor for QgsDatabaseSchemaComboBox, for the specified provider and connection.
void schemaChanged(const QString &schema)
Emitted whenever the currently selected schema changes.
bool allowEmptySchema() const
Returns true if the combobox allows the empty schema ("not set") choice.
void setAllowEmptySchema(bool allowEmpty)
Sets whether an optional empty schema ("not set") option is present in the combobox.
QComboBox * comboBox()
Returns the combobox portion of the widget.
QString currentSchema() const
Returns the name of the current schema selected in the combo box.
A model containing schemas from a database connection.