QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsTableEditorDialog Class Reference

A reusable window for editing simple spreadsheet-style tables. More...

#include <qgstableeditordialog.h>

Inheritance diagram for QgsTableEditorDialog:

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.
QgsMapLayerlayer () 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.
QgsLayoutItemManualTabletable () 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

Detailed Description

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.

Since
QGIS 3.12

Definition at line 46 of file qgstableeditordialog.h.

Constructor & Destructor Documentation

◆ QgsTableEditorDialog()

QgsTableEditorDialog::QgsTableEditorDialog ( QWidget * parent = nullptr)

Constructor for QgsTableEditorDialog with the specified parent widget.

Definition at line 36 of file qgstableeditordialog.cpp.

Member Function Documentation

◆ closeEvent()

void QgsTableEditorDialog::closeEvent ( QCloseEvent * )
overrideprotected

Definition at line 151 of file qgstableeditordialog.cpp.

◆ includeHeaderChanged

void QgsTableEditorDialog::includeHeaderChanged ( bool included)
signal

Emitted whenever the "include table header" setting is changed.

◆ includeTableHeader()

bool QgsTableEditorDialog::includeTableHeader ( ) const

Returns true if the table includes a header row.

See also
setIncludeTableHeader()

Definition at line 283 of file qgstableeditordialog.cpp.

◆ layer()

QgsMapLayer * QgsTableEditorDialog::layer ( ) const

Returns the (possibly nullptr) layer associated with the expression editor context.

Since
QGIS 3.40

Definition at line 158 of file qgstableeditordialog.cpp.

◆ registerExpressionContextGenerator()

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.

Since
QGIS 3.16

Definition at line 303 of file qgstableeditordialog.cpp.

◆ setIncludeTableHeader()

void QgsTableEditorDialog::setIncludeTableHeader ( bool included)

Sets whether the table includes a header row.

See also
includeTableHeader()

Definition at line 288 of file qgstableeditordialog.cpp.

◆ setLayer()

void QgsTableEditorDialog::setLayer ( QgsMapLayer * layer)

Sets the layer to be used associated with the expression editor context.

Since
QGIS 3.40

Definition at line 163 of file qgstableeditordialog.cpp.

◆ setTable()

void QgsTableEditorDialog::setTable ( QgsLayoutItemManualTable * table)

Sets the table associated with the editor.

Since
QGIS 3.42

Definition at line 177 of file qgstableeditordialog.cpp.

◆ setTableColumnWidth()

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().

See also
tableColumnWidth()

Definition at line 278 of file qgstableeditordialog.cpp.

◆ setTableContents()

void QgsTableEditorDialog::setTableContents ( const QgsTableContents & contents)

Sets the contents to show in the editor widget.

See also
tableContents()

Definition at line 249 of file qgstableeditordialog.cpp.

◆ setTableContentsFromClipboard()

bool QgsTableEditorDialog::setTableContentsFromClipboard ( )

Parses the clipboard text into contents to show in the editor widget.

Returns
true if the clipboard was successfully parsed
See also
tableContents()

Definition at line 214 of file qgstableeditordialog.cpp.

◆ setTableHeaders()

void QgsTableEditorDialog::setTableHeaders ( const QVariantList & headers)

Sets the table headers.

See also
tableHeaders()

Definition at line 298 of file qgstableeditordialog.cpp.

◆ setTableRowHeight()

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().

See also
tableRowHeight()

Definition at line 273 of file qgstableeditordialog.cpp.

◆ table()

QgsLayoutItemManualTable * QgsTableEditorDialog::table ( ) const

Returns the manual table associated with the editor.

Since
QGIS 3.42

Definition at line 172 of file qgstableeditordialog.cpp.

◆ tableChanged

void QgsTableEditorDialog::tableChanged ( )
signal

Emitted whenever the table contents are changed.

◆ tableColumnWidth()

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.

See also
setTableColumnWidth()

Definition at line 268 of file qgstableeditordialog.cpp.

◆ tableContents()

QgsTableContents QgsTableEditorDialog::tableContents ( ) const

Returns the current contents of the editor widget table.

See also
setTableContents()

Definition at line 258 of file qgstableeditordialog.cpp.

◆ tableHeaders()

QVariantList QgsTableEditorDialog::tableHeaders ( ) const

Returns the table header values.

See also
setTableHeaders()

Definition at line 293 of file qgstableeditordialog.cpp.

◆ tableRowHeight()

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.

See also
setTableRowHeight()

Definition at line 263 of file qgstableeditordialog.cpp.


The documentation for this class was generated from the following files: