Class: QgsTableEditorDialog¶
- class qgis.gui.QgsTableEditorDialog(parent: QWidget = None)¶
Bases:
PyQt5.QtWidgets.QMainWindow
Constructor for
QgsTableEditorDialog
with the specifiedparent
widget.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.Methods
Returns
True
if the table includes a header row.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 configured column
width
for the specifiedcolumn
.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 specifiedrow
.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.
- 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.See also
- 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.
See also
- Parameters
included (bool) –
- setTableColumnWidth(self, column: int, width: float)¶
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: object)¶
Sets the
contents
to show in the editor widget.See also
- 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
- setTableHeaders(self, headers: Iterable[Any])¶
Sets the table
headers
.See also
- Parameters
headers (Iterable[Any]) –
- setTableRowHeight(self, row: int, height: float)¶
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) –
- 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.See also
- Parameters
column (int) –
- Return type
float
- tableContents(self) → object¶
Returns the current contents of the editor widget table.
See also
- Return type
object
- tableHeaders(self) → List[Any]¶
Returns the table header values.
See also
- 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.See also
- Parameters
row (int) –
- Return type
float
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶