The QgsDatabaseTableComboBox class is a combo box which displays the list of tables for a specific database connection.
More...
#include <qgsdatabasetablecombobox.h>
|
void | refreshTables () |
| Refreshes the list of available tables. More...
|
|
void | setConnectionName (const QString &connection, const QString &provider=QString()) |
| Sets the database connection name from which to retrieve the available tables. More...
|
|
void | setSchema (const QString &schema) |
| Sets the schema from which to retrieve the available tables. More...
|
|
void | setTable (const QString &table, const QString &schema=QString()) |
| Sets the current table selected in the combo box. More...
|
|
|
void | tableChanged (const QString &table, const QString &schema=QString()) |
| Emitted whenever the currently selected table changes. More...
|
|
The QgsDatabaseTableComboBox class is a combo box which displays the list of tables 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 qgsdatabasetablecombobox.h.
◆ QgsDatabaseTableComboBox() [1/2]
QgsDatabaseTableComboBox::QgsDatabaseTableComboBox |
( |
const QString & |
provider, |
|
|
const QString & |
connection, |
|
|
const QString & |
schema = QString() , |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
Constructor for QgsDatabaseTableComboBox, for the specified provider and connection.
The optional schema argument can be used to restrict the listed tables to a specific schema.
- 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 qgsdatabasetablecombobox.cpp.
◆ QgsDatabaseTableComboBox() [2/2]
Constructor for QgsDatabaseTableComboBox, for the specified connection.
The optional schema argument can be used to restrict the listed tables to a specific schema.
Ownership of connection is transferred to the combobox.
Definition at line 34 of file qgsdatabasetablecombobox.cpp.
◆ allowEmptyTable()
bool QgsDatabaseTableComboBox::allowEmptyTable |
( |
| ) |
const |
◆ comboBox()
QComboBox * QgsDatabaseTableComboBox::comboBox |
( |
| ) |
|
|
inline |
◆ currentSchema()
QString QgsDatabaseTableComboBox::currentSchema |
( |
| ) |
const |
◆ currentTable()
QString QgsDatabaseTableComboBox::currentTable |
( |
| ) |
const |
◆ refreshTables
void QgsDatabaseTableComboBox::refreshTables |
( |
| ) |
|
|
slot |
◆ setAllowEmptyTable()
void QgsDatabaseTableComboBox::setAllowEmptyTable |
( |
bool |
allowEmpty | ) |
|
◆ setConnectionName
void QgsDatabaseTableComboBox::setConnectionName |
( |
const QString & |
connection, |
|
|
const QString & |
provider = QString() |
|
) |
| |
|
slot |
Sets the database connection name from which to retrieve the available tables.
Optionally the provider can be reset too.
Definition at line 118 of file qgsdatabasetablecombobox.cpp.
◆ setSchema
void QgsDatabaseTableComboBox::setSchema |
( |
const QString & |
schema | ) |
|
|
slot |
◆ setTable
void QgsDatabaseTableComboBox::setTable |
( |
const QString & |
table, |
|
|
const QString & |
schema = QString() |
|
) |
| |
|
slot |
Sets the current table selected in the combo box.
If necessary, the schema can be specified too.
Definition at line 87 of file qgsdatabasetablecombobox.cpp.
◆ tableChanged
void QgsDatabaseTableComboBox::tableChanged |
( |
const QString & |
table, |
|
|
const QString & |
schema = QString() |
|
) |
| |
|
signal |
Emitted whenever the currently selected table changes.
The documentation for this class was generated from the following files: