QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgscomposertexttable.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposertexttable.h
3  ----------------------
4  begin : April 2010
5  copyright : (C) 2010 by Marco Hugentobler
6  email : marco at hugis dot net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSCOMPOSERTEXTTABLE_H
19 #define QGSCOMPOSERTEXTTABLE_H
20 
21 #include "qgscomposertable.h"
22 
24 class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
25 {
26  public:
29 
31  virtual int type() const { return ComposerTextTable; }
32 
33  void setHeaderLabels( const QStringList& l ) { mHeaderLabels = l; }
34  void addRow( const QStringList& row ) { mRowText.append( row ); }
35 
36  bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
37  bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
38 
39  protected:
41  bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
42 
43  QMap<int, QString> getHeaderLabels() const;
44 
45  private:
47  QStringList mHeaderLabels;
49  QList< QStringList > mRowText;
50 };
51 
52 #endif // QGSCOMPOSERTEXTTABLE_H
QList< QStringList > mRowText
One stringlist per row.
void addRow(const QStringList &row)
virtual QMap< int, QString > getHeaderLabels() const
A class to display feature attributes in the print composer.
QStringList mHeaderLabels
Column titles.
Graphics scene for map printing.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const =0
stores state in Dom element
virtual bool getFeatureAttributes(QList< QgsAttributeMap > &attributeMaps)
Retrieves feature attributes.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)=0
sets state from Dom document
void setHeaderLabels(const QStringList &l)
virtual int type() const
return correct graphics item type.
A text table item that reads text from string lists.