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

The QgsDatabaseSchemaComboBox class is a combo box which displays the list of schemas for a specific database connection. More...

#include <qgsdatabaseschemacombobox.h>

Inheritance diagram for QgsDatabaseSchemaComboBox:
Inheritance graph
[legend]

Public Slots

void refreshSchemas ()
 Refreshes the list of available schemas. More...
 
void setConnectionName (const QString &connection, const QString &provider=QString())
 Sets the database connection name from which to retrieve the available schemas. More...
 
void setSchema (const QString &schema)
 Sets the current schema selected in the combo box. More...
 

Signals

void schemaChanged (const QString &schema)
 Emitted whenever the currently selected schema changes. More...
 

Public Member Functions

 QgsDatabaseSchemaComboBox (const QString &provider, const QString &connection, QWidget *parent=nullptr)
 Constructor for QgsDatabaseSchemaComboBox, for the specified provider and connection. More...
 
 QgsDatabaseSchemaComboBox (QgsAbstractDatabaseProviderConnection *connection, QWidget *parent=nullptr)
 Constructor for QgsDatabaseSchemaComboBox, for the specified connection. More...
 
bool allowEmptySchema () const
 Returns true if the combobox allows the empty schema ("not set") choice. More...
 
QComboBox * comboBox ()
 Returns the combobox portion of the widget. More...
 
QString currentSchema () const
 Returns the name of the current schema selected in the combo box. More...
 
void setAllowEmptySchema (bool allowEmpty)
 Sets whether an optional empty schema ("not set") option is present in the combobox. More...
 

Detailed Description

The QgsDatabaseSchemaComboBox class is a combo box which displays the list of schemas for a specific database connection.

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

Definition at line 50 of file qgsdatabaseschemacombobox.h.

Constructor & Destructor Documentation

◆ QgsDatabaseSchemaComboBox() [1/2]

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

Constructor for QgsDatabaseSchemaComboBox, for the specified provider and connection.

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

Definition at line 23 of file qgsdatabaseschemacombobox.cpp.

◆ QgsDatabaseSchemaComboBox() [2/2]

QgsDatabaseSchemaComboBox::QgsDatabaseSchemaComboBox ( QgsAbstractDatabaseProviderConnection connection,
QWidget *  parent = nullptr 
)
explicit

Constructor for QgsDatabaseSchemaComboBox, for the specified connection.

Ownership of connection is transferred to the combobox.

Definition at line 32 of file qgsdatabaseschemacombobox.cpp.

Member Function Documentation

◆ allowEmptySchema()

bool QgsDatabaseSchemaComboBox::allowEmptySchema ( ) const

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

See also
setAllowEmptySchema()

Definition at line 46 of file qgsdatabaseschemacombobox.cpp.

◆ comboBox()

QComboBox* QgsDatabaseSchemaComboBox::comboBox ( )
inline

Returns the combobox portion of the widget.

Definition at line 91 of file qgsdatabaseschemacombobox.h.

◆ currentSchema()

QString QgsDatabaseSchemaComboBox::currentSchema ( ) const

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

Definition at line 150 of file qgsdatabaseschemacombobox.cpp.

◆ refreshSchemas

void QgsDatabaseSchemaComboBox::refreshSchemas ( )
slot

Refreshes the list of available schemas.

Definition at line 142 of file qgsdatabaseschemacombobox.cpp.

◆ schemaChanged

void QgsDatabaseSchemaComboBox::schemaChanged ( const QString &  schema)
signal

Emitted whenever the currently selected schema changes.

◆ setAllowEmptySchema()

void QgsDatabaseSchemaComboBox::setAllowEmptySchema ( bool  allowEmpty)

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

See also
allowEmptySchema()

Definition at line 39 of file qgsdatabaseschemacombobox.cpp.

◆ setConnectionName

void QgsDatabaseSchemaComboBox::setConnectionName ( const QString &  connection,
const QString &  provider = QString() 
)
slot

Sets the database connection name from which to retrieve the available schemas.

Optionally the provider can be reset too.

Definition at line 117 of file qgsdatabaseschemacombobox.cpp.

◆ setSchema

void QgsDatabaseSchemaComboBox::setSchema ( const QString &  schema)
slot

Sets the current schema selected in the combo box.

Definition at line 86 of file qgsdatabaseschemacombobox.cpp.


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