QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 "qgis_gui.h"
19#include "ui_qgstableeditorformattingwidgetbase.h"
20#include "qgspanelwidget.h"
22#include <memory>
23
24#define SIP_NO_FILE
25
27class QgsProperty;
28
41class GUI_EXPORT QgsTableEditorFormattingWidget : public QgsPanelWidget, public QgsExpressionContextGenerator, private Ui::QgsTableEditorFormattingWidgetBase
42{
43 Q_OBJECT
44 public:
48 QgsTableEditorFormattingWidget( QWidget *parent = nullptr );
50
59 QgsNumericFormat *numericFormat() SIP_TRANSFERBACK;
60
67 QgsTextFormat textFormat() const;
68
74 void setBackgroundColor( const QColor &color );
75
83 void setNumericFormat( QgsNumericFormat *format, bool isMixedFormat );
84
91 void setTextFormat( const QgsTextFormat &format );
92
99 void setRowHeight( double height );
100
107 void setColumnWidth( double width );
108
117 void setHorizontalAlignment( Qt::Alignment alignment );
118
127 void setVerticalAlignment( Qt::Alignment alignment );
128
134 void setCellProperty( const QgsProperty &property );
135
140 void setLayer( QgsMapLayer *layer );
141
147 void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator );
148
149 QgsExpressionContext createExpressionContext() const override;
150
151 signals:
152
158 void backgroundColorChanged( const QColor &color );
159
163 void numberFormatChanged();
164
170 void textFormatChanged();
171
175 void rowHeightChanged( double height );
176
180 void columnWidthChanged( double width );
181
187 void horizontalAlignmentChanged( Qt::Alignment alignment );
188
194 void verticalAlignmentChanged( Qt::Alignment alignment );
195
201 void cellPropertyChanged( const QgsProperty &property );
202
203 private:
204 std::unique_ptr<QgsNumericFormat> mNumericFormat;
205 int mBlockSignals = 0;
206 QgsExpressionContextGenerator *mContextGenerator = nullptr;
207};
208
209#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:76
A numeric formatter allows for formatting a numeric value for display, using a variety of different f...
Base class for any widget that can be shown as a inline panel.
A store for object properties.
A reusable widget for formatting the contents of a QgsTableCell.
~QgsTableEditorFormattingWidget() override
Container for all settings relating to text rendering.
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48