KD Reports

           | Home |            | Namespaces |            | Classes |            | Files |            | Directories |
Public Member Functions

KDReports::ChartElement Class Reference

#include <KDReportsChartElement.h>

Inheritance diagram for KDReports::ChartElement:
Inheritance graph
[legend]
Collaboration diagram for KDReports::ChartElement:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ChartElement (QAbstractItemModel *tableModel)
 ChartElement (const QString &modelKey)
virtual ~ChartElement ()
 ChartElement (const ChartElement &other)
ChartElementoperator= (const ChartElement &other)
void setSize (qreal width, qreal height, Unit unit=Millimeters)

Detailed Description

The KDReports::ChartElement class represents a chart in the report. The data is provided by a QAbstractItemModel.


Constructor & Destructor Documentation

KDReports::ChartElement::ChartElement ( QAbstractItemModel *  tableModel  )  [explicit]

Creates a chart element from the given table model.

KDReports::ChartElement::ChartElement ( const QString &  modelKey  )  [explicit]

Creates a chart element that does not have an associated model yet. The association will be done later using the model key.

See also:
KDReports::Report::associateModel()
virtual KDReports::ChartElement::~ChartElement (  )  [virtual]

Destroys this chart element.

KDReports::ChartElement::ChartElement ( const ChartElement other  ) 

Copies a chart element.


Member Function Documentation

ChartElement& KDReports::ChartElement::operator= ( const ChartElement other  ) 

Copies the data from another chart element.

void KDReports::ChartElement::setSize ( qreal  width,
qreal  height,
Unit  unit = Millimeters 
)

Sets the size of the chart. The default size is a 100% of the page width, for both width and height.

To set a chart size that adapts well to any page size, use Percent as unit. setSize(50, 75, Percent) means that the width will be half of the page width (without margins), and the height will always be 1.5 times the width (preserving the ratio between 50 and 75). This feature (Percent) leads to slightly worse results on screen at 100% zoom, due to scaling happening even at that size, but the printed report should be fine.


The documentation for this class was generated from the following file:

Copyright © 2008, Klarälvdalens Datakonsult AB KD Reports