18 #ifndef QGSCOMPOSERTABLE_H
19 #define QGSCOMPOSERTABLE_H
53 virtual void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
55 virtual bool writeXML( QDomElement& elem, QDomDocument & doc )
const = 0;
56 virtual bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc ) = 0;
62 void setLineTextDistance(
double d );
75 void setHeaderFont(
const QFont& f );
89 void setHeaderHAlignment(
const HeaderHAlignment alignment );
103 void setContentFont(
const QFont& f );
118 void setShowGrid(
bool show );
134 void setGridStrokeWidth(
double w );
166 virtual QMap<int, QString> headerLabels()
const;
176 virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED( attributeMaps );
return false; }
183 QList<QgsComposerTableColumn*>*
columns() {
return &mColumns; }
190 void setColumns( QList<QgsComposerTableColumn*> columns );
200 virtual void refreshAttributes();
209 virtual void adjustFrameToSize();
236 virtual bool calculateMaxColumnWidths( QMap<int, double>& maxWidthMap,
const QList<QgsAttributeMap>& attributeMaps )
const;
245 void adaptItemFrame(
const QMap<int, double>& maxWidthMap,
const QList<QgsAttributeMap>& attributeMaps );
252 void drawHorizontalGridLines( QPainter* p,
int nAttributes );
262 void drawVerticalGridLines( QPainter* p,
const QMap<int, double>& maxWidthMap );
270 bool tableWriteXML( QDomElement& itemElem, QDomDocument& doc )
const;
278 bool tableReadXML(
const QDomElement& itemElem,
const QDomDocument& doc );
281 #endif // QGSCOMPOSERTABLE_H
QColor gridColor() const
Returns the color used for grid lines in the table.
virtual int type() const
return correct graphics item type.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)=0
sets state from Dom document
A item that forms part of a map composition.
HeaderHAlignment mHeaderHAlignment
QList< QgsComposerTableColumn * > * columns()
Returns a pointer to the list of QgsComposerTableColumns shown in the table.
void setGridColor(const QColor &c)
Sets color used for grid lines in the table.
A class to display feature attributes in the print composer.
QFont headerFont() const
Returns the font used to draw header text in the table.
bool showGrid() const
Returns whether grid lines are drawn in the table.
Stores properties of a column in a QgsComposerTable.
Graphics scene for map printing.
virtual bool getFeatureAttributes(QList< QgsAttributeMap > &attributeMaps)
Fetches the text used for the rows of the table.
QList< QgsComposerTableColumn * > mColumns
HeaderHAlignment headerHAlignment() const
Returns the horizontal alignment for table headers.
QFont contentFont() const
Returns the font used to draw text in table body cells.
QList< QgsAttributeMap > mAttributeMaps
double mLineTextDistance
Distance between table lines and text.
QMap< int, double > mMaxColumnWidthMap
double gridStrokeWidth() const
Returns the width of grid lines in the table.
double lineTextDistance() const
Returns the margin distance between cell borders and their contents.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const =0
stores state in Dom element