QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
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 23 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 34 of file qgsdatabasetablecombobox.cpp.
bool QgsDatabaseTableComboBox::allowEmptyTable | ( | ) | const |
Returns true
if the combobox allows the empty table ("not set") choice.
Definition at line 49 of file qgsdatabasetablecombobox.cpp.
|
inline |
Returns the combobox portion of the widget.
Definition at line 101 of file qgsdatabasetablecombobox.h.
QString QgsDatabaseTableComboBox::currentSchema | ( | ) | const |
Returns the schema of the current table selected in the combo box.
Definition at line 173 of file qgsdatabasetablecombobox.cpp.
QString QgsDatabaseTableComboBox::currentTable | ( | ) | const |
Returns the name of the current table selected in the combo box.
Definition at line 184 of file qgsdatabasetablecombobox.cpp.
|
slot |
Refreshes the list of available tables.
Definition at line 164 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 42 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 118 of file qgsdatabasetablecombobox.cpp.
|
slot |
Sets the schema from which to retrieve the available tables.
Definition at line 146 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 87 of file qgsdatabasetablecombobox.cpp.
|
signal |
Emitted whenever the currently selected table changes.