QGIS API Documentation 3.41.0-Master (57ec4277f5e)
|
A reusable window for editing simple spreadsheet-style tables. More...
#include <qgstableeditordialog.h>
Signals | |
void | includeHeaderChanged (bool included) |
Emitted whenever the "include table header" setting is changed. | |
void | tableChanged () |
Emitted whenever the table contents are changed. | |
Public Member Functions | |
QgsTableEditorDialog (QWidget *parent=nullptr) | |
Constructor for QgsTableEditorDialog with the specified parent widget. | |
bool | includeTableHeader () const |
Returns true if the table includes a header row. | |
QgsMapLayer * | layer () const |
Returns the (possibly nullptr ) layer associated with the expression editor context. | |
void | registerExpressionContextGenerator (QgsExpressionContextGenerator *generator) |
Register an expression context generator class that will be used to retrieve an expression context for the editor when required. | |
void | setIncludeTableHeader (bool included) |
Sets whether the table includes a header row. | |
void | setLayer (QgsMapLayer *layer) |
Sets the layer to be used associated with the expression editor context. | |
void | setTable (QgsLayoutItemManualTable *table) |
Sets the table associated with the editor. | |
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. | |
bool | setTableContentsFromClipboard () |
Parses the clipboard text into contents to show in the editor widget. | |
void | setTableHeaders (const QVariantList &headers) |
Sets the table headers. | |
void | setTableRowHeight (int row, double height) |
Sets the configured row height for the specified row. | |
QgsLayoutItemManualTable * | table () const |
Returns the manual table associated with the editor. | |
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 | closeEvent (QCloseEvent *) override |
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.
Definition at line 44 of file qgstableeditordialog.h.
QgsTableEditorDialog::QgsTableEditorDialog | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsTableEditorDialog with the specified parent widget.
Definition at line 34 of file qgstableeditordialog.cpp.
|
overrideprotected |
Definition at line 149 of file qgstableeditordialog.cpp.
|
signal |
Emitted whenever the "include table header" setting is changed.
bool QgsTableEditorDialog::includeTableHeader | ( | ) | const |
Returns true
if the table includes a header row.
Definition at line 281 of file qgstableeditordialog.cpp.
QgsMapLayer * QgsTableEditorDialog::layer | ( | ) | const |
Returns the (possibly nullptr
) layer associated with the expression editor context.
Definition at line 156 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::registerExpressionContextGenerator | ( | QgsExpressionContextGenerator * | generator | ) |
Register an expression context generator class that will be used to retrieve an expression context for the editor when required.
Definition at line 301 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::setIncludeTableHeader | ( | bool | included | ) |
Sets whether the table includes a header row.
Definition at line 286 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::setLayer | ( | QgsMapLayer * | layer | ) |
Sets the layer to be used associated with the expression editor context.
Definition at line 161 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::setTable | ( | QgsLayoutItemManualTable * | table | ) |
Sets the table associated with the editor.
Definition at line 175 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::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 276 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::setTableContents | ( | const QgsTableContents & | contents | ) |
Sets the contents to show in the editor widget.
Definition at line 247 of file qgstableeditordialog.cpp.
bool QgsTableEditorDialog::setTableContentsFromClipboard | ( | ) |
Parses the clipboard text into contents to show in the editor widget.
true
if the clipboard was successfully parsedDefinition at line 212 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::setTableHeaders | ( | const QVariantList & | headers | ) |
Sets the table headers.
Definition at line 296 of file qgstableeditordialog.cpp.
void QgsTableEditorDialog::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 271 of file qgstableeditordialog.cpp.
QgsLayoutItemManualTable * QgsTableEditorDialog::table | ( | ) | const |
Returns the manual table associated with the editor.
Definition at line 170 of file qgstableeditordialog.cpp.
|
signal |
Emitted whenever the table contents are changed.
double QgsTableEditorDialog::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 266 of file qgstableeditordialog.cpp.
QgsTableContents QgsTableEditorDialog::tableContents | ( | ) | const |
Returns the current contents of the editor widget table.
Definition at line 256 of file qgstableeditordialog.cpp.
QVariantList QgsTableEditorDialog::tableHeaders | ( | ) | const |
Returns the table header values.
Definition at line 291 of file qgstableeditordialog.cpp.
double QgsTableEditorDialog::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 261 of file qgstableeditordialog.cpp.