QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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. More...
 
void cellPropertyChanged (const QgsProperty &property)
 Emitted when the cell contents property shown in the widget is changed. More...
 
void columnWidthChanged (double width)
 Emitted whenever the column width shown in the widget is changed. More...
 
void horizontalAlignmentChanged (Qt::Alignment alignment)
 Emitted when the horizontal alignment shown in the widget is changed. More...
 
void numberFormatChanged ()
 Emitted whenever the numeric format shown in the widget is changed. More...
 
void rowHeightChanged (double height)
 Emitted whenever the row height shown in the widget is changed. More...
 
void textFormatChanged ()
 Emitted whenever the text format shown in the widget is changed. More...
 
void verticalAlignmentChanged (Qt::Alignment alignment)
 Emitted when the vertical alignment shown in the widget is changed. More...
 
- Signals inherited from QgsPanelWidget
void panelAccepted (QgsPanelWidget *panel)
 Emitted when the panel is accepted by the user. More...
 
void showPanel (QgsPanelWidget *panel)
 Emit when you require a panel to be show in the interface. More...
 
void widgetChanged ()
 Emitted when the widget state changes. More...
 

Public Member Functions

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

Additional Inherited Members

- Public Slots inherited from QgsPanelWidget
void acceptPanel ()
 Accept the panel. More...
 
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. More...
 
- 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. More...
 
- Protected Member Functions inherited from QgsPanelWidget
void keyPressEvent (QKeyEvent *event) override
 Overridden key press event to handle the esc event on the widget. More...
 

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 23 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.

Since
QGIS 3.0

Implements QgsExpressionContextGenerator.

Definition at line 231 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 138 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 226 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 151 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 216 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 185 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 196 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 158 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 174 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 167 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 206 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 146 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: