This class represents a BPS report element. More...
#include <bpsreportelement.h>
Inheritance diagram for BpsReportElement:Public Types | |
| enum | Type { TypeUnknown, TypeReport, TypeSection, TypeSimpletext, TypeRichtext, TypeLine, TypeRectangle, TypeEllipse, TypeBarcode, TypePixmap } |
| Element type enumeration. More... | |
Public Slots | |
| virtual bool | setProperty (const char *aName, const QVariant &aValue) |
| Set the value of a named property. | |
Public Member Functions | |
| BpsReportElement (Type aType, QObject *aParent=0) | |
| Constructor for BpsReportElement. | |
| BpsReportElement (const BpsReportElement &aElement, QObject *aParent=0, bool aCopyChilds=true) | |
| Copy-constructor for BpsReportElement. | |
| BpsReportElement * | childElement (const QString &aName) const |
| Get the named child element. | |
| QGraphicsItem * | createGraphicsItem (int aResolution, const QPointF &aOffset) const |
| Creates a graphics item for external use. | |
| BpsReportElement * | firstChild () const |
| Get first child element. | |
| QGraphicsItem * | graphicsItem () const |
| Get a pointer to the internal graphics item. | |
| QLineF | handleLine () const |
| Get the line where the handles should be placed on for single selection. | |
| QRectF | handleRect () const |
| Get the rectangle where the sizing handles should be placed on. | |
| void | insertChild (int aIndex, BpsReportElement *aChild) |
| Insert a child at the specified position in the list. | |
| BpsReportElement * | lastChild () const |
| Get last child element. | |
| QPointF | offset () const |
| Get the current drawing offset. | |
| BpsReportElement * | parentElement () const |
| Get the parent element. | |
| int | resolution () const |
| Get current drawing resolution. | |
| void | setOffset (const QPointF &aOffset) |
| Set the drawing offset in millimeters. | |
| void | setResolution (int aResolution) |
| Sets the resolution as number of points per inch. | |
| Type | type () const |
| Type | typeByName (const QString &aTypeName) const |
| QString | typeName () const |
Protected Member Functions | |
| virtual BpsPropertyObject * | xmlCreateObject (const QString &aTagName, int aLevel) const |
| Create a new object while processing loadXml(). | |
| virtual QString | xmlTagName (int aLevel) const |
| Define a XML tag for the element of the level. | |
This class represents a BPS report element.
A report is represented by three layers of elements:
Property Matrix:
| Name | Type/values | Report | Section | Simpletext | Richtext | Line | Rectangle | Ellipse | Barcode | Pixmap |
|---|---|---|---|---|---|---|---|---|---|---|
| alignment | Bps::Alignment | no | no | yes | no | no | no | no | no | yes |
| application (*) | QString | yes | no | no | no | no | no | no | no | no |
| autogrow | bool | no | yes | no | no | no | no | no | no | no |
| barcodetype | BpsGraphicsBarcodeItem::BarcodeType | no | no | no | no | no | no | no | yes | no |
| brush | QBrush | no | no | yes | yes | no | yes | yes | no | no |
| color | QColor | no | no | yes | yes | no | no | no | yes | no |
| datastore (*) | BpsDatastore | yes | no | no | no | no | no | no | no | no |
| direction | Bps::Direction | no | no | yes | yes | no | no | no | yes | no |
| emptyok | bool | yes | no | no | no | no | no | no | no | no |
| font | QFont | no | no | yes | yes | no | no | no | yes | no |
| height | qreal (mm) | no | yes | no | no | no | no | no | no | no |
| margins | BpsMargins (mm) | yes | no | yes | yes | no | no | no | no | no |
| module | qreal (mm) | no | no | no | no | no | no | no | yes | no |
| name | QString | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| orientation | QPrinter::Orientation | yes | no | no | no | no | no | no | no | no |
| p1 | QPointF | no | no | no | no | yes | no | no | no | no |
| p2 | QPointF | no | no | no | no | yes | no | no | no | no |
| paper | QPrinter::Papersize | yes | no | no | no | no | no | no | no | no |
| papersize | QSizeF (mm) | yes | no | no | no | no | no | no | no | no |
| pen | QPen | no | no | yes | yes | yes | yes | yes | no | no |
| pixmap | QPixmap | no | no | no | no | no | no | no | no | yes |
| pos | QPointF | no | no | yes | yes | no | yes | yes | yes | yes |
| position | Bps::VerticalAlignment | no | yes | no | no | no | no | no | no | no |
| ppi | int (points per inch) | no | no | no | no | no | no | no | no | yes |
| rotation | Bps::Rotation | no | no | no | no | no | no | no | no | yes |
| rounded | bool | no | no | no | no | yes | no | no | no | no |
| roundness | int (0% - 100%) | no | no | yes | yes | no | yes | no | no | no |
| script | QString | yes | no | no | no | no | no | no | no | no |
| selections (*) | QMap<QString,QVariantList> | yes | no | no | no | no | no | no | no | no |
| sid (*) | QString | yes | no | no | no | no | no | no | no | no |
| size | QSizeF | no | no | yes | no | no | yes | yes | yes | yes |
| sizing | BpsGraphicsPixmapItem::Sizing | no | no | no | no | no | no | no | no | yes |
| spanAngle | qreal (degree) | no | no | no | no | no | no | yes | no | no |
| startAngle | qreal (degree) | no | no | no | no | no | no | yes | no | no |
| text | QString | no | no | yes | yes | no | no | no | yes | no |
| textprinted | bool | no | no | no | no | no | no | no | yes | no |
| title (*) | QString | yes | no | no | no | no | no | no | no | no |
| usedselections | QString | yes | no | no | no | no | no | no | no | no |
| width | qreal (mm) | no | no | no | yes | no | no | no | no | no |
| zvalue | int | no | no | yes | yes | yes | yes | yes | yes | yes |
(*) Dynamically applied at runtime before executing the report script:
Element type enumeration.
| BpsReportElement::BpsReportElement | ( | Type | aType, |
| QObject * | aParent = 0 |
||
| ) |
Constructor for BpsReportElement.
| [in] | aType | The element type. |
| [in] | aParent | The parent widget. |
| BpsReportElement::BpsReportElement | ( | const BpsReportElement & | aElement, |
| QObject * | aParent = 0, |
||
| bool | aCopyChilds = true |
||
| ) |
Copy-constructor for BpsReportElement.
| [in] | aElement | The element to clone. |
| [in] | aParent | The parent widget. |
| [in] | aCopyChilds | When true, a deep copy is performed where all children are also cloned. |
| BpsReportElement* BpsReportElement::childElement | ( | const QString & | aName | ) | const |
Get the named child element.
| [in] | aName | The name of the element. |
| BpsException | Thrown when no such child element is found. |
| QGraphicsItem* BpsReportElement::createGraphicsItem | ( | int | aResolution, |
| const QPointF & | aOffset | ||
| ) | const |
Creates a graphics item for external use.
The item will be owned by the caller, so the application is responsible for deleting the item when no longer needed. Compared to graphicsItem(), this one is static copy which will not get updated when changing the element properties.
| [in] | aResolution | Resolution to scale to. |
| [in] | aOffset | The drawing offset, added to the items normal position. |
| BpsReportElement* BpsReportElement::firstChild | ( | ) | const |
Get first child element.
| QGraphicsItem* BpsReportElement::graphicsItem | ( | ) | const |
Get a pointer to the internal graphics item.
This can be used for interactive applications like the report designer, where updating the element properties will be reflected immediately. For other uses such as printing it may be better to use createGraphicsItem() instead. The item is owned by the report element. In case you use it on a graphics scene, you have to make sure it is not getting deleted by the scenes destructor (e.g. remove it in the scene destructor).
| QLineF BpsReportElement::handleLine | ( | ) | const |
Get the line where the handles should be placed on for single selection.
The values are in mm. For any other element except line, this will return a null QLineF.
| QRectF BpsReportElement::handleRect | ( | ) | const |
Get the rectangle where the sizing handles should be placed on.
The values are in mm.
For reports and sections a null QRectF is returned. For lines this is used to calculate the overall handle positions when multiple items are selected.
| void BpsReportElement::insertChild | ( | int | aIndex, |
| BpsReportElement * | aChild | ||
| ) |
Insert a child at the specified position in the list.
| [in] | aIndex | The position to insert at. |
| [in] | aChild | Pointer to the child to be inserted. |
| BpsReportElement* BpsReportElement::lastChild | ( | ) | const |
Get last child element.
| QPointF BpsReportElement::offset | ( | ) | const |
Get the current drawing offset.
| BpsReportElement* BpsReportElement::parentElement | ( | ) | const |
Get the parent element.
| int BpsReportElement::resolution | ( | ) | const |
Get current drawing resolution.
| void BpsReportElement::setOffset | ( | const QPointF & | aOffset | ) |
Set the drawing offset in millimeters.
The default is (0,0). Setting the offset will propagate automatically to child elements.
| [in] | aOffset | The new drawing offset. |
| virtual bool BpsReportElement::setProperty | ( | const char * | aName, |
| const QVariant & | aValue | ||
| ) | [virtual, slot] |
Set the value of a named property.
Attempts to set the value of a not existing property, or a property with the attribute readOnly are ignored.
| [in] | aName | Name of the property. |
| [in] | aValue | The new value. |
Reimplemented from BpsPropertyObject.
| void BpsReportElement::setResolution | ( | int | aResolution | ) |
Sets the resolution as number of points per inch.
The default is set to the screen resolution. Setting the resolution will propagate automatically to child elements.
| [in] | aResolution | The new resolution to set. Must be >= 1. |
| BpsException | Thrown when setting a resolution < 1. |
| Type BpsReportElement::type | ( | ) | const |
| Type BpsReportElement::typeByName | ( | const QString & | aTypeName | ) | const |
| [in] | aTypeName | The type name. |
| QString BpsReportElement::typeName | ( | ) | const |
| virtual BpsPropertyObject* BpsReportElement::xmlCreateObject | ( | const QString & | aTagName, |
| int | aLevel | ||
| ) | const [protected, virtual] |
Create a new object while processing loadXml().
| [in] | aTagName | Tag name of the element to be created. |
| [in] | aLevel | Element level. |
Reimplemented from BpsPropertyObject.
| virtual QString BpsReportElement::xmlTagName | ( | int | aLevel | ) | const [protected, virtual] |
Define a XML tag for the element of the level.
| [in] | aLevel | Element level. The top level is 0. |
Reimplemented from BpsPropertyObject.