QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Slots | Signals | Public Member Functions | List of all members
QgsProviderConnectionComboBox Class Reference

The QgsProviderConnectionComboBox class is a combo box which displays the list of connections registered for a given provider. More...

#include <qgsproviderconnectioncombobox.h>

Inheritance diagram for QgsProviderConnectionComboBox:
Inheritance graph
[legend]

Public Slots

void setConnection (const QString &connection)
 Sets the current connection selected in the combo box. More...
 

Signals

void connectionChanged (const QString &connection)
 Emitted whenever the currently selected connection changes. More...
 

Public Member Functions

 QgsProviderConnectionComboBox (const QString &provider, QWidget *parent=nullptr)
 Constructor for QgsProviderConnectionComboBox, for the specified provider. More...
 
 QgsProviderConnectionComboBox (QWidget *parent=nullptr)
 Constructor for QgsProviderConnectionComboBox. More...
 
bool allowEmptyConnection () const
 Returns true if the combobox allows the empty connection ("not set") choice. More...
 
QString currentConnection () const
 Returns the name of the current connection selected in the combo box. More...
 
QString currentConnectionUri () const
 Returns the uri of the current connection selected in the combo box. More...
 
void setAllowEmptyConnection (bool allowEmpty)
 Sets whether an optional empty connection ("not set") option is present in the combobox. More...
 
void setProvider (const QString &provider)
 Sets the provider to be used. More...
 

Detailed Description

The QgsProviderConnectionComboBox class is a combo box which displays the list of connections registered for a given provider.

Warning
The provider must support the connection API methods in its QgsProviderMetadata implementation in order for the model to work correctly.
Since
QGIS 3.14

Definition at line 49 of file qgsproviderconnectioncombobox.h.

Constructor & Destructor Documentation

◆ QgsProviderConnectionComboBox() [1/2]

QgsProviderConnectionComboBox::QgsProviderConnectionComboBox ( const QString &  provider,
QWidget *  parent = nullptr 
)
explicit

Constructor for QgsProviderConnectionComboBox, for the specified provider.

Warning
The provider must support the connection API methods in its QgsProviderMetadata implementation in order for the model to work correctly.

Definition at line 19 of file qgsproviderconnectioncombobox.cpp.

◆ QgsProviderConnectionComboBox() [2/2]

QgsProviderConnectionComboBox::QgsProviderConnectionComboBox ( QWidget *  parent = nullptr)
explicit

Constructor for QgsProviderConnectionComboBox.

Note
The combo box will not show any connection until setProvider() is called.

Definition at line 25 of file qgsproviderconnectioncombobox.cpp.

Member Function Documentation

◆ allowEmptyConnection()

bool QgsProviderConnectionComboBox::allowEmptyConnection ( ) const

Returns true if the combobox allows the empty connection ("not set") choice.

See also
setAllowEmptyConnection()

Definition at line 63 of file qgsproviderconnectioncombobox.cpp.

◆ connectionChanged

void QgsProviderConnectionComboBox::connectionChanged ( const QString &  connection)
signal

Emitted whenever the currently selected connection changes.

◆ currentConnection()

QString QgsProviderConnectionComboBox::currentConnection ( ) const

Returns the name of the current connection selected in the combo box.

Definition at line 98 of file qgsproviderconnectioncombobox.cpp.

◆ currentConnectionUri()

QString QgsProviderConnectionComboBox::currentConnectionUri ( ) const

Returns the uri of the current connection selected in the combo box.

Definition at line 109 of file qgsproviderconnectioncombobox.cpp.

◆ setAllowEmptyConnection()

void QgsProviderConnectionComboBox::setAllowEmptyConnection ( bool  allowEmpty)

Sets whether an optional empty connection ("not set") option is present in the combobox.

See also
allowEmptyConnection()

Definition at line 58 of file qgsproviderconnectioncombobox.cpp.

◆ setConnection

void QgsProviderConnectionComboBox::setConnection ( const QString &  connection)
slot

Sets the current connection selected in the combo box.

Definition at line 68 of file qgsproviderconnectioncombobox.cpp.

◆ setProvider()

void QgsProviderConnectionComboBox::setProvider ( const QString &  provider)

Sets the provider to be used.

Warning
The provider must support the connection API methods in its QgsProviderMetadata implementation in order for the model to work correctly.

Definition at line 30 of file qgsproviderconnectioncombobox.cpp.


The documentation for this class was generated from the following files: