-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgscomposerattributetablemodelv2.sip
255 lines (171 loc) · 7.53 KB
/
qgscomposerattributetablemodelv2.sip
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
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/composer/qgscomposerattributetablemodelv2.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsComposerAttributeTableColumnModelV2: QAbstractTableModel
{
%Docstring
A model for displaying columns shown in a QgsComposerAttributeTableV2
%End
%TypeHeaderCode
#include "qgscomposerattributetablemodelv2.h"
%End
public:
enum ShiftDirection
{
ShiftUp,
ShiftDown
};
QgsComposerAttributeTableColumnModelV2( QgsComposerAttributeTableV2 *composerTable, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsComposerAttributeTableColumnModel.
:param composerTable: QgsComposerAttributeTable the model is attached to
:param parent: optional parent
%End
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
virtual bool insertRows( int row, int count, const QModelIndex &parent = QModelIndex() );
virtual QModelIndex index( int row, int column, const QModelIndex &parent ) const;
virtual QModelIndex parent( const QModelIndex &child ) const;
bool moveRow( int row, ShiftDirection direction );
%Docstring
Moves the specified row up or down in the model. Used for rearranging the attribute tables
columns.
:return: true if the move is allowed
:rtype: bool
:param row: row in model representing attribute table column to move
:param direction: direction to move the attribute table column
.. versionadded:: 2.3
%End
void resetToLayer();
%Docstring
Resets the attribute table's columns to match the source layer's fields. Remove all existing
attribute table columns and column customisations.
.. versionadded:: 2.3
%End
QgsComposerTableColumn *columnFromIndex( const QModelIndex &index ) const;
%Docstring
Returns the QgsComposerTableColumn corresponding to an index in the model.
:return: QgsComposerTableColumn for specified index
:rtype: QgsComposerTableColumn
:param index: a QModelIndex
.. versionadded:: 2.3
.. seealso:: :py:func:`indexFromColumn`
%End
QModelIndex indexFromColumn( QgsComposerTableColumn *column );
%Docstring
Returns a QModelIndex corresponding to a QgsComposerTableColumn in the model.
:return: QModelIndex for specified QgsComposerTableColumn
:rtype: QModelIndex
:param column: a QgsComposerTableColumn
.. versionadded:: 2.3
.. seealso:: :py:func:`columnFromIndex`
%End
void setColumnAsSorted( QgsComposerTableColumn *column, Qt::SortOrder order );
%Docstring
Sets a specified column as a sorted column in the QgsComposerAttributeTable. The column will be
added to the end of the sort rank list, ie it will take the next largest available sort rank.
:param column: a QgsComposerTableColumn
:param order: sort order for column
.. versionadded:: 2.3
.. seealso:: :py:func:`removeColumnFromSort`
.. seealso:: :py:func:`moveColumnInSortRank`
%End
void setColumnAsUnsorted( QgsComposerTableColumn *column );
%Docstring
Sets a specified column as an unsorted column in the QgsComposerAttributeTable. The column will be
removed from the sort rank list.
:param column: a QgsComposerTableColumn
.. versionadded:: 2.3
.. seealso:: :py:func:`setColumnAsSorted`
%End
bool moveColumnInSortRank( QgsComposerTableColumn *column, ShiftDirection direction );
%Docstring
Moves a column up or down in the sort rank for the QgsComposerAttributeTable.
:param column: a QgsComposerTableColumn
:param direction: direction to move the column in the sort rank list
:rtype: bool
.. versionadded:: 2.3
.. seealso:: :py:func:`setColumnAsSorted`
%End
};
class QgsComposerTableSortColumnsProxyModelV2: QSortFilterProxyModel
{
%Docstring
Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted
%End
%TypeHeaderCode
#include "qgscomposerattributetablemodelv2.h"
%End
public:
enum ColumnFilterType
{
ShowSortedColumns,
ShowUnsortedColumns
};
QgsComposerTableSortColumnsProxyModelV2( QgsComposerAttributeTableV2 *composerTable, ColumnFilterType filterType, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsComposerTableSortColumnsProxyModel.
:param composerTable: QgsComposerAttributeTable the model is attached to
:param filterType: filter for columns, controls whether sorted or unsorted columns are shown
:param parent: optional parent
%End
virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
QgsComposerTableColumn *columnFromRow( int row );
%Docstring
Returns the QgsComposerTableColumn corresponding to a row in the proxy model.
:return: QgsComposerTableColumn for specified row
:rtype: QgsComposerTableColumn
:param row: a row number
.. versionadded:: 2.3
.. seealso:: :py:func:`columnFromIndex`
%End
QgsComposerTableColumn *columnFromIndex( const QModelIndex &index ) const;
%Docstring
Returns the QgsComposerTableColumn corresponding to an index in the proxy model.
:return: QgsComposerTableColumn for specified index
:rtype: QgsComposerTableColumn
:param index: a QModelIndex
.. versionadded:: 2.3
.. seealso:: :py:func:`columnFromRow`
.. seealso:: :py:func:`columnFromSourceIndex`
%End
QgsComposerTableColumn *columnFromSourceIndex( const QModelIndex &sourceIndex ) const;
%Docstring
Returns the QgsComposerTableColumn corresponding to an index from the source
QgsComposerAttributeTableColumnModel model.
:return: QgsComposerTableColumn for specified index from QgsComposerAttributeTableColumnModel
:rtype: QgsComposerTableColumn
:param sourceIndex: a QModelIndex
.. versionadded:: 2.3
.. seealso:: :py:func:`columnFromRow`
.. seealso:: :py:func:`columnFromIndex`
%End
void resetFilter();
%Docstring
Invalidates the current filter used by the proxy model
.. versionadded:: 2.3
%End
protected:
virtual bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/composer/qgscomposerattributetablemodelv2.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/