@@ -12,7 +12,7 @@ class QgsComposerAttributeTableCompare
12
12
public:
13
13
QgsComposerAttributeTableCompare();
14
14
// bool operator()( const QgsAttributeMap& m1, const QgsAttributeMap& m2 );
15
-
15
+
16
16
/**Sets column number to sort by
17
17
* @param col column number for sorting
18
18
*/
@@ -47,7 +47,7 @@ class QgsComposerAttributeTable : QgsComposerTable
47
47
* @see readXML
48
48
*/
49
49
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
50
-
50
+
51
51
/**Reads the properties specific to an attribute table from xml.
52
52
* @param itemElem a QDomElement holding the attribute table's desired properties.
53
53
* @param doc QDomDocument for the source xml.
@@ -60,13 +60,13 @@ class QgsComposerAttributeTable : QgsComposerTable
60
60
* @see vectorLayer
61
61
*/
62
62
void setVectorLayer( QgsVectorLayer* layer );
63
-
63
+
64
64
/**Returns the vector layer the attribute table is currently using
65
65
* @returns attribute table's current vector layer
66
66
* @see setVectorLayer
67
67
*/
68
68
QgsVectorLayer* vectorLayer() const;
69
-
69
+
70
70
/**Resets the attribute table's columns to match the vector layer's fields
71
71
* @note added in 2.3
72
72
* @see setVectorLayer
@@ -83,13 +83,13 @@ class QgsComposerAttributeTable : QgsComposerTable
83
83
* @see setDisplayOnlyVisibleFeatures
84
84
*/
85
85
void setComposerMap( const QgsComposerMap* map /TransferThis/ );
86
-
86
+
87
87
/**Returns the composer map whose extents are controlling the features shown in the
88
88
* table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
89
89
* @returns composer map controlling the attribute table
90
90
* @see setComposerMap
91
91
* @see displayOnlyVisibleFeatures
92
- */
92
+ */
93
93
const QgsComposerMap* composerMap() const;
94
94
95
95
/**Sets the maximum number of features shown by the table. Changing this setting may result
@@ -99,11 +99,11 @@ class QgsComposerAttributeTable : QgsComposerTable
99
99
* @see maximumNumberOfFeatures
100
100
*/
101
101
void setMaximumNumberOfFeatures( int features );
102
-
102
+
103
103
/**Returns the maximum number of features to be shown by the table.
104
104
* @returns maximum number of features
105
105
* @see setMaximumNumberOfFeatures
106
- */
106
+ */
107
107
int maximumNumberOfFeatures() const;
108
108
109
109
/**Sets attribute table to only show features which are visible in a composer map item. Changing
@@ -114,23 +114,23 @@ class QgsComposerAttributeTable : QgsComposerTable
114
114
* @see setComposerMap
115
115
*/
116
116
void setDisplayOnlyVisibleFeatures( bool b );
117
-
117
+
118
118
/**Returns true if the table is set to show only features visible on a corresponding
119
119
* composer map item.
120
120
* @returns true if table only shows visible features
121
121
* @see composerMap
122
122
* @see setDisplayOnlyVisibleFeatures
123
- */
123
+ */
124
124
bool displayOnlyVisibleFeatures() const;
125
-
125
+
126
126
/**Returns true if a feature filter is active on the attribute table
127
127
* @returns bool state of the feature filter
128
128
* @note added in 2.3
129
129
* @see setFilterFeatures
130
130
* @see featureFilter
131
131
*/
132
132
bool filterFeatures() const;
133
-
133
+
134
134
/**Sets whether the feature filter is active for the attribute table. Changing
135
135
* this setting forces the table to refetch features from its vector layer, and may result in
136
136
* the table changing size to accommodate the new displayed feature attributes.
@@ -149,7 +149,7 @@ class QgsComposerAttributeTable : QgsComposerTable
149
149
* @see filterFeatures
150
150
*/
151
151
QString featureFilter() const;
152
-
152
+
153
153
/**Sets the expression used for filtering features in the table. The filter is only
154
154
* active if filterFeatures() is set to true. Changing this setting forces the table
155
155
* to refetch features from its vector layer, and may result in
@@ -168,15 +168,15 @@ class QgsComposerAttributeTable : QgsComposerTable
168
168
* @deprecated use QgsComposerTable::columns() instead
169
169
*/
170
170
QSet<int> displayAttributes() const /Deprecated/;
171
-
171
+
172
172
/**Sets the attributes to display in the table.
173
173
* @param attr QSet of integer values refering to the attributes from the vector layer to show.
174
174
* Set to an empty QSet to show all feature attributes.
175
175
* @param refresh set to true to force the table to refetch features from its vector layer
176
176
* and immediately update the display of the table. This may result in the table changing size
177
177
* to accommodate the new displayed feature attributes.
178
178
* @see displayAttributes
179
- */
179
+ */
180
180
void setDisplayAttributes( const QSet<int>& attr );
181
181
182
182
/**Returns the attribute field aliases, which control how fields are named in the table's
@@ -187,14 +187,14 @@ class QgsComposerAttributeTable : QgsComposerTable
187
187
* @deprecated use QgsComposerTable::columns() instead
188
188
*/
189
189
QMap<int, QString> fieldAliasMap() const /Deprecated/;
190
-
190
+
191
191
/**Sets the attribute field aliases, which control how fields are named in the table's
192
192
* header row.
193
193
* @param map QMap of integers to strings, where the string is the alias to use for the
194
194
* corresponding field, and the integer is the field index from the vector layer
195
195
* @see fieldAliasMap
196
196
* @deprecated use QgsComposerTable::columns() instead
197
- */
197
+ */
198
198
void setFieldAliasMap( const QMap<int, QString>& map ) /Deprecated/;
199
199
200
200
/**Adapts mMaximumNumberOfFeatures depending on the rectangle height. Calling this forces
@@ -205,12 +205,34 @@ class QgsComposerAttributeTable : QgsComposerTable
205
205
*/
206
206
void setSceneRect( const QRectF& rectangle );
207
207
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/;
210
219
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
+ */
212
226
// QList<QPair<int, bool> > sortAttributes() const;
213
227
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
+
214
236
signals:
215
237
/**This signal is emitted if the maximum number of feature changes (interactively)*/
216
238
void maximumNumberOfFeaturesChanged( int n );
0 commit comments