Skip to content

Commit bbdf7cd

Browse files
committed
sync some sip bindings
1 parent b66ee23 commit bbdf7cd

20 files changed

+275
-179
lines changed

python/core/composer/qgscomposerattributetable.sip

+42-20
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class QgsComposerAttributeTableCompare
1212
public:
1313
QgsComposerAttributeTableCompare();
1414
// bool operator()( const QgsAttributeMap& m1, const QgsAttributeMap& m2 );
15-
15+
1616
/**Sets column number to sort by
1717
* @param col column number for sorting
1818
*/
@@ -47,7 +47,7 @@ class QgsComposerAttributeTable : QgsComposerTable
4747
* @see readXML
4848
*/
4949
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
50-
50+
5151
/**Reads the properties specific to an attribute table from xml.
5252
* @param itemElem a QDomElement holding the attribute table's desired properties.
5353
* @param doc QDomDocument for the source xml.
@@ -60,13 +60,13 @@ class QgsComposerAttributeTable : QgsComposerTable
6060
* @see vectorLayer
6161
*/
6262
void setVectorLayer( QgsVectorLayer* layer );
63-
63+
6464
/**Returns the vector layer the attribute table is currently using
6565
* @returns attribute table's current vector layer
6666
* @see setVectorLayer
6767
*/
6868
QgsVectorLayer* vectorLayer() const;
69-
69+
7070
/**Resets the attribute table's columns to match the vector layer's fields
7171
* @note added in 2.3
7272
* @see setVectorLayer
@@ -83,13 +83,13 @@ class QgsComposerAttributeTable : QgsComposerTable
8383
* @see setDisplayOnlyVisibleFeatures
8484
*/
8585
void setComposerMap( const QgsComposerMap* map /TransferThis/ );
86-
86+
8787
/**Returns the composer map whose extents are controlling the features shown in the
8888
* table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
8989
* @returns composer map controlling the attribute table
9090
* @see setComposerMap
9191
* @see displayOnlyVisibleFeatures
92-
*/
92+
*/
9393
const QgsComposerMap* composerMap() const;
9494

9595
/**Sets the maximum number of features shown by the table. Changing this setting may result
@@ -99,11 +99,11 @@ class QgsComposerAttributeTable : QgsComposerTable
9999
* @see maximumNumberOfFeatures
100100
*/
101101
void setMaximumNumberOfFeatures( int features );
102-
102+
103103
/**Returns the maximum number of features to be shown by the table.
104104
* @returns maximum number of features
105105
* @see setMaximumNumberOfFeatures
106-
*/
106+
*/
107107
int maximumNumberOfFeatures() const;
108108

109109
/**Sets attribute table to only show features which are visible in a composer map item. Changing
@@ -114,23 +114,23 @@ class QgsComposerAttributeTable : QgsComposerTable
114114
* @see setComposerMap
115115
*/
116116
void setDisplayOnlyVisibleFeatures( bool b );
117-
117+
118118
/**Returns true if the table is set to show only features visible on a corresponding
119119
* composer map item.
120120
* @returns true if table only shows visible features
121121
* @see composerMap
122122
* @see setDisplayOnlyVisibleFeatures
123-
*/
123+
*/
124124
bool displayOnlyVisibleFeatures() const;
125-
125+
126126
/**Returns true if a feature filter is active on the attribute table
127127
* @returns bool state of the feature filter
128128
* @note added in 2.3
129129
* @see setFilterFeatures
130130
* @see featureFilter
131131
*/
132132
bool filterFeatures() const;
133-
133+
134134
/**Sets whether the feature filter is active for the attribute table. Changing
135135
* this setting forces the table to refetch features from its vector layer, and may result in
136136
* the table changing size to accommodate the new displayed feature attributes.
@@ -149,7 +149,7 @@ class QgsComposerAttributeTable : QgsComposerTable
149149
* @see filterFeatures
150150
*/
151151
QString featureFilter() const;
152-
152+
153153
/**Sets the expression used for filtering features in the table. The filter is only
154154
* active if filterFeatures() is set to true. Changing this setting forces the table
155155
* to refetch features from its vector layer, and may result in
@@ -168,15 +168,15 @@ class QgsComposerAttributeTable : QgsComposerTable
168168
* @deprecated use QgsComposerTable::columns() instead
169169
*/
170170
QSet<int> displayAttributes() const /Deprecated/;
171-
171+
172172
/**Sets the attributes to display in the table.
173173
* @param attr QSet of integer values refering to the attributes from the vector layer to show.
174174
* Set to an empty QSet to show all feature attributes.
175175
* @param refresh set to true to force the table to refetch features from its vector layer
176176
* and immediately update the display of the table. This may result in the table changing size
177177
* to accommodate the new displayed feature attributes.
178178
* @see displayAttributes
179-
*/
179+
*/
180180
void setDisplayAttributes( const QSet<int>& attr );
181181

182182
/**Returns the attribute field aliases, which control how fields are named in the table's
@@ -187,14 +187,14 @@ class QgsComposerAttributeTable : QgsComposerTable
187187
* @deprecated use QgsComposerTable::columns() instead
188188
*/
189189
QMap<int, QString> fieldAliasMap() const /Deprecated/;
190-
190+
191191
/**Sets the attribute field aliases, which control how fields are named in the table's
192192
* header row.
193193
* @param map QMap of integers to strings, where the string is the alias to use for the
194194
* corresponding field, and the integer is the field index from the vector layer
195195
* @see fieldAliasMap
196196
* @deprecated use QgsComposerTable::columns() instead
197-
*/
197+
*/
198198
void setFieldAliasMap( const QMap<int, QString>& map ) /Deprecated/;
199199

200200
/**Adapts mMaximumNumberOfFeatures depending on the rectangle height. Calling this forces
@@ -205,12 +205,34 @@ class QgsComposerAttributeTable : QgsComposerTable
205205
*/
206206
void setSceneRect( const QRectF& rectangle );
207207

208-
// @note not available in python bindings
209-
// void setSortAttributes( const QList<QPair<int, bool> > att );
208+
/**Sets the attributes to use to sort the table's features.
209+
* @param att QList integers/bool pairs, where the integer refers to the attribute index and
210+
* the bool sets the sort order for the attribute. If true the attribute is sorted ascending,
211+
* if false, the attribute is sorted in descending order. Note that features are sorted
212+
* after the maximum number of displayed features have been fetched from the vector layer's
213+
* provider.
214+
* @see sortAttributes
215+
* @deprecated use QgsComposerTable::columns() instead
216+
* @note not available in python bindings
217+
*/
218+
// void setSortAttributes( const QList<QPair<int, bool> > att ) /Deprecated/;
210219

211-
// @note not available in python bindings
220+
/**Returns the attributes used to sort the table's features.
221+
* @returns a QList of integer/bool pairs, where the integer refers to the attribute index and
222+
* the bool to the sort order for the attribute. If true the attribute is sorted ascending,
223+
* if false, the attribute is sorted in descending order.
224+
* @note not available in python bindings
225+
*/
212226
// QList<QPair<int, bool> > sortAttributes() const;
213227

228+
/**Queries the attribute table's vector layer for attributes to show in the table.
229+
* @param attributeMaps list of QgsAttributeMaps where the fetched feature attributes will be stored
230+
* @returns true if attributes were successfully fetched
231+
* @note not available in python bindings
232+
*/
233+
// bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
234+
235+
214236
signals:
215237
/**This signal is emitted if the maximum number of feature changes (interactively)*/
216238
void maximumNumberOfFeaturesChanged( int n );

python/core/composer/qgscomposerattributetablemodel.sip

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
55
#include <qgscomposerattributetablemodel.h>
66
%End
77

8-
public:
8+
public:
99

1010
/*! Controls whether a row/column is shifted up or down
1111
*/
@@ -17,6 +17,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
1717

1818
/**Constructor for QgsComposerAttributeTableColumnModel.
1919
* @param composerTable QgsComposerAttributeTable the model is attached to
20+
* @param parent optional parent
2021
*/
2122
QgsComposerAttributeTableColumnModel( QgsComposerAttributeTable *composerTable, QObject *parent = 0 );
2223
virtual ~QgsComposerAttributeTableColumnModel();
@@ -30,6 +31,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
3031
bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
3132
bool insertRows( int row, int count, const QModelIndex &parent = QModelIndex() );
3233
QModelIndex index( int row, int column, const QModelIndex &parent ) const;
34+
QModelIndex parent( const QModelIndex &child ) const;
3335

3436
/**Moves the specified row up or down in the model. Used for rearranging the attribute tables
3537
* columns.
@@ -87,7 +89,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
8789
* @see setColumnAsSorted
8890
*/
8991
bool moveColumnInSortRank( QgsComposerTableColumn * column, ShiftDirection direction );
90-
92+
9193
};
9294

9395
/**Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted*/
@@ -98,7 +100,8 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
98100
%End
99101

100102
public:
101-
/*! Controls whether the proxy model shows sorted or unsorted columns
103+
104+
/*! Controls whether the proxy model shows sorted or unsorted columns
102105
*/
103106
enum ColumnFilterType
104107
{
@@ -109,6 +112,7 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
109112
/**Constructor for QgsComposerTableSortColumnsProxyModel.
110113
* @param composerTable QgsComposerAttributeTable the model is attached to
111114
* @param filterType filter for columns, controls whether sorted or unsorted columns are shown
115+
* @param parent optional parent
112116
*/
113117
QgsComposerTableSortColumnsProxyModel( QgsComposerAttributeTable *composerTable, ColumnFilterType filterType, QObject *parent = 0 );
114118

@@ -142,15 +146,14 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
142146
/**Returns the QgsComposerTableColumn corresponding to an index from the source
143147
* QgsComposerAttributeTableColumnModel model.
144148
* @returns QgsComposerTableColumn for specified index from QgsComposerAttributeTableColumnModel
145-
* @param index a QModelIndex
149+
* @param sourceIndex a QModelIndex
146150
* @note added in 2.3
147151
* @see columnFromRow
148152
* @see columnFromIndex
149153
*/
150154
QgsComposerTableColumn* columnFromSourceIndex( const QModelIndex& sourceIndex ) const;
151155

152156
protected:
153-
154157
bool filterAcceptsRow( int source_row, const QModelIndex & source_parent ) const;
155158

156159
};

0 commit comments

Comments
 (0)