QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
A reusable widget for formatting the contents of a QgsTableCell. More...
#include <qgstableeditorformattingwidget.h>
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... | |
QgsNumericFormat * | numericFormat () |
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 |
virtual QgsExpressionContext | createExpressionContext () const =0 |
This method needs to be reimplemented in all classes which implement this interface and return an expression context. More... | |
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 QgsPanelWidget * | findParentPanel (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... | |
A reusable widget for formatting the contents of a QgsTableCell.
The editor has support for table foreground and background colors, and numeric formats.
Definition at line 41 of file qgstableeditorformattingwidget.h.
QgsTableEditorFormattingWidget::QgsTableEditorFormattingWidget | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsTableEditorFormattingWidget with the specified parent widget.
Definition at line 23 of file qgstableeditorformattingwidget.cpp.
|
overridedefault |
|
signal |
Emitted whenever the cell background color is changed in the widget.
|
signal |
Emitted when the cell contents property shown in the widget is changed.
|
signal |
Emitted whenever the column width shown in the widget is changed.
|
overridevirtual |
This method needs to be reimplemented in all classes which implement this interface and return an expression context.
Implements QgsExpressionContextGenerator.
Definition at line 231 of file qgstableeditorformattingwidget.cpp.
|
signal |
Emitted when the horizontal alignment shown in the widget is changed.
|
signal |
Emitted whenever the numeric format shown in the widget is changed.
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.
Definition at line 138 of file qgstableeditorformattingwidget.cpp.
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.
Definition at line 226 of file qgstableeditorformattingwidget.cpp.
|
signal |
Emitted whenever the row height shown in the widget is changed.
void QgsTableEditorFormattingWidget::setBackgroundColor | ( | const QColor & | color | ) |
Sets the cell background color to show in the widget.
Definition at line 151 of file qgstableeditorformattingwidget.cpp.
void QgsTableEditorFormattingWidget::setCellProperty | ( | const QgsProperty & | property | ) |
Sets the cell content's property to show in the widget.
Definition at line 216 of file qgstableeditorformattingwidget.cpp.
void QgsTableEditorFormattingWidget::setColumnWidth | ( | double | width | ) |
Sets the column width to show in the widget, or 0 for automatic width.
Definition at line 185 of file qgstableeditorformattingwidget.cpp.
void QgsTableEditorFormattingWidget::setHorizontalAlignment | ( | Qt::Alignment | alignment | ) |
Sets the horizontal alignment to show in the widget.
Definition at line 196 of file qgstableeditorformattingwidget.cpp.
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.
Definition at line 158 of file qgstableeditorformattingwidget.cpp.
void QgsTableEditorFormattingWidget::setRowHeight | ( | double | height | ) |
Sets the row height to show in the widget, or 0 for automatic height.
Definition at line 174 of file qgstableeditorformattingwidget.cpp.
void QgsTableEditorFormattingWidget::setTextFormat | ( | const QgsTextFormat & | format | ) |
Sets the text format to show in the widget.
Definition at line 167 of file qgstableeditorformattingwidget.cpp.
void QgsTableEditorFormattingWidget::setVerticalAlignment | ( | Qt::Alignment | alignment | ) |
Sets the vertical alignment to show in the widget.
Definition at line 206 of file qgstableeditorformattingwidget.cpp.
QgsTextFormat QgsTableEditorFormattingWidget::textFormat | ( | ) | const |
Returns the current text format shown in the widget.
Definition at line 146 of file qgstableeditorformattingwidget.cpp.
|
signal |
Emitted whenever the text format shown in the widget is changed.
|
signal |
Emitted when the vertical alignment shown in the widget is changed.