Class: QgsDatabaseSchemaComboBox¶
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.
Added in version 3.14.
Class Hierarchy¶
Base classes¶
Methods
Returns |
|
Returns the combobox portion of the widget. |
|
Returns the name of the current schema selected in the combo box. |
|
Refreshes the list of available schemas. |
|
Sets whether an optional empty schema ("not set") option is present in the combobox. |
|
Sets the database connection name from which to retrieve the available schemas. |
|
Sets the current schema selected in the combo box. |
Signals
Emitted whenever the currently selected schema changes. |
- class qgis.gui.QgsDatabaseSchemaComboBox[source]¶
Bases:
QWidget
- __init__(provider: str | None, connection: str | None, parent: QWidget | None = None)
Constructor for QgsDatabaseSchemaComboBox, for the specified
provider
andconnection
.Warning
The provider must support the connection API methods in its
QgsProviderMetadata
implementation in order for the model to work correctly.- Parameters:
provider (Optional[str])
connection (Optional[str])
parent (Optional[QWidget] = None)
- __init__(connection: QgsAbstractDatabaseProviderConnection | None, parent: QWidget | None = None)
Constructor for QgsDatabaseSchemaComboBox, for the specified
connection
.Ownership of
connection
is transferred to the combobox.- Parameters:
connection (Optional[QgsAbstractDatabaseProviderConnection])
parent (Optional[QWidget] = None)
- allowEmptySchema(self) bool [source]¶
Returns
True
if the combobox allows the empty schema (“not set”) choice.See also
- Return type:
bool
- comboBox(self) QComboBox | None [source]¶
Returns the combobox portion of the widget.
- Return type:
Optional[QComboBox]
- currentSchema(self) str [source]¶
Returns the name of the current schema selected in the combo box.
- Return type:
str
- signal schemaChanged(schema: str)[source]¶
Emitted whenever the currently selected schema changes.
- Parameters:
schema (str)
- setAllowEmptySchema(self, allowEmpty: bool)[source]¶
Sets whether an optional empty schema (“not set”) option is present in the combobox.
See also
- Parameters:
allowEmpty (bool)