16#ifndef QGSPROVIDERCONNECTIONCOMBOBOX_H
17#define QGSPROVIDERCONNECTIONCOMBOBOX_H
23#include <QSortFilterProxyModel>
29class GUI_EXPORT QgsProviderConnectionComboBoxSortModel :
public QSortFilterProxyModel
33 explicit QgsProviderConnectionComboBoxSortModel( QObject *parent =
nullptr );
36 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right )
const override;
113 void indexChanged(
int i );
115 void rowsAboutToBeRemoved();
120 QSortFilterProxyModel *mSortModel =
nullptr;
121 QString mPreviousConnection;
QgsProviderConnectionComboBox(const QString &provider, QWidget *parent=nullptr)
Constructor for QgsProviderConnectionComboBox, for the specified provider.
QString currentConnectionUri() const
Returns the uri of the current connection selected in the combo box.
void setProvider(const QString &provider)
Sets the provider to be used.
void setConnection(const QString &connection)
Sets the current connection selected in the combo box.
bool allowEmptyConnection() const
Returns true if the combobox allows the empty connection ("not set") choice.
void setAllowEmptyConnection(bool allowEmpty)
Sets whether an optional empty connection ("not set") option is present in the combobox.
QString currentConnection() const
Returns the name of the current connection selected in the combo box.
void connectionChanged(const QString &connection)
Emitted whenever the currently selected connection changes.
A model containing registered connection names for a specific data provider.