|
QGIS API Documentation 3.99.0-Master (21b3aa880ba)
|
A reusable widget for editing simple spreadsheet-style tables. More...
#include <qgstableeditorwidget.h>

Public Slots | |
| void | clearSelectedCells () |
| Clears the contents of the currently selected cells. | |
| void | deleteColumns () |
| Deletes all columns associated with the current selected cells. | |
| void | deleteRows () |
| Deletes all rows associated with the current selected cells. | |
| void | expandColumnSelection () |
| Expands out the selection to include whole columns associated with the current selected cells. | |
| void | expandRowSelection () |
| Expands out the selection to include whole rows associated with the current selected cells. | |
| void | insertColumnsAfter () |
| Inserts new columns after the current selection. | |
| void | insertColumnsBefore () |
| Inserts new columns before the current selection. | |
| void | insertRowsAbove () |
| Inserts new rows above the current selection. | |
| void | insertRowsBelow () |
| Inserts new rows below the current selection. | |
| void | mergeSelectedCells () |
| Merges selected table cells. | |
| void | setIncludeTableHeader (bool included) |
| Sets whether the table includes a header row. | |
| void | setSelectionBackgroundColor (const QColor &color) |
| Sets the background color for the currently selected cells. | |
| void | setSelectionCellProperty (const QgsProperty &property) |
| Sets the cell contents QgsProperty for the currently selected cells. | |
| void | setSelectionColumnWidth (double height) |
| Sets the column width (in millimeters) for the currently selected columns, or 0 for automatic column width. | |
| Q_DECL_DEPRECATED void | setSelectionForegroundColor (const QColor &color) |
| Sets the foreground color for the currently selected cells. | |
| void | setSelectionHorizontalAlignment (Qt::Alignment alignment) |
| Sets the horizontal alignment for the currently selected cells. | |
| void | setSelectionRowHeight (double height) |
| Sets the row height (in millimeters) for the currently selected rows, or 0 for automatic row height. | |
| void | setSelectionTextFormat (const QgsTextFormat &format) |
| Sets the text format for the selected cells. | |
| void | setSelectionVerticalAlignment (Qt::Alignment alignment) |
| Sets the vertical alignment for the currently selected cells. | |
| void | setTableHeaders (const QVariantList &headers) |
| Sets the table headers. | |
| void | splitSelectedCells () |
| Splits (un-merges) selected table cells. | |
Signals | |
| void | activeCellChanged () |
| Emitted whenever the active (or selected) cell changes in the widget. | |
| void | tableChanged () |
| Emitted whenever the table contents are changed. | |
Public Member Functions | |
| QgsTableEditorWidget (QWidget *parent=nullptr) | |
| Constructor for QgsTableEditorWidget with the specified parent widget. | |
| ~QgsTableEditorWidget () override | |
| bool | canMergeSelection () const |
Returns true if a selection has been made which can be merged. | |
| bool | canSplitSelection () const |
Returns true if a selection has been made which can be split. | |
| QList< int > | columnsAssociatedWithSelection () |
| Returns a list of the columns associated with the current table selected cells. | |
| bool | hasMixedSelectionNumericFormat () |
Returns true if the current selection has a mix of numeric formats. | |
| bool | isHeaderCellSelected () const |
Returns true if any header cells are selected. | |
| QList< int > | rowsAssociatedWithSelection () |
| Returns a list of the rows associated with the current table selected cells. | |
| QColor | selectionBackgroundColor () |
| Returns the background color for the currently selected cells. | |
| QgsProperty | selectionCellProperty () |
| Returns the QgsProperty used for the contents of the currently selected cells. | |
| double | selectionColumnWidth () |
| Returns the width (in millimeters) of the columns associated with the current selection, or 0 if an automatic column width is desired. | |
| Q_DECL_DEPRECATED QColor | selectionForegroundColor () |
| Returns the foreground color for the currently selected cells. | |
| Qt::Alignment | selectionHorizontalAlignment () |
| Returns the horizontal alignment for the currently selected cells. | |
| QgsNumericFormat * | selectionNumericFormat () |
Returns the numeric format used for the currently selected cells, or nullptr if the selection has no numeric format set. | |
| double | selectionRowHeight () |
| Returns the height (in millimeters) of the rows associated with the current selection, or 0 if an automatic row height is desired, or -1 if the selection has mixed row heights. | |
| QgsTextFormat | selectionTextFormat () |
| Returns the text format for the currently selected cells. | |
| Qt::Alignment | selectionVerticalAlignment () |
| Returns the horizontal alignment for the currently selected cells. | |
| void | setSelectionNumericFormat (QgsNumericFormat *format) |
| Sets the numeric format to use for the currently selected cells. | |
| void | setTableColumnWidth (int column, double width) |
| Sets the configured column width for the specified column. | |
| void | setTableContents (const QgsTableContents &contents) |
| Sets the contents to show in the editor widget. | |
| void | setTableRowHeight (int row, double height) |
| Sets the configured row height for the specified row. | |
| double | tableColumnWidth (int column) |
| Returns the configured column width for the specified column, or 0 if an automatic width should be used for the column. | |
| QgsTableContents | tableContents () const |
| Returns the current contents of the editor widget table. | |
| QVariantList | tableHeaders () const |
| Returns the table header values. | |
| double | tableRowHeight (int row) |
| Returns the configured row height for the specified row, or 0 if an automatic height should be used for the row. | |
Protected Member Functions | |
| void | keyPressEvent (QKeyEvent *event) override |
Friends | |
| class | QgsTableEditorDelegate |
A reusable widget 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.
Definition at line 108 of file qgstableeditorwidget.h.
| QgsTableEditorWidget::QgsTableEditorWidget | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsTableEditorWidget with the specified parent widget.
Definition at line 30 of file qgstableeditorwidget.cpp.
|
override |
Definition at line 158 of file qgstableeditorwidget.cpp.
|
signal |
Emitted whenever the active (or selected) cell changes in the widget.
| bool QgsTableEditorWidget::canMergeSelection | ( | ) | const |
Returns true if a selection has been made which can be merged.
Definition at line 867 of file qgstableeditorwidget.cpp.
| bool QgsTableEditorWidget::canSplitSelection | ( | ) | const |
Returns true if a selection has been made which can be split.
Definition at line 874 of file qgstableeditorwidget.cpp.
|
slot |
Clears the contents of the currently selected cells.
Definition at line 1021 of file qgstableeditorwidget.cpp.
| QList< int > QgsTableEditorWidget::columnsAssociatedWithSelection | ( | ) |
Returns a list of the columns associated with the current table selected cells.
Definition at line 833 of file qgstableeditorwidget.cpp.
|
slot |
Deletes all columns associated with the current selected cells.
Definition at line 986 of file qgstableeditorwidget.cpp.
|
slot |
Deletes all rows associated with the current selected cells.
Definition at line 969 of file qgstableeditorwidget.cpp.
|
slot |
Expands out the selection to include whole columns associated with the current selected cells.
Definition at line 1012 of file qgstableeditorwidget.cpp.
|
slot |
Expands out the selection to include whole rows associated with the current selected cells.
Definition at line 1003 of file qgstableeditorwidget.cpp.
| bool QgsTableEditorWidget::hasMixedSelectionNumericFormat | ( | ) |
Returns true if the current selection has a mix of numeric formats.
Definition at line 557 of file qgstableeditorwidget.cpp.
|
slot |
Inserts new columns after the current selection.
Definition at line 947 of file qgstableeditorwidget.cpp.
|
slot |
Inserts new columns before the current selection.
Definition at line 925 of file qgstableeditorwidget.cpp.
|
slot |
Inserts new rows above the current selection.
Definition at line 903 of file qgstableeditorwidget.cpp.
|
slot |
Inserts new rows below the current selection.
Definition at line 881 of file qgstableeditorwidget.cpp.
| bool QgsTableEditorWidget::isHeaderCellSelected | ( | ) | const |
Returns true if any header cells are selected.
Definition at line 859 of file qgstableeditorwidget.cpp.
|
overrideprotected |
Definition at line 343 of file qgstableeditorwidget.cpp.
|
slot |
Merges selected table cells.
Definition at line 1356 of file qgstableeditorwidget.cpp.
| QList< int > QgsTableEditorWidget::rowsAssociatedWithSelection | ( | ) |
Returns a list of the rows associated with the current table selected cells.
Definition at line 828 of file qgstableeditorwidget.cpp.
| QColor QgsTableEditorWidget::selectionBackgroundColor | ( | ) |
Returns the background color for the currently selected cells.
If the selected cells have a mix of different background colors then an invalid color will be returned.
Definition at line 593 of file qgstableeditorwidget.cpp.
| QgsProperty QgsTableEditorWidget::selectionCellProperty | ( | ) |
Returns the QgsProperty used for the contents of the currently selected cells.
If the returned value is a default constructed QgsProperty, then the selected cells have a mix of different properties.
Definition at line 662 of file qgstableeditorwidget.cpp.
| double QgsTableEditorWidget::selectionColumnWidth | ( | ) |
Returns the width (in millimeters) of the columns associated with the current selection, or 0 if an automatic column width is desired.
Definition at line 728 of file qgstableeditorwidget.cpp.
| QColor QgsTableEditorWidget::selectionForegroundColor | ( | ) |
Returns the foreground color for the currently selected cells.
If the selected cells have a mix of different foreground colors then an invalid color will be returned.
Definition at line 587 of file qgstableeditorwidget.cpp.
| Qt::Alignment QgsTableEditorWidget::selectionHorizontalAlignment | ( | ) |
Returns the horizontal alignment for the currently selected cells.
If the returned value contains both horizontal and vertical alignment flags, then the selected cells have a mix of different horizontal alignments.
Definition at line 616 of file qgstableeditorwidget.cpp.
| QgsNumericFormat * QgsTableEditorWidget::selectionNumericFormat | ( | ) |
Returns the numeric format used for the currently selected cells, or nullptr if the selection has no numeric format set.
If the selected cells have a mix of different formats then nullptr will be returned.
Definition at line 527 of file qgstableeditorwidget.cpp.
| double QgsTableEditorWidget::selectionRowHeight | ( | ) |
Returns the height (in millimeters) of the rows associated with the current selection, or 0 if an automatic row height is desired, or -1 if the selection has mixed row heights.
Definition at line 709 of file qgstableeditorwidget.cpp.
| QgsTextFormat QgsTableEditorWidget::selectionTextFormat | ( | ) |
Returns the text format for the currently selected cells.
Returns an invalid QgsTextFormat if the selection has mixed text format.
Definition at line 685 of file qgstableeditorwidget.cpp.
| Qt::Alignment QgsTableEditorWidget::selectionVerticalAlignment | ( | ) |
Returns the horizontal alignment for the currently selected cells.
If the returned value contains both horizontal and vertical alignment flags, then the selected cells have a mix of different vertical alignments.
Definition at line 639 of file qgstableeditorwidget.cpp.
|
slot |
Sets whether the table includes a header row.
Definition at line 1318 of file qgstableeditorwidget.cpp.
|
slot |
Sets the background color for the currently selected cells.
Definition at line 1077 of file qgstableeditorwidget.cpp.
|
slot |
Sets the cell contents QgsProperty for the currently selected cells.
Definition at line 1172 of file qgstableeditorwidget.cpp.
|
slot |
Sets the column width (in millimeters) for the currently selected columns, or 0 for automatic column width.
Definition at line 1287 of file qgstableeditorwidget.cpp.
|
slot |
Sets the foreground color for the currently selected cells.
Definition at line 1040 of file qgstableeditorwidget.cpp.
|
slot |
Sets the horizontal alignment for the currently selected cells.
Definition at line 1110 of file qgstableeditorwidget.cpp.
| void QgsTableEditorWidget::setSelectionNumericFormat | ( | QgsNumericFormat * | format | ) |
Sets the numeric format to use for the currently selected cells.
Ownership of format is transferred to the widget.
Definition at line 485 of file qgstableeditorwidget.cpp.
|
slot |
Sets the row height (in millimeters) for the currently selected rows, or 0 for automatic row height.
Definition at line 1253 of file qgstableeditorwidget.cpp.
|
slot |
Sets the text format for the selected cells.
Definition at line 1223 of file qgstableeditorwidget.cpp.
|
slot |
Sets the vertical alignment for the currently selected cells.
Definition at line 1141 of file qgstableeditorwidget.cpp.
| void QgsTableEditorWidget::setTableColumnWidth | ( | int | column, |
| double | width ) |
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().
Definition at line 801 of file qgstableeditorwidget.cpp.
| void QgsTableEditorWidget::setTableContents | ( | const QgsTableContents & | contents | ) |
Sets the contents to show in the editor widget.
Definition at line 371 of file qgstableeditorwidget.cpp.
|
slot |
Sets the table headers.
Definition at line 1332 of file qgstableeditorwidget.cpp.
| void QgsTableEditorWidget::setTableRowHeight | ( | int | row, |
| double | height ) |
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().
Definition at line 769 of file qgstableeditorwidget.cpp.
|
slot |
Splits (un-merges) selected table cells.
Definition at line 1409 of file qgstableeditorwidget.cpp.
|
signal |
Emitted whenever the table contents are changed.
| double QgsTableEditorWidget::tableColumnWidth | ( | int | column | ) |
Returns the configured column width for the specified column, or 0 if an automatic width should be used for the column.
Definition at line 758 of file qgstableeditorwidget.cpp.
| QgsTableContents QgsTableEditorWidget::tableContents | ( | ) | const |
Returns the current contents of the editor widget table.
Definition at line 432 of file qgstableeditorwidget.cpp.
| QVariantList QgsTableEditorWidget::tableHeaders | ( | ) | const |
Returns the table header values.
Definition at line 838 of file qgstableeditorwidget.cpp.
| double QgsTableEditorWidget::tableRowHeight | ( | int | row | ) |
Returns the configured row height for the specified row, or 0 if an automatic height should be used for the row.
Definition at line 747 of file qgstableeditorwidget.cpp.
|
friend |
Definition at line 518 of file qgstableeditorwidget.h.