QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgstableeditordialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstableeditordialog.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 QGSTABLEEDITORDIALOG_H
16#define QGSTABLEEDITORDIALOG_H
17
18#include "ui_qgstableeditorbase.h"
19
20#include "qgis_gui.h"
21#include "qgstablecell.h"
22
23#include <QMainWindow>
24#include <QPointer>
25
27class QgsMessageBar;
28class QgsDockWidget;
32class QgsMapLayer;
34
46class GUI_EXPORT QgsTableEditorDialog : public QMainWindow, private Ui::QgsTableEditorBase
47{
48 Q_OBJECT
49 public:
53 QgsTableEditorDialog( QWidget *parent = nullptr );
54
60 void setTableContents( const QgsTableContents &contents );
61
68
70
77
84 double tableRowHeight( int row );
85
92 double tableColumnWidth( int column );
93
102 void setTableRowHeight( int row, double height );
103
112 void setTableColumnWidth( int column, double width );
113
119 bool includeTableHeader() const;
120
126 void setIncludeTableHeader( bool included );
127
133 QVariantList tableHeaders() const;
134
140 void setTableHeaders( const QVariantList &headers );
141
148
153 QgsMapLayer *layer() const;
154
159 void setLayer( QgsMapLayer *layer );
160
166
172
173 signals:
174
179
183 void includeHeaderChanged( bool included );
184
185 protected:
186 void closeEvent( QCloseEvent * ) override;
187
188 private:
189 QgsTableEditorWidget *mTableWidget = nullptr;
190 QgsMessageBar *mMessageBar = nullptr;
191 QgsDockWidget *mPropertiesDock = nullptr;
192 QgsPanelWidgetStack *mPropertiesStack = nullptr;
193 QgsTableEditorFormattingWidget *mFormattingWidget = nullptr;
194 bool mBlockSignals = false;
195 QPointer<QgsMapLayer> mLayer;
196 QgsLayoutItemManualTable *mTable = nullptr;
197
198 void updateActionsFromSelection();
199};
200
201#endif // QGSTABLEEDITORSHEETWIDGET_H
A QDockWidget subclass with more fine-grained control over how the widget is closed or opened.
Abstract interface for generating an expression context.
A layout table subclass that displays manually entered (and formatted) content.
Base class for all map layer types.
Definition qgsmaplayer.h:80
A bar for displaying non-blocking messages to the user.
A stack widget to manage multiple overlapping stacked panels.
void setIncludeTableHeader(bool included)
Sets whether the table includes a header row.
void setTable(QgsLayoutItemManualTable *table)
Sets the table associated with the editor.
QgsTableContents tableContents() const
Returns the current contents of the editor widget table.
void setTableHeaders(const QVariantList &headers)
Sets the table headers.
bool includeTableHeader() const
Returns true if the table includes a header row.
QgsTableEditorDialog(QWidget *parent=nullptr)
Constructor for QgsTableEditorDialog with the specified parent widget.
void includeHeaderChanged(bool included)
Emitted whenever the "include table header" setting is changed.
void setTableColumnWidth(int column, double width)
Sets the configured column width for the specified column.
void tableChanged()
Emitted whenever the table contents are changed.
void setTableRowHeight(int row, double height)
Sets the configured row height for the specified row.
void registerExpressionContextGenerator(QgsExpressionContextGenerator *generator)
Register an expression context generator class that will be used to retrieve an expression context fo...
bool setTableContentsFromClipboard()
Parses the clipboard text into contents to show in the editor widget.
QVariantList tableHeaders() const
Returns the table header values.
void closeEvent(QCloseEvent *) override
QgsMapLayer * layer() const
Returns the (possibly nullptr) layer associated with the expression editor context.
double tableRowHeight(int row)
Returns the configured row height for the specified row, or 0 if an automatic height should be used f...
double tableColumnWidth(int column)
Returns the configured column width for the specified column, or 0 if an automatic width should be us...
QgsLayoutItemManualTable * table() const
Returns the manual table associated with the editor.
void setLayer(QgsMapLayer *layer)
Sets the layer to be used associated with the expression editor context.
void setTableContents(const QgsTableContents &contents)
Sets the contents to show in the editor widget.
A reusable widget for formatting the contents of a QgsTableCell.
A reusable widget for editing simple spreadsheet-style tables.
#define SIP_SKIP
Definition qgis_sip.h:134
QVector< QgsTableRow > QgsTableContents
A set of table rows.