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¶
- class qgis.gui.QgsTableEditorDialog[source]¶
Bases:
QMainWindow- __init__(parent: QWidget | None = None)
Constructor for QgsTableEditorDialog with the specified
parentwidget.- Parameters:
parent (Optional[QWidget] = None)
- signal includeHeaderChanged[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.
- includeTableHeader(self) bool[source]¶
Returns
Trueif 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
layerto 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
widthfor the specifiedcolumn. Setwidthto 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
contentsto 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:
Trueif 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
heightfor the specifiedrow. Setheightto 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)
- signal tableChanged[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.
- 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: