QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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.
 

Signals

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

Public Member Functions

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

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 50 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 20 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 26 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 66 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 101 of file qgsproviderconnectioncombobox.cpp.

◆ currentConnectionUri()

QString QgsProviderConnectionComboBox::currentConnectionUri ( ) const

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

Definition at line 112 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 61 of file qgsproviderconnectioncombobox.cpp.

◆ setConnection

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

Sets the current connection selected in the combo box.

Definition at line 71 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 31 of file qgsproviderconnectioncombobox.cpp.


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