QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgstableeditorformattingwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstableeditorformattingwidget.h
3 --------------------------------
4 begin : January 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSTABLEEDITORFORMATTINGWIDGET_H
16#define QGSTABLEEDITORFORMATTINGWIDGET_H
17
18#include "ui_qgstableeditorformattingwidgetbase.h"
19
20#include <memory>
21
22#include "qgis_gui.h"
24#include "qgspanelwidget.h"
25
26#define SIP_NO_FILE
27
29class QgsProperty;
30
43class GUI_EXPORT QgsTableEditorFormattingWidget : public QgsPanelWidget, public QgsExpressionContextGenerator, private Ui::QgsTableEditorFormattingWidgetBase
44{
45 Q_OBJECT
46 public:
50 QgsTableEditorFormattingWidget( QWidget *parent = nullptr );
52
62
70
76 void setBackgroundColor( const QColor &color );
77
85 void setNumericFormat( QgsNumericFormat *format, bool isMixedFormat );
86
93 void setTextFormat( const QgsTextFormat &format );
94
101 void setRowHeight( double height );
102
109 void setColumnWidth( double width );
110
119 void setHorizontalAlignment( Qt::Alignment alignment );
120
129 void setVerticalAlignment( Qt::Alignment alignment );
130
136 void setCellProperty( const QgsProperty &property );
137
142 void setLayer( QgsMapLayer *layer );
143
150
152
153 signals:
154
160 void backgroundColorChanged( const QColor &color );
161
166
173
177 void rowHeightChanged( double height );
178
182 void columnWidthChanged( double width );
183
189 void horizontalAlignmentChanged( Qt::Alignment alignment );
190
196 void verticalAlignmentChanged( Qt::Alignment alignment );
197
203 void cellPropertyChanged( const QgsProperty &property );
204
205 private:
206 std::unique_ptr<QgsNumericFormat> mNumericFormat;
207 int mBlockSignals = 0;
208 QgsExpressionContextGenerator *mContextGenerator = nullptr;
209};
210
211#endif // QGSTABLEEDITORFORMATTINGWIDGET_H
Abstract interface for generating an expression context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Base class for all map layer types.
Definition qgsmaplayer.h:80
Abstract base class for numeric formatters, which allow for formatting a numeric value for display.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
A store for object properties.
void cellPropertyChanged(const QgsProperty &property)
Emitted when the cell contents property 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.
void rowHeightChanged(double height)
Emitted whenever the row height shown in the widget is changed.
QgsTextFormat textFormat() const
Returns the current text format shown in the widget.
void setVerticalAlignment(Qt::Alignment alignment)
Sets the vertical alignment to show in the widget.
void setTextFormat(const QgsTextFormat &format)
Sets the text format to show in the widget.
void registerExpressionContextGenerator(QgsExpressionContextGenerator *generator)
Register an expression context generator class that will be used to retrieve an expression context fo...
QgsTableEditorFormattingWidget(QWidget *parent=nullptr)
Constructor for QgsTableEditorFormattingWidget with the specified parent widget.
void setBackgroundColor(const QColor &color)
Sets the cell background color to show in the widget.
~QgsTableEditorFormattingWidget() override
void backgroundColorChanged(const QColor &color)
Emitted whenever the cell background color is changed in the widget.
QgsNumericFormat * numericFormat()
Returns the current numeric format shown in the widget, or a nullptr if no numeric format is set.
void setCellProperty(const QgsProperty &property)
Sets the cell content's property to show in the widget.
void numberFormatChanged()
Emitted whenever the numeric format shown in the widget is changed.
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 setNumericFormat(QgsNumericFormat *format, bool isMixedFormat)
Sets the numeric format to show in the widget, or nullptr if no numeric format is set.
void horizontalAlignmentChanged(Qt::Alignment alignment)
Emitted when the horizontal alignment shown in the widget is changed.
void setLayer(QgsMapLayer *layer)
Set the layer to be used for in the expression editor context.
void columnWidthChanged(double width)
Emitted whenever the column width shown in the widget is changed.
void setRowHeight(double height)
Sets the row height to show in the widget, or 0 for automatic height.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Container for all settings relating to text rendering.
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48