mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
[composer] Make getFeatureAttributes public for tables
This commit is contained in:
parent
d070558bb2
commit
ebb31de525
@ -220,10 +220,6 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
|
|||||||
|
|
||||||
QMap<int, QString> headerLabels() const;
|
QMap<int, QString> headerLabels() const;
|
||||||
|
|
||||||
protected:
|
|
||||||
/**Retrieves feature attributes
|
|
||||||
* @note not available in python bindings
|
|
||||||
*/
|
|
||||||
bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
|
bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -69,6 +69,16 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
|
|||||||
*/
|
*/
|
||||||
virtual QMap<int, QString> headerLabels() const { return QMap<int, QString>(); } //= 0;
|
virtual QMap<int, QString> headerLabels() const { return QMap<int, QString>(); } //= 0;
|
||||||
|
|
||||||
|
//TODO - make this more generic for next API break, eg rename as getRowValues, use QStringList rather than
|
||||||
|
//QgsAttributeMap
|
||||||
|
|
||||||
|
/*Fetches the text used for the rows of the table.
|
||||||
|
* @returns true if attribute text was successfully retrieved.
|
||||||
|
* @param attributeMaps QList of QgsAttributeMap to store retrieved row data in
|
||||||
|
* @note not available in python bindings
|
||||||
|
*/
|
||||||
|
virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED( attributeMaps ); return false; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
/**Refreshes the attributes shown in the table by querying the vector layer for new data.
|
/**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
|
|||||||
QList<QgsAttributeMap> mAttributeMaps;
|
QList<QgsAttributeMap> mAttributeMaps;
|
||||||
QMap<int, double> mMaxColumnWidthMap;
|
QMap<int, double> mMaxColumnWidthMap;
|
||||||
|
|
||||||
/**Retrieves feature attributes*/
|
|
||||||
//! @note not available in python bindings
|
|
||||||
virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED( attributeMaps ); return false; }
|
|
||||||
|
|
||||||
/**Calculate the maximum width values of the vector attributes*/
|
/**Calculate the maximum width values of the vector attributes*/
|
||||||
virtual bool calculateMaxColumnWidths( QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps ) const;
|
virtual bool calculateMaxColumnWidths( QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps ) const;
|
||||||
/**Adapts the size of the item frame to match the content*/
|
/**Adapts the size of the item frame to match the content*/
|
||||||
|
@ -30,7 +30,18 @@ class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
|
|||||||
/** return correct graphics item type. Added in v1.7 */
|
/** return correct graphics item type. Added in v1.7 */
|
||||||
virtual int type() const { return ComposerTextTable; }
|
virtual int type() const { return ComposerTextTable; }
|
||||||
|
|
||||||
void setHeaderLabels( const QStringList& l ) { mHeaderLabels = l; }
|
/*Sets the text to use for the header row for the table
|
||||||
|
* @param labels list of strings to use for each column's header row
|
||||||
|
* @see headerLabels
|
||||||
|
*/
|
||||||
|
void setHeaderLabels( const QStringList& labels ) { mHeaderLabels = labels; }
|
||||||
|
|
||||||
|
/*Adds a row to the table
|
||||||
|
* @param row list of strings to use for each cell's value in the newly added row
|
||||||
|
* @note If row is shorter than the number of columns in the table than blank cells
|
||||||
|
* will be inserted at the end of the row. If row contains more strings then the number
|
||||||
|
* of columns in the table then these extra strings will be ignored.
|
||||||
|
*/
|
||||||
void addRow( const QStringList& row ) { mRowText.append( row ); }
|
void addRow( const QStringList& row ) { mRowText.append( row ); }
|
||||||
|
|
||||||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
|
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
|
||||||
@ -38,8 +49,6 @@ class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
|
|||||||
|
|
||||||
QMap<int, QString> headerLabels() const;
|
QMap<int, QString> headerLabels() const;
|
||||||
|
|
||||||
protected:
|
|
||||||
//! @note not available in python bindings
|
|
||||||
bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
|
bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user