|
Quantum GIS API Documentation
master-693a1fe
|
A composer items that draws common shapes (ellipse, triangle, rectangle) More...
#include <qgscomposershape.h>
Inheritance diagram for QgsComposerShape:
Collaboration diagram for QgsComposerShape:Public Types | |
| enum | Shape { Ellipse, Rectangle, Triangle } |
Public Slots | |
| virtual void | setRotation (double r) |
| Sets item rotation and resizes item bounds such that the shape always has the same size. | |
Public Member Functions | |
| QgsComposerShape (QgsComposition *composition) | |
| QgsComposerShape (qreal x, qreal y, qreal width, qreal height, QgsComposition *composition) | |
| ~QgsComposerShape () | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) |
| Reimplementation of QCanvasItem::paint - draw on canvas. | |
| bool | readXML (const QDomElement &itemElem, const QDomDocument &doc) |
| sets state from Dom document | |
| void | setSceneRect (const QRectF &rectangle) |
| Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit. | |
| void | setShapeType (QgsComposerShape::Shape s) |
| QgsComposerShape::Shape | shapeType () const |
| virtual int | type () const |
| return correct graphics item type. | |
| bool | writeXML (QDomElement &elem, QDomDocument &doc) const |
| stores state in Dom element | |
Protected Member Functions | |
| virtual void | drawBackground (QPainter *p) |
| Draw background. | |
| virtual void | drawFrame (QPainter *p) |
| Draw black frame around item. | |
Private Member Functions | |
| void | drawShape (QPainter *p) |
| QPointF | pointOnLineWithDistance (const QPointF &startPoint, const QPointF &directionPoint, double distance) const |
| Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point. | |
Private Attributes | |
| Shape | mShape |
| Ellipse, rectangle or triangle. | |
A composer items that draws common shapes (ellipse, triangle, rectangle)
Definition at line 26 of file qgscomposershape.h.
Definition at line 31 of file qgscomposershape.h.
| QgsComposerShape::QgsComposerShape | ( | QgsComposition * | composition | ) |
Definition at line 21 of file qgscomposershape.cpp.
References QgsComposerItem::setFrameEnabled().
| QgsComposerShape::QgsComposerShape | ( | qreal | x, |
| qreal | y, | ||
| qreal | width, | ||
| qreal | height, | ||
| QgsComposition * | composition | ||
| ) |
Definition at line 26 of file qgscomposershape.cpp.
References QgsComposerItem::setFrameEnabled(), and setSceneRect().
Definition at line 32 of file qgscomposershape.cpp.
| void QgsComposerShape::drawBackground | ( | QPainter * | p | ) | [protected, virtual] |
Draw background.
Reimplemented from QgsComposerItem.
Definition at line 97 of file qgscomposershape.cpp.
References drawShape(), and QgsComposerItem::mBackground.
Referenced by paint().
| void QgsComposerShape::drawFrame | ( | QPainter * | p | ) | [protected, virtual] |
Draw black frame around item.
Reimplemented from QgsComposerItem.
Definition at line 86 of file qgscomposershape.cpp.
References drawShape(), and QgsComposerItem::mFrame.
Referenced by paint().
| void QgsComposerShape::drawShape | ( | QPainter * | p | ) | [private] |
Definition at line 55 of file qgscomposershape.cpp.
References Ellipse, QgsComposerItem::mRotation, mShape, Rectangle, and Triangle.
Referenced by drawBackground(), and drawFrame().
| void QgsComposerShape::paint | ( | QPainter * | painter, |
| const QStyleOptionGraphicsItem * | itemStyle, | ||
| QWidget * | pWidget | ||
| ) |
Reimplementation of QCanvasItem::paint - draw on canvas.
Definition at line 37 of file qgscomposershape.cpp.
References drawBackground(), drawFrame(), and QgsComposerItem::drawSelectionBoxes().
| QPointF QgsComposerShape::pointOnLineWithDistance | ( | const QPointF & | startPoint, |
| const QPointF & | directionPoint, | ||
| double | distance | ||
| ) | const [private] |
Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point.
| bool QgsComposerShape::readXML | ( | const QDomElement & | itemElem, |
| const QDomDocument & | doc | ||
| ) | [virtual] |
sets state from Dom document
| itemElem | is Dom node corresponding to item tag |
| doc | is Dom document |
Implements QgsComposerItem.
Definition at line 117 of file qgscomposershape.cpp.
References QgsComposerItem::_readXML(), QgsComposerItem::itemChanged(), and mShape.
Referenced by QgsComposition::addItemsFromXML().
| void QgsComposerShape::setRotation | ( | double | r | ) | [virtual, slot] |
Sets item rotation and resizes item bounds such that the shape always has the same size.
Reimplemented from QgsComposerItem.
Definition at line 133 of file qgscomposershape.cpp.
References setSceneRect(), and QgsComposerItem::sizeChangedByRotation().
| void QgsComposerShape::setSceneRect | ( | const QRectF & | rectangle | ) | [virtual] |
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit.
Also, the shape is scaled
Reimplemented from QgsComposerItem.
Definition at line 148 of file qgscomposershape.cpp.
References QgsComposerItem::imageSizeConsideringRotation().
Referenced by QgsComposerShape(), and setRotation().
| void QgsComposerShape::setShapeType | ( | QgsComposerShape::Shape | s | ) | [inline] |
Definition at line 62 of file qgscomposershape.h.
Referenced by QgsComposerView::addShape().
| QgsComposerShape::Shape QgsComposerShape::shapeType | ( | ) | const [inline] |
Definition at line 61 of file qgscomposershape.h.
| virtual int QgsComposerShape::type | ( | ) | const [inline, virtual] |
return correct graphics item type.
Added in v1.7
Reimplemented from QgsComposerItem.
Definition at line 43 of file qgscomposershape.h.
References QgsComposerItem::ComposerShape.
| bool QgsComposerShape::writeXML | ( | QDomElement & | elem, |
| QDomDocument & | doc | ||
| ) | const [virtual] |
stores state in Dom element
| elem | is Dom element corresponding to 'Composer' tag |
| doc | write template file |
Implements QgsComposerItem.
Definition at line 109 of file qgscomposershape.cpp.
References QgsComposerItem::_writeXML(), and mShape.
Shape QgsComposerShape::mShape [private] |
Ellipse, rectangle or triangle.
Definition at line 82 of file qgscomposershape.h.
Referenced by drawShape(), readXML(), and writeXML().