QGIS API Documentation  2.4.0-Chugiak
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgscomposertablecolumn.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposertablecolumn.h
3  ------------------
4  begin : May 2014
5  copyright : (C) 2014 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
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 QGSCOMPOSERTABLECOLUMN_H
19 #define QGSCOMPOSERTABLECOLUMN_H
20 
21 #include "qgscomposertable.h"
22 #include <QObject>
23 
27 class CORE_EXPORT QgsComposerTableColumn: public QObject
28 {
29  Q_OBJECT
30 
31  public:
32 
34  virtual ~QgsComposerTableColumn();
35 
42  virtual bool writeXML( QDomElement& columnElem, QDomDocument & doc ) const;
43 
49  virtual bool readXML( const QDomElement& columnElem );
50 
57  QString heading() const { return mHeading; }
58 
65  void setHeading( QString heading ) { mHeading = heading; }
66 
73  Qt::AlignmentFlag hAlignment() const { return mHAlignment; }
74 
81  void setHAlignment( Qt::AlignmentFlag alignment ) { mHAlignment = alignment; }
82 
90  QString attribute() const { return mAttribute; }
91 
99  void setAttribute( QString attribute ) { mAttribute = attribute; }
100 
109  Qt::SortOrder sortOrder() const { return mSortOrder; }
110 
119  void setSortOrder( Qt::SortOrder sortOrder ) { mSortOrder = sortOrder; }
120 
133  int sortByRank() const { return mSortByRank; }
134 
147  void setSortByRank( int sortByRank ) { mSortByRank = sortByRank; }
148 
153  QgsComposerTableColumn* clone();
154 
155  private:
156 
157  QColor mBackgroundColor; //curently unused
158  Qt::AlignmentFlag mHAlignment;
159  QString mHeading;
160  QString mAttribute;
162  Qt::SortOrder mSortOrder;
163 
164 };
165 
166 #endif // QGSCOMPOSERTABLECOLUMN_H
void setAttribute(QString attribute)
Sets the attribute name or expression used for the column's values.
int sortByRank() const
Returns the sort rank for the column.
Qt::SortOrder sortOrder() const
Returns the sort order for the column.
void setHeading(QString heading)
Sets the heading for a column, which is the value displayed in the columns header cell...
void setHAlignment(Qt::AlignmentFlag alignment)
Sets the horizontal alignment for a column, which controls the alignment used for drawing column valu...
Stores properties of a column in a QgsComposerTable.
QString heading() const
Returns the heading for a column, which is the value displayed in the columns header cell...
void setSortOrder(Qt::SortOrder sortOrder)
Sets the sort order for the column.
Qt::AlignmentFlag hAlignment() const
Returns the horizontal alignment for a column, which controls the alignment used for drawing column v...
QString attribute() const
Returns the attribute name or expression used for the column's values.
void setSortByRank(int sortByRank)
Sets the sort rank for the column.