@@ -35,16 +35,74 @@ class QgsComposerAttributeTable : QgsComposerTable
35
35
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
36
36
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
37
37
38
- void setVectorLayer( QgsVectorLayer* vl );
38
+ /**Sets the vector layer from which to display feature attributes
39
+ * @param layer Vector layer for attribute table
40
+ * @note added in 2.3
41
+ * @see vectorLayer
42
+ */
43
+ void setVectorLayer( QgsVectorLayer* layer );
44
+
45
+ /*Returns the vector layer the attribute table is currently using
46
+ * @returns attribute table's current vector layer
47
+ * @note added in 2.3
48
+ * @see setVectorLayer
49
+ */
39
50
QgsVectorLayer* vectorLayer() const;
40
51
52
+ /**Sets the composer map to use to limit the extent of features shown in the
53
+ * attribute table. This setting only has an effect if setDisplayOnlyVisibleFeatures is
54
+ * set to true. Changing the composer map forces the table to refetch features from its
55
+ * vector layer, and may result in the table changing size to accomodate the new displayed
56
+ * feature attributes.
57
+ * @param map QgsComposerMap which drives the extents of the table's features
58
+ * @note added in 2.3
59
+ * @see composerMap
60
+ * @see setDisplayOnlyVisibleFeatures
61
+ */
41
62
void setComposerMap( const QgsComposerMap* map /TransferThis/ );
63
+
64
+ /*Returns the composer map whose extents are controlling the features shown in the
65
+ * table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
66
+ * @returns composer map controlling the attribute table
67
+ * @note added in 2.3
68
+ * @see setComposerMap
69
+ * @see displayOnlyVisibleFeatures
70
+ */
42
71
const QgsComposerMap* composerMap() const;
43
72
44
- void setMaximumNumberOfFeatures( int nr );
73
+ /**Sets the maximum number of features shown by the table. Changing this setting may result
74
+ * in the attribute table changing its size to accomodate the new number of rows, and requires
75
+ * the table to refetch features from its vector layer.
76
+ * @param features maximum number of features to show in the table
77
+ * @note added in 2.3
78
+ * @see maximumNumberOfFeatures
79
+ */
80
+ void setMaximumNumberOfFeatures( int features );
81
+
82
+ /*Returns the maximum number of features to be shown by the table.
83
+ * @returns maximum number of features
84
+ * @note added in 2.3
85
+ * @see setMaximumNumberOfFeatures
86
+ */
45
87
int maximumNumberOfFeatures() const;
46
88
89
+ /**Sets attribute table to only show features which are visible in a composer map item. Changing
90
+ * this setting forces the table to refetch features from its vector layer, and may result in
91
+ * the table changing size to accomodate the new displayed feature attributes.
92
+ * @param visibleOnly set to true to show only visible features
93
+ * @note added in 2.3
94
+ * @see displayOnlyVisibleFeatures
95
+ * @see setComposerMap
96
+ */
47
97
void setDisplayOnlyVisibleFeatures( bool b );
98
+
99
+ /*Returns true if the table is set to show only features visible on a corresponding
100
+ * composer map item.
101
+ * @returns true if table only shows visible features
102
+ * @note added in 2.3
103
+ * @see composerMap
104
+ * @see setDisplayOnlyVisibleFeatures
105
+ */
48
106
bool displayOnlyVisibleFeatures() const;
49
107
50
108
/*Returns true if a feature filter is active on the attribute table
@@ -54,7 +112,10 @@ class QgsComposerAttributeTable : QgsComposerTable
54
112
* @see featureFilter
55
113
*/
56
114
bool filterFeatures() const;
57
- /**Sets whether the feature filter is active for the attribute table
115
+
116
+ /**Sets whether the feature filter is active for the attribute table. Changing
117
+ * this setting forces the table to refetch features from its vector layer, and may result in
118
+ * the table changing size to accomodate the new displayed feature attributes.
58
119
* @param filter Set to true to enable the feature filter
59
120
* @note added in 2.3
60
121
* @see filterFeatures
@@ -70,22 +131,57 @@ class QgsComposerAttributeTable : QgsComposerTable
70
131
* @see filterFeatures
71
132
*/
72
133
QString featureFilter() const;
134
+
73
135
/**Sets the expression used for filtering features in the table. The filter is only
74
- * active if filterFeatures() is set to true.
136
+ * active if filterFeatures() is set to true. Changing this setting forces the table
137
+ * to refetch features from its vector layer, and may result in
138
+ * the table changing size to accomodate the new displayed feature attributes.
75
139
* @param expression filter to use for selecting which features to display in the table
76
140
* @note added in 2.3
77
141
* @see featureFilter
78
142
* @see setFilterFeatures
79
143
*/
80
144
void setFeatureFilter( const QString& expression );
81
145
146
+ /*Returns the attributes fields which are shown by the table.
147
+ * @returns a QSet of integers refering to the attributes in the vector layer
148
+ * @see setDisplayAttributes
149
+ */
82
150
QSet<int> displayAttributes() const;
151
+
152
+ /**Sets the attributes to display in the table.
153
+ * @param attr QSet of integer values refering to the attributes from the vector layer to show
154
+ * @param refresh set to true to force the table to refetch features from its vector layer
155
+ * and immediately update the display of the table. This may result in the table changing size
156
+ * to accomodate the new displayed feature attributes.
157
+ * @see displayAttributes
158
+ */
83
159
void setDisplayAttributes( const QSet<int>& attr );
84
160
161
+ /*Returns the attribute field aliases, which control how fields are named in the table's
162
+ * header row.
163
+ * @returns a QMap of integers to strings, where the string is the field's alias.
164
+ * @see setFieldAliasMap
165
+ */
85
166
QMap<int, QString> fieldAliasMap() const;
167
+
168
+ /**Sets the attribute field aliases, which control how fields are named in the table's
169
+ * header row.
170
+ * @param map QMap of integers to strings, where the string is the alias to use for the
171
+ * corresponding field.
172
+ * @param refresh set to true to force the table to refetch features from its vector layer
173
+ * and immediately update the display of the table. This may result in the table changing size
174
+ * to accomodate the new displayed feature attributes and field aliases.
175
+ * @see fieldAliasMap
176
+ */
86
177
void setFieldAliasMap( const QMap<int, QString>& map );
87
178
88
- /**Adapts mMaximumNumberOfFeatures depending on the rectangle height*/
179
+ /**Adapts mMaximumNumberOfFeatures depending on the rectangle height. Calling this forces
180
+ * the table to refetch features from its vector layer and immediately updates the display
181
+ * of the table.
182
+ * @see maximumNumberOfFeatures
183
+ * @see setMaximumNumberOfFeatures
184
+ */
89
185
void setSceneRect( const QRectF& rectangle );
90
186
91
187
// @note not available in python bindings
0 commit comments