QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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.
 
void setConnectionName (const QString &connection, const QString &provider=QString())
 Sets the database connection name from which to retrieve the available schemas.
 
void setSchema (const QString &schema)
 Sets the current schema selected in the combo box.
 

Signals

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

Public Member Functions

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

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 51 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 24 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 33 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 47 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 151 of file qgsdatabaseschemacombobox.cpp.

◆ refreshSchemas

void QgsDatabaseSchemaComboBox::refreshSchemas ( )
slot

Refreshes the list of available schemas.

Definition at line 143 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 40 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 118 of file qgsdatabaseschemacombobox.cpp.

◆ setSchema

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

Sets the current schema selected in the combo box.

Definition at line 87 of file qgsdatabaseschemacombobox.cpp.


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