Class: QgsTableEditorDialog¶
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.
Added in version 3.12.

QgsTableEditorDialog¶
Class Hierarchy¶
Base classes¶
Methods
Returns |
|
Returns the (possibly |
|
Register an expression context generator class that will be used to retrieve an expression context for the editor when required. |
|
Sets whether the table includes a header row. |
|
Sets the layer to be used associated with the expression editor context. |
|
Sets the configured column width for the specified column. |
|
Sets the contents to show in the editor widget. |
|
Parses the clipboard text into contents to show in the editor widget. |
|
Sets the table headers. |
|
Sets the configured row height for the specified row. |
|
Returns the configured column width for the specified column, or 0 if an automatic width should be used for the column. |
|
Returns the current contents of the editor widget table. |
|
Returns the table header values. |
|
Returns the configured row height for the specified row, or 0 if an automatic height should be used for the row. |
Signals
Emitted whenever the "include table header" setting is changed. |
|
Emitted whenever the table contents are changed. |
- class qgis.gui.QgsTableEditorDialog[source]¶
Bases:
QMainWindow
- __init__(parent: QWidget | None = None)
Constructor for QgsTableEditorDialog with the specified
parent
widget.- Parameters:
parent (Optional[QWidget] = None)
- signal includeHeaderChanged(included: bool)[source]¶
Emitted whenever the “include table header” setting is changed.
- Parameters:
included (bool)
- includeTableHeader(self) bool [source]¶
Returns
True
if the table includes a header row.See also
- Return type:
bool
- layer(self) QgsMapLayer | None [source]¶
Returns the (possibly
None
) layer associated with the expression editor context.Added in version 3.40.
- Return type:
Optional[QgsMapLayer]
- registerExpressionContextGenerator(self, generator: QgsExpressionContextGenerator | None)[source]¶
Register an expression context generator class that will be used to retrieve an expression context for the editor when required.
Added in version 3.16.
- Parameters:
generator (Optional[QgsExpressionContextGenerator])
- setIncludeTableHeader(self, included: bool)[source]¶
Sets whether the table includes a header row.
See also
- Parameters:
included (bool)
- setLayer(self, layer: QgsMapLayer | None)[source]¶
Sets the
layer
to be used associated with the expression editor context.Added in version 3.40.
- Parameters:
layer (Optional[QgsMapLayer])
- setTableColumnWidth(self, column: int, width: float)[source]¶
Sets the configured column
width
for the specifiedcolumn
. Setwidth
to 0 if an automatic width should be used for the column.This should be called after a call to
setTableContents()
.See also
- Parameters:
column (int)
width (float)
- setTableContents(self, contents: Any)[source]¶
Sets the
contents
to show in the editor widget.See also
- Parameters:
contents (Any)
- setTableContentsFromClipboard(self) bool [source]¶
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
- setTableHeaders(self, headers: Iterable[Any])[source]¶
Sets the table
headers
.See also
- Parameters:
headers (Iterable[Any])
- setTableRowHeight(self, row: int, height: float)[source]¶
Sets the configured row
height
for the specifiedrow
. Setheight
to 0 if an automatic height should be used for the row.This should be called after a call to
setTableContents()
.See also
- Parameters:
row (int)
height (float)
- tableColumnWidth(self, column: int) float [source]¶
Returns the configured column width for the specified
column
, or 0 if an automatic width should be used for the column.See also
- Parameters:
column (int)
- Return type:
float
- tableContents(self) Any [source]¶
Returns the current contents of the editor widget table.
See also
- Return type:
Any
- tableHeaders(self) List[Any] [source]¶
Returns the table header values.
See also
- Return type:
List[Any]