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 specifiedparent
widget.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
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.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¶
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.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- 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], PyQt5.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¶
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.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_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)¶