QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Signals | Public Member Functions | List of all members
QgsTableEditorFormattingWidget Class Reference

A reusable widget for formatting the contents of a QgsTableCell. More...

#include <qgstableeditorformattingwidget.h>

Inheritance diagram for QgsTableEditorFormattingWidget:
Inheritance graph
[legend]

Signals

void backgroundColorChanged (const QColor &color)
 Emitted whenever the cell background color is changed in the widget.
 
void cellPropertyChanged (const QgsProperty &property)
 Emitted when the cell contents property shown in the widget is changed.
 
void columnWidthChanged (double width)
 Emitted whenever the column width shown in the widget is changed.
 
void horizontalAlignmentChanged (Qt::Alignment alignment)
 Emitted when the horizontal alignment shown in the widget is changed.
 
void numberFormatChanged ()
 Emitted whenever the numeric format shown in the widget is changed.
 
void rowHeightChanged (double height)
 Emitted whenever the row height shown in the widget is changed.
 
void textFormatChanged ()
 Emitted whenever the text format shown in the widget is changed.
 
void verticalAlignmentChanged (Qt::Alignment alignment)
 Emitted when the vertical alignment shown in the widget is changed.
 
- Signals inherited from QgsPanelWidget
void panelAccepted (QgsPanelWidget *panel)
 Emitted when the panel is accepted by the user.
 
void showPanel (QgsPanelWidget *panel)
 Emit when you require a panel to be show in the interface.
 
void widgetChanged ()
 Emitted when the widget state changes.
 

Public Member Functions

 QgsTableEditorFormattingWidget (QWidget *parent=nullptr)
 Constructor for QgsTableEditorFormattingWidget with the specified parent widget.
 
 ~QgsTableEditorFormattingWidget () override
 
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context.
 
QgsNumericFormatnumericFormat ()
 Returns the current numeric format shown in the widget, or a nullptr if no numeric format is set.
 
void registerExpressionContextGenerator (QgsExpressionContextGenerator *generator)
 Register an expression context generator class that will be used to retrieve an expression context for the widget when required.
 
void setBackgroundColor (const QColor &color)
 Sets the cell background color to show in the widget.
 
void setCellProperty (const QgsProperty &property)
 Sets the cell content's property to show in the widget.
 
void setColumnWidth (double width)
 Sets the column width to show in the widget, or 0 for automatic width.
 
void setHorizontalAlignment (Qt::Alignment alignment)
 Sets the horizontal alignment to show in the widget.
 
void setLayer (QgsMapLayer *layer)
 Set the layer to be used for in the expression editor context.
 
void setNumericFormat (QgsNumericFormat *format, bool isMixedFormat)
 Sets the numeric format to show in the widget, or nullptr if no numeric format is set.
 
void setRowHeight (double height)
 Sets the row height to show in the widget, or 0 for automatic height.
 
void setTextFormat (const QgsTextFormat &format)
 Sets the text format to show in the widget.
 
void setVerticalAlignment (Qt::Alignment alignment)
 Sets the vertical alignment to show in the widget.
 
QgsTextFormat textFormat () const
 Returns the current text format shown in the widget.
 
- Public Member Functions inherited from QgsPanelWidget
 QgsPanelWidget (QWidget *parent=nullptr)
 Base class for any widget that can be shown as a inline panel.
 
virtual bool applySizeConstraintsToStack () const
 Returns true if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.
 
bool autoDelete ()
 The the auto delete property on the widget.
 
void connectChildPanel (QgsPanelWidget *panel)
 Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
 
void connectChildPanels (const QList< QgsPanelWidget * > &panels)
 Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
 
bool dockMode ()
 Returns the dock mode state.
 
virtual QMenu * menuButtonMenu ()
 Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required.
 
virtual QString menuButtonTooltip () const
 Returns the (translated) tooltip text to use for the menu button for this panel.
 
QString panelTitle ()
 The title of the panel.
 
void setAutoDelete (bool autoDelete)
 The the auto delete property on the widget.
 
virtual void setDockMode (bool dockMode)
 Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
 
void setPanelTitle (const QString &panelTitle)
 Set the title of the panel when shown in the interface.
 
- Public Member Functions inherited from QgsExpressionContextGenerator
virtual ~QgsExpressionContextGenerator ()=default
 

Additional Inherited Members

- Public Slots inherited from QgsPanelWidget
void acceptPanel ()
 Accept the panel.
 
void openPanel (QgsPanelWidget *panel)
 Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the showPanel signal for connected slots to handle the open event.
 
- Static Public Member Functions inherited from QgsPanelWidget
static QgsPanelWidgetfindParentPanel (QWidget *widget)
 Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.
 
- Protected Member Functions inherited from QgsPanelWidget
void keyPressEvent (QKeyEvent *event) override
 Overridden key press event to handle the esc event on the widget.
 

Detailed Description

A reusable widget for formatting the contents of a QgsTableCell.

The editor has support for table foreground and background colors, and numeric formats.

Note
Not available in Python bindings
Since
QGIS 3.12

Definition at line 41 of file qgstableeditorformattingwidget.h.

Constructor & Destructor Documentation

◆ QgsTableEditorFormattingWidget()

QgsTableEditorFormattingWidget::QgsTableEditorFormattingWidget ( QWidget *  parent = nullptr)

Constructor for QgsTableEditorFormattingWidget with the specified parent widget.

Definition at line 24 of file qgstableeditorformattingwidget.cpp.

◆ ~QgsTableEditorFormattingWidget()

QgsTableEditorFormattingWidget::~QgsTableEditorFormattingWidget ( )
overridedefault

Member Function Documentation

◆ backgroundColorChanged

void QgsTableEditorFormattingWidget::backgroundColorChanged ( const QColor &  color)
signal

Emitted whenever the cell background color is changed in the widget.

See also
setBackgroundColor()

◆ cellPropertyChanged

void QgsTableEditorFormattingWidget::cellPropertyChanged ( const QgsProperty property)
signal

Emitted when the cell contents property shown in the widget is changed.

Since
QGIS 3.16

◆ columnWidthChanged

void QgsTableEditorFormattingWidget::columnWidthChanged ( double  width)
signal

Emitted whenever the column width shown in the widget is changed.

◆ createExpressionContext()

QgsExpressionContext QgsTableEditorFormattingWidget::createExpressionContext ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

Implements QgsExpressionContextGenerator.

Definition at line 226 of file qgstableeditorformattingwidget.cpp.

◆ horizontalAlignmentChanged

void QgsTableEditorFormattingWidget::horizontalAlignmentChanged ( Qt::Alignment  alignment)
signal

Emitted when the horizontal alignment shown in the widget is changed.

Since
QGIS 3.16

◆ numberFormatChanged

void QgsTableEditorFormattingWidget::numberFormatChanged ( )
signal

Emitted whenever the numeric format shown in the widget is changed.

◆ numericFormat()

QgsNumericFormat * QgsTableEditorFormattingWidget::numericFormat ( )

Returns the current numeric format shown in the widget, or a nullptr if no numeric format is set.

The caller takes ownership of the returned object.

See also
setNumericFormat()

Definition at line 128 of file qgstableeditorformattingwidget.cpp.

◆ registerExpressionContextGenerator()

void QgsTableEditorFormattingWidget::registerExpressionContextGenerator ( QgsExpressionContextGenerator generator)

Register an expression context generator class that will be used to retrieve an expression context for the widget when required.

Since
QGIS 3.16

Definition at line 221 of file qgstableeditorformattingwidget.cpp.

◆ rowHeightChanged

void QgsTableEditorFormattingWidget::rowHeightChanged ( double  height)
signal

Emitted whenever the row height shown in the widget is changed.

◆ setBackgroundColor()

void QgsTableEditorFormattingWidget::setBackgroundColor ( const QColor &  color)

Sets the cell background color to show in the widget.

See also
backgroundColorChanged()

Definition at line 141 of file qgstableeditorformattingwidget.cpp.

◆ setCellProperty()

void QgsTableEditorFormattingWidget::setCellProperty ( const QgsProperty property)

Sets the cell content's property to show in the widget.

Since
QGIS 3.16

Definition at line 206 of file qgstableeditorformattingwidget.cpp.

◆ setColumnWidth()

void QgsTableEditorFormattingWidget::setColumnWidth ( double  width)

Sets the column width to show in the widget, or 0 for automatic width.

See also
columnWidthChanged()
setRowHeight()

Definition at line 175 of file qgstableeditorformattingwidget.cpp.

◆ setHorizontalAlignment()

void QgsTableEditorFormattingWidget::setHorizontalAlignment ( Qt::Alignment  alignment)

Sets the horizontal alignment to show in the widget.

See also
horizontalAlignmentChanged()
setVerticalAlignment()
Since
QGIS 3.16

Definition at line 186 of file qgstableeditorformattingwidget.cpp.

◆ setLayer()

void QgsTableEditorFormattingWidget::setLayer ( QgsMapLayer layer)

Set the layer to be used for in the expression editor context.

Since
QGIS 3.30

Definition at line 216 of file qgstableeditorformattingwidget.cpp.

◆ setNumericFormat()

void QgsTableEditorFormattingWidget::setNumericFormat ( QgsNumericFormat format,
bool  isMixedFormat 
)

Sets the numeric format to show in the widget, or nullptr if no numeric format is set.

if isMixedFormat is true then the widget will be set to indicate a "mixed format" setting.

See also
numericFormat()

Definition at line 148 of file qgstableeditorformattingwidget.cpp.

◆ setRowHeight()

void QgsTableEditorFormattingWidget::setRowHeight ( double  height)

Sets the row height to show in the widget, or 0 for automatic height.

See also
rowHeightChanged()
setColumnWidth()

Definition at line 164 of file qgstableeditorformattingwidget.cpp.

◆ setTextFormat()

void QgsTableEditorFormattingWidget::setTextFormat ( const QgsTextFormat format)

Sets the text format to show in the widget.

See also
textFormat()
Since
QGIS 3.16

Definition at line 157 of file qgstableeditorformattingwidget.cpp.

◆ setVerticalAlignment()

void QgsTableEditorFormattingWidget::setVerticalAlignment ( Qt::Alignment  alignment)

Sets the vertical alignment to show in the widget.

See also
verticalAlignmentChanged()
setHorizontalAlignment()
Since
QGIS 3.16

Definition at line 196 of file qgstableeditorformattingwidget.cpp.

◆ textFormat()

QgsTextFormat QgsTableEditorFormattingWidget::textFormat ( ) const

Returns the current text format shown in the widget.

See also
setTextFormat()
Since
QGIS 3.16

Definition at line 136 of file qgstableeditorformattingwidget.cpp.

◆ textFormatChanged

void QgsTableEditorFormattingWidget::textFormatChanged ( )
signal

Emitted whenever the text format shown in the widget is changed.

Since
QGIS 3.16

◆ verticalAlignmentChanged

void QgsTableEditorFormattingWidget::verticalAlignmentChanged ( Qt::Alignment  alignment)
signal

Emitted when the vertical alignment shown in the widget is changed.

Since
QGIS 3.16

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