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
220220
221221 QMap<int , QString> headerLabels () const ;
222222
223- protected:
224- /* *Retrieves feature attributes
225- * @note not available in python bindings
226- */
227223 bool getFeatureAttributes ( QList<QgsAttributeMap>& attributeMaps );
228224
229225 private:
Original file line number Diff line number Diff line change @@ -69,6 +69,16 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
6969 */
7070 virtual QMap<int , QString> headerLabels () const { return QMap<int , QString>(); } // = 0;
7171
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+
7282 public slots:
7383
7484 /* *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
102112 QList<QgsAttributeMap> mAttributeMaps ;
103113 QMap<int , double > mMaxColumnWidthMap ;
104114
105- /* *Retrieves feature attributes*/
106- // ! @note not available in python bindings
107- virtual bool getFeatureAttributes ( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED ( attributeMaps ); return false ; }
108-
109115 /* *Calculate the maximum width values of the vector attributes*/
110116 virtual bool calculateMaxColumnWidths ( QMap<int , double >& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps ) const ;
111117 /* *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
3030 /* * return correct graphics item type. Added in v1.7 */
3131 virtual int type () const { return ComposerTextTable; }
3232
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+ */
3445 void addRow ( const QStringList& row ) { mRowText .append ( row ); }
3546
3647 bool writeXML ( QDomElement& elem, QDomDocument & doc ) const ;
3748 bool readXML ( const QDomElement& itemElem, const QDomDocument& doc );
3849
3950 QMap<int , QString> headerLabels () const ;
4051
41- protected:
42- // ! @note not available in python bindings
4352 bool getFeatureAttributes ( QList<QgsAttributeMap>& attributeMaps );
4453
4554 private:
You can’t perform that action at this time.
0 commit comments