Class: QgsNewDatabaseTableNameWidget

A widget which embeds the browser view to select a DB schema and a new table name.

The table name is validated for uniqueness and the selected data item provider, schema and table names can be retrieved with getters.

Warning

The data provider that originated the data item provider must support the connections API

Added in version 3.14.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsNewDatabaseTableNameWidget

Base classes

QgsPanelWidget

Base class for any widget that can be shown as an inline panel.

QWidget

QObject

QPaintDevice

class qgis.gui.QgsNewDatabaseTableNameWidget[source]

Bases: QgsPanelWidget

__init__(browserModel: QgsBrowserGuiModel | None = None, providersFilter: Iterable[str | None] = [], parent: QWidget | None = None)

Constructs a new QgsNewDatabaseTableNameWidget

Parameters:
  • browserModel (Optional[QgsBrowserGuiModel] = None) – an existing browser model (typically from app), if None an instance will be created

  • providersFilter (Iterable[Optional[str]] = []) – optional white list of data provider keys that should be shown in the widget, if not specified all providers data items with database capabilities will be shown

  • parent (Optional[QWidget] = None) – optional parent for this widget

signal accepted[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

dataProviderKey(self) str[source]

Returns the currently selected data item provider key

Return type:

str

isValid(self) bool[source]

Returns True if the widget contains a valid new table name

Return type:

bool

signal providerKeyChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

schema(self) str[source]

Returns the currently selected schema or file path (in case of filesystem-based DBs like spatialite or GPKG) for the new table

Return type:

str

signal schemaNameChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

setAcceptButtonVisible(self, visible: bool)[source]

Sets whether the optional “Ok”/accept button should be visible.

By default this is hidden, to better allow the widget to be embedded inside other widgets and dialogs.

Parameters:

visible (bool)

virtual showEvent(self, e: QShowEvent | None)[source]

Scroll to last selected index and expand it’s children

Parameters:

e (Optional[QShowEvent])

table(self) str[source]

Returns the current name of the new table

Return type:

str

signal tableNameChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

uri(self) str[source]

Returns the (possibly blank) string representation of the new table data source URI. The URI might be invalid in case the widget is not in a valid state.

Return type:

str

signal uriChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal validationChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

validationError(self) str[source]

Returns the validation error or an empty string is the widget status is valid

Return type:

str