QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
The QgsDatabaseTableComboBox class is a combo box which displays the list of tables for a specific database connection. More...
#include <qgsdatabasetablecombobox.h>
Public Slots | |
void | refreshTables () |
Refreshes the list of available tables. | |
void | setConnectionName (const QString &connection, const QString &provider=QString()) |
Sets the database connection name from which to retrieve the available tables. | |
void | setSchema (const QString &schema) |
Sets the schema from which to retrieve the available tables. | |
void | setTable (const QString &table, const QString &schema=QString()) |
Sets the current table selected in the combo box. | |
Signals | |
void | tableChanged (const QString &table, const QString &schema=QString()) |
Emitted whenever the currently selected table changes. | |
Public Member Functions | |
QgsDatabaseTableComboBox (const QString &provider, const QString &connection, const QString &schema=QString(), QWidget *parent=nullptr) | |
Constructor for QgsDatabaseTableComboBox, for the specified provider and connection. | |
QgsDatabaseTableComboBox (QgsAbstractDatabaseProviderConnection *connection, const QString &schema=QString(), QWidget *parent=nullptr) | |
Constructor for QgsDatabaseTableComboBox, for the specified connection. | |
bool | allowEmptyTable () const |
Returns true if the combobox allows the empty table ("not set") choice. | |
QComboBox * | comboBox () |
Returns the combobox portion of the widget. | |
QString | currentSchema () const |
Returns the schema of the current table selected in the combo box. | |
QString | currentTable () const |
Returns the name of the current table selected in the combo box. | |
void | setAllowEmptyTable (bool allowEmpty) |
Sets whether an optional empty table ("not set") option is present in the combobox. | |
The QgsDatabaseTableComboBox class is a combo box which displays the list of tables for a specific database connection.
Definition at line 51 of file qgsdatabasetablecombobox.h.
|
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.
Definition at line 24 of file qgsdatabasetablecombobox.cpp.
|
explicit |
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 35 of file qgsdatabasetablecombobox.cpp.
bool QgsDatabaseTableComboBox::allowEmptyTable | ( | ) | const |
Returns true
if the combobox allows the empty table ("not set") choice.
Definition at line 50 of file qgsdatabasetablecombobox.cpp.
|
inline |
Returns the combobox portion of the widget.
Definition at line 100 of file qgsdatabasetablecombobox.h.
QString QgsDatabaseTableComboBox::currentSchema | ( | ) | const |
Returns the schema of the current table selected in the combo box.
Definition at line 174 of file qgsdatabasetablecombobox.cpp.
QString QgsDatabaseTableComboBox::currentTable | ( | ) | const |
Returns the name of the current table selected in the combo box.
Definition at line 185 of file qgsdatabasetablecombobox.cpp.
|
slot |
Refreshes the list of available tables.
Definition at line 165 of file qgsdatabasetablecombobox.cpp.
void QgsDatabaseTableComboBox::setAllowEmptyTable | ( | bool | allowEmpty | ) |
Sets whether an optional empty table ("not set") option is present in the combobox.
Definition at line 43 of file qgsdatabasetablecombobox.cpp.
|
slot |
Sets the database connection name from which to retrieve the available tables.
Optionally the provider can be reset too.
Definition at line 119 of file qgsdatabasetablecombobox.cpp.
|
slot |
Sets the schema from which to retrieve the available tables.
Definition at line 147 of file qgsdatabasetablecombobox.cpp.
|
slot |
Sets the current table selected in the combo box.
If necessary, the schema can be specified too.
Definition at line 88 of file qgsdatabasetablecombobox.cpp.
|
signal |
Emitted whenever the currently selected table changes.