File tree Expand file tree Collapse file tree 3 files changed +22
-11
lines changed Expand file tree Collapse file tree 3 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -220,10 +220,6 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
220
220
221
221
QMap<int , QString> headerLabels () const ;
222
222
223
- protected:
224
- /* *Retrieves feature attributes
225
- * @note not available in python bindings
226
- */
227
223
bool getFeatureAttributes ( QList<QgsAttributeMap>& attributeMaps );
228
224
229
225
private:
Original file line number Diff line number Diff line change @@ -69,6 +69,16 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
69
69
*/
70
70
virtual QMap<int , QString> headerLabels () const { return QMap<int , QString>(); } // = 0;
71
71
72
+ // TODO - make this more generic for next API break, eg rename as getRowValues, use QStringList rather than
73
+ // QgsAttributeMap
74
+
75
+ /* Fetches the text used for the rows of the table.
76
+ * @returns true if attribute text was successfully retrieved.
77
+ * @param attributeMaps QList of QgsAttributeMap to store retrieved row data in
78
+ * @note not available in python bindings
79
+ */
80
+ virtual bool getFeatureAttributes ( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED ( attributeMaps ); return false ; }
81
+
72
82
public slots:
73
83
74
84
/* *Refreshes the attributes shown in the table by querying the vector layer for new data.
@@ -102,10 +112,6 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
102
112
QList<QgsAttributeMap> mAttributeMaps ;
103
113
QMap<int , double > mMaxColumnWidthMap ;
104
114
105
- /* *Retrieves feature attributes*/
106
- // ! @note not available in python bindings
107
- virtual bool getFeatureAttributes ( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED ( attributeMaps ); return false ; }
108
-
109
115
/* *Calculate the maximum width values of the vector attributes*/
110
116
virtual bool calculateMaxColumnWidths ( QMap<int , double >& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps ) const ;
111
117
/* *Adapts the size of the item frame to match the content*/
Original file line number Diff line number Diff line change @@ -30,16 +30,25 @@ class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
30
30
/* * return correct graphics item type. Added in v1.7 */
31
31
virtual int type () const { return ComposerTextTable; }
32
32
33
- void setHeaderLabels ( const QStringList& l ) { mHeaderLabels = l; }
33
+ /* Sets the text to use for the header row for the table
34
+ * @param labels list of strings to use for each column's header row
35
+ * @see headerLabels
36
+ */
37
+ void setHeaderLabels ( const QStringList& labels ) { mHeaderLabels = labels; }
38
+
39
+ /* Adds a row to the table
40
+ * @param row list of strings to use for each cell's value in the newly added row
41
+ * @note If row is shorter than the number of columns in the table than blank cells
42
+ * will be inserted at the end of the row. If row contains more strings then the number
43
+ * of columns in the table then these extra strings will be ignored.
44
+ */
34
45
void addRow ( const QStringList& row ) { mRowText .append ( row ); }
35
46
36
47
bool writeXML ( QDomElement& elem, QDomDocument & doc ) const ;
37
48
bool readXML ( const QDomElement& itemElem, const QDomDocument& doc );
38
49
39
50
QMap<int , QString> headerLabels () const ;
40
51
41
- protected:
42
- // ! @note not available in python bindings
43
52
bool getFeatureAttributes ( QList<QgsAttributeMap>& attributeMaps );
44
53
45
54
private:
You can’t perform that action at this time.
0 commit comments