QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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:
45
49 QgsTableEditorFormattingWidget( QWidget *parent = nullptr );
51
60 QgsNumericFormat *numericFormat() SIP_TRANSFERBACK;
61
68 QgsTextFormat textFormat() const;
69
75 void setBackgroundColor( const QColor &color );
76
84 void setNumericFormat( QgsNumericFormat *format, bool isMixedFormat );
85
92 void setTextFormat( const QgsTextFormat &format );
93
100 void setRowHeight( double height );
101
108 void setColumnWidth( double width );
109
118 void setHorizontalAlignment( Qt::Alignment alignment );
119
128 void setVerticalAlignment( Qt::Alignment alignment );
129
135 void setCellProperty( const QgsProperty &property );
136
141 void setLayer( QgsMapLayer *layer );
142
148 void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator );
149
150 QgsExpressionContext createExpressionContext() const override;
151
152 signals:
153
159 void backgroundColorChanged( const QColor &color );
160
164 void numberFormatChanged();
165
171 void textFormatChanged();
172
176 void rowHeightChanged( double height );
177
181 void columnWidthChanged( double width );
182
188 void horizontalAlignmentChanged( Qt::Alignment alignment );
189
195 void verticalAlignmentChanged( Qt::Alignment alignment );
196
202 void cellPropertyChanged( const QgsProperty &property );
203
204 private:
205
206 std::unique_ptr< QgsNumericFormat > mNumericFormat;
207 int mBlockSignals = 0;
208 QgsExpressionContextGenerator *mContextGenerator = nullptr;
209
210};
211
212#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