Class: QgsTableEditorDialog

class qgis.gui.QgsTableEditorDialog

Bases: PyQt5.QtWidgets.QMainWindow

A reusable window for editing simple spreadsheet-style tables.

Table content is retrieved and set using the QgsTableContents class. The editor has support for table foreground and background colors, and numeric formats.

New in version 3.12.

QgsTableEditorDialog(parent: QWidget = None) Constructor for QgsTableEditorDialog with the specified parent widget.

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

includeTableHeader

Returns True if the table includes a header row.

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

registerExpressionContextGenerator

Register an expression context generator class that will be used to retrieve an expression context for the editor when required.

resizeEvent

sender

senderSignalIndex

setIncludeTableHeader

Sets whether the table includes a header row.

setTableColumnWidth

Sets the configured column width for the specified column.

setTableContents

Sets the contents to show in the editor widget.

setTableContentsFromClipboard

Parses the clipboard text into contents to show in the editor widget.

setTableHeaders

Sets the table headers.

setTableRowHeight

Sets the configured row height for the specified row.

sharedPainter

showEvent

tableColumnWidth

Returns the configured column width for the specified column, or 0 if an automatic width should be used for the column.

tableContents

Returns the current contents of the editor widget table.

tableHeaders

Returns the table header values.

tableRowHeight

Returns the configured row height for the specified row, or 0 if an automatic height should be used for the row.

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

includeHeaderChanged

Emitted whenever the "include table header" setting is changed.

tableChanged

Emitted whenever the table contents are changed.

actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
includeHeaderChanged

Emitted whenever the “include table header” setting is changed. [signal]

Parameters

included (bool) –

includeTableHeader(self) bool

Returns True if the table includes a header row.

Return type

bool

initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
registerExpressionContextGenerator(self, generator: QgsExpressionContextGenerator)

Register an expression context generator class that will be used to retrieve an expression context for the editor when required.

New in version 3.16.

Parameters

generator (QgsExpressionContextGenerator) –

resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setIncludeTableHeader(self, included: bool)

Sets whether the table includes a header row.

Parameters

included (bool) –

setTableColumnWidth(self, column: int, width: float)

Sets the configured column width for the specified column. Set width to 0 if an automatic width should be used for the column.

This should be called after a call to setTableContents().

Parameters
  • column (int) –

  • width (float) –

setTableContents(self, contents: object)

Sets the contents to show in the editor widget.

See also

tableContents()

Parameters

contents (object) –

setTableContentsFromClipboard(self) bool

Parses the clipboard text into contents to show in the editor widget.

Return type

bool

Returns

True if the clipboard was successfully parsed

See also

tableContents()

setTableHeaders(self, headers: Iterable[Any])

Sets the table headers.

See also

tableHeaders()

Parameters

headers (Iterable[Any]) –

setTableRowHeight(self, row: int, height: float)

Sets the configured row height for the specified row. Set height to 0 if an automatic height should be used for the row.

This should be called after a call to setTableContents().

See also

tableRowHeight()

Parameters
  • row (int) –

  • height (float) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
tableChanged

Emitted whenever the table contents are changed. [signal]

tableColumnWidth(self, column: int) float

Returns the configured column width for the specified column, or 0 if an automatic width should be used for the column.

Parameters

column (int) –

Return type

float

tableContents(self) object

Returns the current contents of the editor widget table.

Return type

object

tableHeaders(self) List[Any]

Returns the table header values.

Return type

List[Any]

tableRowHeight(self, row: int) float

Returns the configured row height for the specified row, or 0 if an automatic height should be used for the row.

Parameters

row (int) –

Return type

float

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)