Class: QgsNewDatabaseTableNameWidget

class qgis.gui.QgsNewDatabaseTableNameWidget(browserModel: QgsBrowserGuiModel = None, providersFilter: Iterable[str] = [], parent: QWidget = None)

Bases: QgsPanelWidget

Constructs a new QgsNewDatabaseTableNameWidget

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

  • providersFilter (Iterable[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 (QWidget = None) – optional parent for this widget

The QgsNewDatabaseTableNameWidget class 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

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

dataProviderKey

Returns the currently selected data item provider key

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

isValid

Returns True if the widget contains a valid new table name

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

schema

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

sender

senderSignalIndex

sharedPainter

showEvent

Scroll to last selected index and expand it’s children

table

Returns the current name of the new table

tabletEvent

timerEvent

updateMicroFocus

uri

Returns the (possibly blank) string representation of the new table data source URI.

validationError

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

wheelEvent

Signals

providerKeyChanged

This signal is emitted when the selects a data provider or a schema name that has a different data provider than the previously selected one.

schemaNameChanged

This signal is emitted when the user selects a schema (or file path for filesystem-based DBs like spatialite or GPKG).

tableNameChanged

This signal is emitted when the user enters a table name

uriChanged

This signal is emitted when the URI of the new table changes, whether or not it is a valid one.

validationChanged

This signal is emitted whenever the validation status of the widget changes.

actionEvent()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
dataProviderKey(self) → str

Returns the currently selected data item provider key

Return type

str

destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
isValid(self) → bool

Returns True if the widget contains a valid new table name

Return type

bool

keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
providerKeyChanged

This signal is emitted when the selects a data provider or a schema name that has a different data provider than the previously selected one.

Parameters

providerKey (str) – the data provider key of the selected schema [signal]

receivers()
resizeEvent()
schema(self) → str

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

schemaNameChanged

This signal is emitted when the user selects a schema (or file path for filesystem-based DBs like spatialite or GPKG).

Parameters

schemaName (str) – the name of the selected schema [signal]

sender()
senderSignalIndex()
sharedPainter()
showEvent(self, e: QShowEvent)

Scroll to last selected index and expand it’s children

Parameters

e (QShowEvent) –

table(self) → str

Returns the current name of the new table

Return type

str

tableNameChanged

This signal is emitted when the user enters a table name

Parameters

tableName (str) – the name of the new table [signal]

tabletEvent()
timerEvent()
updateMicroFocus()
uri(self) → str

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

uriChanged

This signal is emitted when the URI of the new table changes, whether or not it is a valid one.

Parameters

uri (str) – URI string representation [signal]

validationChanged

This signal is emitted whenever the validation status of the widget changes.

Parameters

isValid (bool) – True if the current status of the widget is valid [signal]

validationError(self) → str

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

Return type

str

wheelEvent()