/
qgstableeditorwidget.sip.in
320 lines (228 loc) · 8.46 KB
/
qgstableeditorwidget.sip.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/tableeditor/qgstableeditorwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsTableEditorWidget : QTableWidget
{
%Docstring
A reusable widget for editing simple spreadsheet-style tables.
Table content is retrieved and set using the QgsTableContents class. The editor
has support for table foreground and background colors, and numeric formats.
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgstableeditorwidget.h"
%End
public:
QgsTableEditorWidget( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsTableEditorWidget with the specified ``parent`` widget.
%End
~QgsTableEditorWidget();
void setTableContents( const QgsTableContents &contents );
%Docstring
Sets the ``contents`` to show in the editor widget.
.. seealso:: :py:func:`tableContents`
%End
QgsTableContents tableContents() const;
%Docstring
Returns the current contents of the editor widget table.
.. seealso:: :py:func:`setTableContents`
%End
void setSelectionNumericFormat( QgsNumericFormat *format /Transfer/ );
%Docstring
Sets the numeric ``format`` to use for the currently selected cells.
Ownership of ``format`` is transferred to the widget.
.. seealso:: :py:func:`selectionNumericFormat`
%End
QgsNumericFormat *selectionNumericFormat();
%Docstring
Returns the numeric format used for the currently selected cells, or
``None`` if the selection has no numeric format set.
If the selected cells have a mix of different formats then ``None``
will be returned.
.. seealso:: :py:func:`setSelectionNumericFormat`
.. seealso:: :py:func:`hasMixedSelectionNumericFormat`
%End
bool hasMixedSelectionNumericFormat();
%Docstring
Returns ``True`` if the current selection has a mix of numeric formats.
.. seealso:: :py:func:`selectionNumericFormat`
%End
bool hasMixedSelectionHasTextFormat();
QColor selectionForegroundColor();
%Docstring
Returns the foreground color for the currently selected cells.
If the selected cells have a mix of different foreground colors then an
invalid color will be returned.
.. seealso:: :py:func:`setSelectionForegroundColor`
.. seealso:: :py:func:`selectionBackgroundColor`
%End
QColor selectionBackgroundColor();
%Docstring
Returns the background color for the currently selected cells.
If the selected cells have a mix of different background colors then an
invalid color will be returned.
.. seealso:: :py:func:`setSelectionBackgroundColor`
.. seealso:: :py:func:`selectionForegroundColor`
%End
QgsTextFormat selectionTextFormat();
bool selectionHasTextFormat();
double selectionRowHeight();
%Docstring
Returns the height (in millimeters) of the rows associated with the current selection,
or 0 if an automatic row height is desired, or -1 if the selection has mixed row heights.
.. seealso:: :py:func:`setSelectionRowHeight`
%End
double selectionColumnWidth();
%Docstring
Returns the width (in millimeters) of the columns associated with the current selection,
or 0 if an automatic column width is desired.
.. seealso:: :py:func:`setSelectionColumnWidth`
%End
double tableRowHeight( int row );
%Docstring
Returns the configured row height for the specified ``row``, or 0 if an automatic height
should be used for the row.
%End
double tableColumnWidth( int column );
%Docstring
Returns the configured column width for the specified ``column``, or 0 if an automatic width
should be used for the column.
%End
void setTableRowHeight( int row, double height );
%Docstring
Sets the configured row ``height`` for the specified ``row``. Set ``height`` to 0
if an automatic height should be used for the row.
This should be called after a call to :py:func:`~QgsTableEditorWidget.setTableContents`.
.. seealso:: :py:func:`tableRowHeight`
%End
void setTableColumnWidth( int column, double width );
%Docstring
Sets the configured column ``width`` for the specified ``column``. Set ``width`` to 0
if an automatic width should be used for the column.
This should be called after a call to :py:func:`~QgsTableEditorWidget.setTableContents`.
.. seealso:: :py:func:`tableColumnWidth`
%End
QList<int> rowsAssociatedWithSelection();
%Docstring
Returns a list of the rows associated with the current table selected cells.
.. seealso:: :py:func:`columnsAssociatedWithSelection`
%End
QList<int> columnsAssociatedWithSelection();
%Docstring
Returns a list of the columns associated with the current table selected cells.
.. seealso:: :py:func:`rowsAssociatedWithSelection`
%End
QVariantList tableHeaders() const;
%Docstring
Returns the table header values.
.. seealso:: :py:func:`setTableHeaders`
%End
bool isHeaderCellSelected();
%Docstring
Returns ``True`` if any header cells are selected.
%End
public slots:
void insertRowsBelow();
%Docstring
Inserts new rows below the current selection.
.. seealso:: :py:func:`insertRowsAbove`
%End
void insertRowsAbove();
%Docstring
Inserts new rows above the current selection.
.. seealso:: :py:func:`insertRowsBelow`
%End
void insertColumnsBefore();
%Docstring
Inserts new columns before the current selection.
.. seealso:: :py:func:`insertColumnsAfter`
%End
void insertColumnsAfter();
%Docstring
Inserts new columns after the current selection.
.. seealso:: :py:func:`insertColumnsBefore`
%End
void deleteRows();
%Docstring
Deletes all rows associated with the current selected cells.
.. seealso:: :py:func:`deleteColumns`
%End
void deleteColumns();
%Docstring
Deletes all columns associated with the current selected cells.
.. seealso:: :py:func:`deleteRows`
%End
void expandRowSelection();
%Docstring
Expands out the selection to include whole rows associated with the
current selected cells.
.. seealso:: :py:func:`expandColumnSelection`
%End
void expandColumnSelection();
%Docstring
Expands out the selection to include whole columns associated with the
current selected cells.
.. seealso:: :py:func:`expandRowSelection`
%End
void clearSelectedCells();
%Docstring
Clears the contents of the currently selected cells.
%End
void setSelectionForegroundColor( const QColor &color );
%Docstring
Sets the foreground color for the currently selected cells.
.. seealso:: :py:func:`selectionForegroundColor`
.. seealso:: :py:func:`setSelectionBackgroundColor`
%End
void setSelectionBackgroundColor( const QColor &color );
%Docstring
Sets the background color for the currently selected cells.
.. seealso:: :py:func:`selectionBackgroundColor`
.. seealso:: :py:func:`setSelectionForegroundColor`
%End
void setSelectionTextFormat( const QgsTextFormat &format );
void setSelectionHasTextFormat( bool hasFormat );
void setSelectionRowHeight( double height );
%Docstring
Sets the row ``height`` (in millimeters) for the currently selected rows, or 0 for automatic row height.
.. seealso:: :py:func:`setSelectionColumnWidth`
%End
void setSelectionColumnWidth( double height );
%Docstring
Sets the column ``width`` (in millimeters) for the currently selected columns, or 0 for automatic column width.
.. seealso:: :py:func:`setSelectionRowHeight`
%End
void setIncludeTableHeader( bool included );
%Docstring
Sets whether the table includes a header row.
.. seealso:: :py:func:`includeTableHeader`
%End
void setTableHeaders( const QVariantList &headers );
%Docstring
Sets the table ``headers``.
.. seealso:: :py:func:`tableHeaders`
%End
protected:
virtual void keyPressEvent( QKeyEvent *event );
signals:
void tableChanged();
%Docstring
Emitted whenever the table contents are changed.
%End
void activeCellChanged();
%Docstring
Emitted whenever the active (or selected) cell changes in the widget.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/tableeditor/qgstableeditorwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/