QGIS API Documentation
2.8.2-Wien
|
A item that forms part of a map composition. More...
#include <qgscomposeritem.h>
Public Slots | |
virtual void | refreshDataDefinedProperty (const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties) override |
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value. | |
void | repaint () override |
virtual void | setItemRotation (const double r, const bool adjustPosition=false) |
Sets the item rotation. | |
virtual void | setRotation (double r) |
Sets the item rotation. | |
Public Slots inherited from QgsComposerObject | |
virtual void | refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties) |
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value. | |
virtual void | repaint () |
Triggers a redraw for the item. |
Signals | |
void | frameChanged () |
Emitted if the item's frame style changes. | |
void | itemRotationChanged (double newRotation) |
Is emitted on item rotation change. | |
void | lockChanged () |
Emitted if the item's lock status changes. | |
void | sizeChanged () |
Emitted if the rectangle changes. | |
Signals inherited from QgsComposerObject | |
void | itemChanged () |
Emitted when the item changes. |
Public Member Functions | |
QgsComposerItem (QgsComposition *composition, bool manageZValue=true) | |
Constructor. | |
QgsComposerItem (qreal x, qreal y, qreal width, qreal height, QgsComposition *composition, bool manageZValue=true) | |
Constructor with box position and composer object. | |
virtual | ~QgsComposerItem () |
bool | _readXML (const QDomElement &itemElem, const QDomDocument &doc) |
Reads parameter that are not subclass specific in document. | |
bool | _writeXML (QDomElement &itemElem, QDomDocument &doc) const |
Writes parameter that are not subclass specific in document. | |
virtual void | addItem (QgsComposerItem *item) |
Composite operations for item groups do nothing per default. | |
QColor | backgroundColor () const |
Gets the background color for this item. | |
void | beginCommand (const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown) |
Starts new composer undo command. | |
virtual void | beginItemCommand (const QString &text) |
QPainter::CompositionMode | blendMode () const |
Returns the item's composition blending mode. | |
void | cancelCommand () |
virtual QString | displayName () const |
Get item display name. | |
Q_DECL_DEPRECATED void | drawText (QPainter *p, double x, double y, const QString &text, const QFont &font, const QColor &c=QColor()) const |
Draws Text. | |
Q_DECL_DEPRECATED void | drawText (QPainter *p, const QRectF &rect, const QString &text, const QFont &font, Qt::AlignmentFlag halignment=Qt::AlignLeft, Qt::AlignmentFlag valignment=Qt::AlignTop, int flags=Qt::TextWordWrap) const |
Like the above, but with a rectangle for multiline text. | |
bool | effectsEnabled () const |
Returns whether effects (eg blend modes) are enabled for the item. | |
void | endCommand () |
Finish current command and push it onto the undo stack. | |
virtual void | endItemCommand () |
virtual double | estimatedFrameBleed () const |
Returns the estimated amount the item's frame bleeds outside the item's actual rectangle. | |
bool | excludeFromExports (const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) |
Returns whether the item should be excluded from composer exports and prints. | |
Q_DECL_DEPRECATED double | fontAscentMillimeters (const QFont &font) const |
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. | |
Q_DECL_DEPRECATED double | fontDescentMillimeters (const QFont &font) const |
Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. | |
Q_DECL_DEPRECATED double | fontHeightCharacterMM (const QFont &font, const QChar &c) const |
Returns the font height of a character in millimeters. | |
Q_DECL_DEPRECATED double | fontHeightMillimeters (const QFont &font) const |
Returns the font height in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. | |
Qt::PenJoinStyle | frameJoinStyle () const |
Returns the join style used for drawing the item's frame. | |
QColor | frameOutlineColor () const |
Returns the frame's outline color. | |
double | frameOutlineWidth () const |
Returns the frame's outline width. | |
bool | hasBackground () const |
Whether this item has a Background or not. | |
bool | hasFrame () const |
Whether this item has a frame or not. | |
QString | id () const |
Get item's id (which is not necessarly unique) | |
bool | isGroupMember () const |
Returns whether this item is part of a group. | |
virtual bool | isRemoved () const |
Returns whether this item has been removed from the composition. | |
double | itemRotation (const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) const |
Returns the current rotation for the composer item. | |
ItemPositionMode | lastUsedPositionMode () |
Returns item's last used position mode. | |
void | move (double dx, double dy) |
Moves item in canvas coordinates. | |
virtual void | moveContent (double dx, double dy) |
Move Content of item. | |
virtual int | numberExportLayers () const |
Get the number of layers that this item requires for exporting as layers. | |
int | page () const |
Gets the page the item is currently on. | |
QPointF | pagePos () const |
Returns the item's position relative to its current page. | |
Q_DECL_DEPRECATED double | pixelFontSize (double pointSize) const |
Calculates font size in mm from a font point size. | |
bool | positionLock () const |
Returns whether position lock for mouse drags is enabled returns true if item is locked for mouse movement and resizing. | |
virtual QRectF | rectWithFrame () const |
Returns the item's rectangular bounds, including any bleed caused by the item's frame. | |
virtual void | removeItems () |
Q_DECL_DEPRECATED double | rotation () const |
Returns the rotation for the composer item. | |
Q_DECL_DEPRECATED QFont | scaledFontPixelSize (const QFont &font) const |
Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE. | |
virtual bool | selected () const |
Is selected. | |
void | setBackgroundColor (const QColor &backgroundColor) |
Sets the background color for this item. | |
void | setBackgroundEnabled (const bool drawBackground) |
Set whether this item has a Background drawn around it or not. | |
void | setBlendMode (const QPainter::CompositionMode blendMode) |
Sets the item's composition blending mode. | |
virtual void | setCurrentExportLayer (const int layerIdx=-1) |
Sets the current layer to draw for exporting. | |
void | setEffectsEnabled (const bool effectsEnabled) |
Sets whether effects (eg blend modes) are enabled for the item. | |
virtual void | setExcludeFromExports (const bool exclude) |
Sets whether the item should be excluded from composer exports and prints. | |
virtual void | setFrameEnabled (const bool drawFrame) |
Set whether this item has a frame drawn around it or not. | |
void | setFrameJoinStyle (const Qt::PenJoinStyle style) |
Sets join style used when drawing the item's frame. | |
virtual void | setFrameOutlineColor (const QColor &color) |
Sets frame outline color. | |
virtual void | setFrameOutlineWidth (const double outlineWidth) |
Sets frame outline width. | |
virtual void | setId (const QString &id) |
Set item's id (which is not necessarly unique) | |
void | setIsGroupMember (const bool isGroupMember) |
Sets whether this item is part of a group. | |
void | setIsRemoved (const bool removed) |
Sets whether this item has been removed from the composition. | |
void | setItemPosition (double x, double y, ItemPositionMode itemPoint=UpperLeft, int page=-1) |
Moves the item to a new position (in canvas coordinates) | |
void | setItemPosition (double x, double y, double width, double height, ItemPositionMode itemPoint=UpperLeft, bool posIncludesFrame=false, int page=-1) |
Sets item position and width / height in one go. | |
void | setPositionLock (const bool lock) |
Locks / unlocks the item position for mouse drags. | |
virtual void | setSceneRect (const QRectF &rectangle) |
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit. | |
virtual void | setSelected (bool s) |
Set selected, selected item should be highlighted. | |
void | setTransparency (const int transparency) |
Sets the item's transparency. | |
virtual void | setVisibility (const bool visible) |
Sets visibility for item. | |
Q_DECL_DEPRECATED double | textWidthMillimeters (const QFont &font, const QString &text) const |
Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. | |
int | transparency () const |
Returns the item's transparency. | |
virtual int | type () const override |
return correct graphics item type. | |
virtual void | updateItem () |
Updates item, with the possibility to do custom update for subclasses. | |
void | updatePagePos (double newPageWidth, double newPageHeight) |
Moves the item so that it retains its relative position on the page when the paper size changes. | |
QString | uuid () const |
Get item identification name. | |
virtual Q_DECL_DEPRECATED void | zoomContent (int delta, double x, double y) |
Zoom content of item. | |
virtual void | zoomContent (const double factor, const QPointF point, const ZoomMode mode=QgsComposerItem::Zoom) |
Zoom content of item. | |
Public Member Functions inherited from QgsComposerObject | |
QgsComposerObject (QgsComposition *composition) | |
Constructor. | |
virtual | ~QgsComposerObject () |
const QgsComposition * | composition () const |
Returns the composition the item is attached to. | |
QgsComposition * | composition () |
QgsDataDefined * | dataDefinedProperty (const DataDefinedProperty property) const |
Returns a reference to the data defined settings for one of the item's data defined properties. | |
virtual bool | readXML (const QDomElement &itemElem, const QDomDocument &doc) |
Sets item state from DOM element. | |
void | setDataDefinedProperty (const DataDefinedProperty property, const bool active, const bool useExpression, const QString &expression, const QString &field) |
Sets parameters for a data defined property for the item. | |
virtual bool | writeXML (QDomElement &elem, QDomDocument &doc) const |
Stores item state in DOM element. |
Protected Member Functions | |
Q_DECL_DEPRECATED double | angle (const QPointF &p1, const QPointF &p2) const |
Returns angle of the line from p1 to p2 (clockwise, starting at N) | |
Q_DECL_DEPRECATED bool | cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height, double rotation) const |
Calculates corner point after rotation and scaling. | |
Q_DECL_DEPRECATED bool | cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height) const |
Calculates corner point after rotation and scaling. | |
void | deleteAlignItems () |
void | deleteHAlignSnapItem () |
void | deleteVAlignSnapItem () |
Q_DECL_DEPRECATED void | drawArrowHead (QPainter *p, double x, double y, double angle, double arrowHeadWidth) const |
Draws arrowhead. | |
virtual void | drawBackground (QPainter *p) |
Draw background. | |
virtual void | drawFrame (QPainter *p) |
Draw black frame around item. | |
virtual void | drawSelectionBoxes (QPainter *p) |
Draws additional graphics on selected items. | |
QRectF | evalItemRect (const QRectF &newRect, const bool resizeOnly=false) |
Evaluates an item's bounding rect to consider data defined position and size of item and reference point. | |
QGraphicsLineItem * | hAlignSnapItem () |
Return horizontal align snap item. | |
double | horizontalViewScaleFactor () const |
Returns the zoom factor of the graphics view. | |
Q_DECL_DEPRECATED bool | imageSizeConsideringRotation (double &width, double &height, double rotation) const |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. | |
Q_DECL_DEPRECATED bool | imageSizeConsideringRotation (double &width, double &height) const |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. | |
Q_DECL_DEPRECATED QRectF | largestRotatedRectWithinBounds (QRectF originalRect, QRectF boundsRect, double rotation) const |
Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by a specified amount. | |
Q_DECL_DEPRECATED double | lockSymbolSize () const |
Returns the size of the lock symbol depending on the composer zoom level and the item size. | |
double | rectHandlerBorderTolerance () const |
Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to the item border for resizing. | |
Q_DECL_DEPRECATED void | rotate (double angle, double &x, double &y) const |
Rotates a point / vector. | |
bool | shouldDrawItem () const |
Returns whether the item should be drawn in the current context. | |
Q_DECL_DEPRECATED void | sizeChangedByRotation (double &width, double &height, double rotation) |
Calculates width / height of the bounding box of a rotated rectangle. | |
Q_DECL_DEPRECATED void | sizeChangedByRotation (double &width, double &height) |
Calculates width / height of the bounding box of a rotated rectangle. | |
QGraphicsLineItem * | vAlignSnapItem () |
Return vertical align snap item. | |
Protected Member Functions inherited from QgsComposerObject | |
bool | dataDefinedEvaluate (const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue) |
Evaluate a data defined property and return the calculated value. |
Protected Attributes | |
bool | mBackground |
True if item background needs to be painted. | |
QColor | mBackgroundColor |
Background color. | |
QPainter::CompositionMode | mBlendMode |
Composition blend mode for item. | |
QGraphicsRectItem * | mBoundingResizeRectangle |
Rectangle used during move and resize actions. | |
int | mCurrentExportLayer |
The layer that needs to be exported. | |
QgsComposerItem::MouseMoveAction | mCurrentMouseMoveAction |
QgsComposerEffect * | mEffect |
bool | mEffectsEnabled |
bool | mEvaluatedExcludeFromExports |
Temporary evaluated item exclusion. | |
double | mEvaluatedItemRotation |
Temporary evaluated item rotation in degrees, clockwise. | |
bool | mExcludeFromExports |
Whether item should be excluded in exports. | |
bool | mFrame |
True if item fram needs to be painted. | |
Qt::PenJoinStyle | mFrameJoinStyle |
Frame join style. | |
QGraphicsLineItem * | mHAlignSnapItem |
bool | mIsGroupMember |
Whether or not this item is part of a group. | |
bool | mItemPositionLocked |
True if item position and size cannot be changed with mouse move. | |
double | mItemRotation |
Item rotation in degrees, clockwise. | |
QPointF | mLastMouseEventPos |
Position of the last mouse move event (in scene coordinates) | |
ItemPositionMode | mLastUsedPositionMode |
The item's position mode. | |
double | mLastValidViewScaleFactor |
Backup to restore item appearance if no view scale factor is available. | |
QPointF | mMouseMoveStartPos |
Start point of the last mouse move action (in scene coordinates) | |
bool | mRemovedFromComposition |
True if item has been removed from the composition. | |
int | mTransparency |
Item transparency. | |
QGraphicsLineItem * | mVAlignSnapItem |
Protected Attributes inherited from QgsComposerObject | |
QgsComposition * | mComposition |
QMap < QgsComposerObject::DataDefinedProperty, QString > | mDataDefinedNames |
Map of data defined properties for the item to string name to use when exporting item to xml. |
Friends | |
class | QgsComposerItemGroup |
A item that forms part of a map composition.
Definition at line 38 of file qgscomposeritem.h.
UpperLeft | |
UpperMiddle | |
UpperRight | |
MiddleLeft | |
Middle | |
MiddleRight | |
LowerLeft | |
LowerMiddle | |
LowerRight |
Definition at line 79 of file qgscomposeritem.h.
Definition at line 43 of file qgscomposeritem.h.
Describes the action (move or resize in different directon) to be done during mouse move.
MoveItem | |
ResizeUp | |
ResizeDown | |
ResizeLeft | |
ResizeRight | |
ResizeLeftUp | |
ResizeRightUp | |
ResizeLeftDown | |
ResizeRightDown | |
NoAction |
Definition at line 65 of file qgscomposeritem.h.
Modes for zooming item content.
Definition at line 96 of file qgscomposeritem.h.
QgsComposerItem::QgsComposerItem | ( | QgsComposition * | composition, |
bool | manageZValue = true |
||
) |
Constructor.
composition | parent composition |
manageZValue | true if the z-Value of this object should be managed by mComposition |
Definition at line 52 of file qgscomposeritem.cpp.
QgsComposerItem::QgsComposerItem | ( | qreal | x, |
qreal | y, | ||
qreal | width, | ||
qreal | height, | ||
QgsComposition * | composition, | ||
bool | manageZValue = true |
||
) |
Constructor with box position and composer object.
x | x coordinate of item |
y | y coordinate of item |
width | width of item |
height | height of item |
composition | parent composition |
manageZValue | true if the z-Value of this object should be managed by mComposition |
Definition at line 81 of file qgscomposeritem.cpp.
|
virtual |
Definition at line 147 of file qgscomposeritem.cpp.
bool QgsComposerItem::_readXML | ( | const QDomElement & | itemElem, |
const QDomDocument & | doc | ||
) |
Reads parameter that are not subclass specific in document.
Usually called from readXML methods of subclasses
Definition at line 262 of file qgscomposeritem.cpp.
bool QgsComposerItem::_writeXML | ( | QDomElement & | itemElem, |
QDomDocument & | doc | ||
) | const |
Writes parameter that are not subclass specific in document.
Usually called from writeXML methods of subclasses
Definition at line 172 of file qgscomposeritem.cpp.
|
inlinevirtual |
Composite operations for item groups do nothing per default.
Reimplemented in QgsComposerItemGroup.
Definition at line 391 of file qgscomposeritem.h.
|
protected |
Returns angle of the line from p1 to p2 (clockwise, starting at N)
Definition at line 867 of file qgscomposeritem.cpp.
|
inline |
Gets the background color for this item.
Definition at line 340 of file qgscomposeritem.h.
void QgsComposerItem::beginCommand | ( | const QString & | commandText, |
QgsComposerMergeCommand::Context | c = QgsComposerMergeCommand::Unknown |
||
) |
Starts new composer undo command.
commandText | command title |
c | context for mergeable commands (unknown for non-mergeable commands |
Definition at line 482 of file qgscomposeritem.cpp.
|
inlinevirtual |
Reimplemented in QgsComposerFrame.
Definition at line 394 of file qgscomposeritem.h.
|
inline |
Returns the item's composition blending mode.
Definition at line 354 of file qgscomposeritem.h.
void QgsComposerItem::cancelCommand | ( | ) |
Definition at line 498 of file qgscomposeritem.cpp.
|
protected |
Calculates corner point after rotation and scaling.
Definition at line 1198 of file qgscomposeritem.cpp.
|
protected |
Calculates corner point after rotation and scaling.
Reimplemented in QgsComposerMap, and QgsComposerPicture.
Definition at line 1190 of file qgscomposeritem.cpp.
|
protected |
Definition at line 1329 of file qgscomposeritem.cpp.
|
protected |
Definition at line 1309 of file qgscomposeritem.cpp.
|
protected |
Definition at line 1319 of file qgscomposeritem.cpp.
|
virtual |
Get item display name.
This is the item's id if set, and if not, a user-friendly string identifying item type.
Reimplemented in QgsComposerMap, QgsComposerLegend, QgsComposerLabel, QgsComposerShape, and QgsComposerFrame.
Definition at line 1406 of file qgscomposeritem.cpp.
|
protected |
Draws arrowhead.
Definition at line 862 of file qgscomposeritem.cpp.
|
protectedvirtual |
Draw background.
Reimplemented in QgsComposerShape.
Definition at line 849 of file qgscomposeritem.cpp.
|
protectedvirtual |
Draw black frame around item.
Reimplemented in QgsComposerShape, and QgsComposerItemGroup.
Definition at line 539 of file qgscomposeritem.cpp.
|
protectedvirtual |
Draws additional graphics on selected items.
The base implementation has no effect.
Definition at line 506 of file qgscomposeritem.cpp.
void QgsComposerItem::drawText | ( | QPainter * | p, |
double | x, | ||
double | y, | ||
const QString & | text, | ||
const QFont & | font, | ||
const QColor & | c = QColor() |
||
) | const |
Draws Text.
Takes care about all the composer specific issues (calculation to pixel, scaling of font and painter to work around the Qt font bug)
Definition at line 943 of file qgscomposeritem.cpp.
void QgsComposerItem::drawText | ( | QPainter * | p, |
const QRectF & | rect, | ||
const QString & | text, | ||
const QFont & | font, | ||
Qt::AlignmentFlag | halignment = Qt::AlignLeft , |
||
Qt::AlignmentFlag | valignment = Qt::AlignTop , |
||
int | flags = Qt::TextWordWrap |
||
) | const |
Like the above, but with a rectangle for multiline text.
p | painter to use |
rect | rectangle to draw into |
text | text to draw |
font | font to use |
halignment | optional horizontal alignment |
valignment | optional vertical alignment |
flags | allows for passing Qt::TextFlags to control appearance of rendered text |
Definition at line 948 of file qgscomposeritem.cpp.
|
inline |
Returns whether effects (eg blend modes) are enabled for the item.
Definition at line 380 of file qgscomposeritem.h.
void QgsComposerItem::endCommand | ( | ) |
Finish current command and push it onto the undo stack.
Definition at line 490 of file qgscomposeritem.cpp.
|
inlinevirtual |
Reimplemented in QgsComposerFrame.
Definition at line 401 of file qgscomposeritem.h.
|
virtual |
Returns the estimated amount the item's frame bleeds outside the item's actual rectangle.
For instance, if the item has a 2mm frame outline, then 1mm of this frame is drawn outside the item's rect. In this case the return value will be 1.0
Reimplemented in QgsComposerShape.
Definition at line 466 of file qgscomposeritem.cpp.
|
protected |
Evaluates an item's bounding rect to consider data defined position and size of item and reference point.
newRect | target bouding rect for item |
resizeOnly | set to true if the item is only being resized. If true then the position of the returned rect will be adjusted to account for the item's position mode |
Definition at line 711 of file qgscomposeritem.cpp.
bool QgsComposerItem::excludeFromExports | ( | const QgsComposerObject::PropertyValueType | valueType = QgsComposerObject::EvaluatedValue | ) |
Returns whether the item should be excluded from composer exports and prints.
valueType | controls whether the returned value is the user specified vaule, or the current evaluated value (which may be affected by data driven settings). |
Definition at line 1464 of file qgscomposeritem.cpp.
double QgsComposerItem::fontAscentMillimeters | ( | const QFont & | font | ) | const |
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE.
Definition at line 962 of file qgscomposeritem.cpp.
double QgsComposerItem::fontDescentMillimeters | ( | const QFont & | font | ) | const |
Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE.
Definition at line 967 of file qgscomposeritem.cpp.
double QgsComposerItem::fontHeightCharacterMM | ( | const QFont & | font, |
const QChar & | c | ||
) | const |
Returns the font height of a character in millimeters.
Definition at line 957 of file qgscomposeritem.cpp.
double QgsComposerItem::fontHeightMillimeters | ( | const QFont & | font | ) | const |
Returns the font height in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE.
Font height equals the font ascent+descent+1 (for baseline).
Definition at line 972 of file qgscomposeritem.cpp.
|
signal |
Emitted if the item's frame style changes.
|
inline |
Returns the join style used for drawing the item's frame.
Definition at line 289 of file qgscomposeritem.h.
|
inline |
Returns the frame's outline color.
Only used if hasFrame is true.
Definition at line 259 of file qgscomposeritem.h.
|
inline |
Returns the frame's outline width.
Only used if hasFrame is true.
Definition at line 279 of file qgscomposeritem.h.
|
protected |
Return horizontal align snap item.
Creates a new graphics line if 0
Definition at line 1285 of file qgscomposeritem.cpp.
|
inline |
Whether this item has a Background or not.
Definition at line 325 of file qgscomposeritem.h.
|
inline |
Whether this item has a frame or not.
Definition at line 230 of file qgscomposeritem.h.
|
protected |
Returns the zoom factor of the graphics view.
Definition at line 987 of file qgscomposeritem.cpp.
|
inline |
Get item's id (which is not necessarly unique)
Reimplemented in QgsComposerMap.
Definition at line 499 of file qgscomposeritem.h.
|
protected |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation.
Definition at line 1119 of file qgscomposeritem.cpp.
|
protected |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation.
Reimplemented in QgsComposerMap, and QgsComposerPicture.
Definition at line 1111 of file qgscomposeritem.cpp.
|
inline |
Returns whether this item is part of a group.
Definition at line 554 of file qgscomposeritem.h.
|
inlinevirtual |
Returns whether this item has been removed from the composition.
Items removed from the composition are not deleted so that they can be restored via an undo command.
Definition at line 128 of file qgscomposeritem.h.
double QgsComposerItem::itemRotation | ( | const QgsComposerObject::PropertyValueType | valueType = QgsComposerObject::EvaluatedValue | ) | const |
Returns the current rotation for the composer item.
valueType | controls whether the returned value is the user specified rotation, or the current evaluated rotation (which may be affected by data driven rotation settings). |
Definition at line 570 of file qgscomposeritem.cpp.
|
signal |
Is emitted on item rotation change.
|
protected |
Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by a specified amount.
originalRect | QRectF to be rotated and scaled |
boundsRect | QRectF specifying the bounds which the rotated and scaled rectangle must fit within |
rotation | the rotation in degrees to be applied to the rectangle |
Definition at line 1185 of file qgscomposeritem.cpp.
|
inline |
Returns item's last used position mode.
Definition at line 211 of file qgscomposeritem.h.
|
signal |
Emitted if the item's lock status changes.
|
protected |
Returns the size of the lock symbol depending on the composer zoom level and the item size.
Definition at line 1024 of file qgscomposeritem.cpp.
void QgsComposerItem::move | ( | double | dx, |
double | dy | ||
) |
Moves item in canvas coordinates.
Definition at line 575 of file qgscomposeritem.cpp.
|
inlinevirtual |
Move Content of item.
Does nothing per default (but implemented in composer map)
dx | move in x-direction (canvas coordinates) |
dy | move in y-direction(canvas coordinates) |
Reimplemented in QgsComposerMap.
Definition at line 151 of file qgscomposeritem.h.
|
inlinevirtual |
Get the number of layers that this item requires for exporting as layers.
Reimplemented in QgsComposerMap.
Definition at line 569 of file qgscomposeritem.h.
int QgsComposerItem::page | ( | ) | const |
Gets the page the item is currently on.
Definition at line 581 of file qgscomposeritem.cpp.
QPointF QgsComposerItem::pagePos | ( | ) | const |
Returns the item's position relative to its current page.
Definition at line 594 of file qgscomposeritem.cpp.
double QgsComposerItem::pixelFontSize | ( | double | pointSize | ) | const |
Calculates font size in mm from a font point size.
Definition at line 977 of file qgscomposeritem.cpp.
|
inline |
Returns whether position lock for mouse drags is enabled returns true if item is locked for mouse movement and resizing.
Definition at line 474 of file qgscomposeritem.h.
|
protected |
Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to the item border for resizing.
Definition at line 1006 of file qgscomposeritem.cpp.
|
virtual |
Returns the item's rectangular bounds, including any bleed caused by the item's frame.
The bounds are returned in the item's coordinate system (see Qt's QGraphicsItem docs for more details about QGraphicsItem coordinate systems). The results differ from Qt's rect() function, as rect() makes no allowances for the portion of outlines which are drawn outside of the item.
Definition at line 476 of file qgscomposeritem.cpp.
|
overridevirtualslot |
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value.
property | data defined property to refresh. If property is set to QgsComposerItem::AllProperties then all data defined properties for the item will be refreshed. |
Definition at line 1340 of file qgscomposeritem.cpp.
|
inlinevirtual |
Reimplemented in QgsComposerItemGroup.
Definition at line 392 of file qgscomposeritem.h.
|
overrideslot |
Definition at line 1335 of file qgscomposeritem.cpp.
|
protected |
Rotates a point / vector.
angle | rotation angle in degrees, counterclockwise |
x | in/out: x coordinate before / after the rotation |
y | in/out: y cooreinate before / after the rotation |
Definition at line 1280 of file qgscomposeritem.cpp.
|
inline |
Returns the rotation for the composer item.
Reimplemented in QgsComposerMap, and QgsComposerPicture.
Definition at line 490 of file qgscomposeritem.h.
QFont QgsComposerItem::scaledFontPixelSize | ( | const QFont & | font | ) | const |
Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE.
Definition at line 982 of file qgscomposeritem.cpp.
|
inlinevirtual |
Is selected.
Definition at line 143 of file qgscomposeritem.h.
void QgsComposerItem::setBackgroundColor | ( | const QColor & | backgroundColor | ) |
Sets the background color for this item.
backgroundColor | new background color |
Definition at line 872 of file qgscomposeritem.cpp.
|
inline |
Set whether this item has a Background drawn around it or not.
drawBackground | draw Background |
Definition at line 333 of file qgscomposeritem.h.
void QgsComposerItem::setBlendMode | ( | const QPainter::CompositionMode | blendMode | ) |
Sets the item's composition blending mode.
blendMode | blending mode for item |
Definition at line 878 of file qgscomposeritem.cpp.
|
inlinevirtual |
Sets the current layer to draw for exporting.
layerIdx | can be set to -1 to draw all item layers, and must be less than numberExportLayers() |
Definition at line 576 of file qgscomposeritem.h.
void QgsComposerItem::setEffectsEnabled | ( | const bool | effectsEnabled | ) |
Sets whether effects (eg blend modes) are enabled for the item.
effectsEnabled | set to true to enable effects |
Definition at line 936 of file qgscomposeritem.cpp.
|
virtual |
Sets whether the item should be excluded from composer exports and prints.
exclude | set to true to exclude the item from exports |
Definition at line 1469 of file qgscomposeritem.cpp.
|
virtual |
Set whether this item has a frame drawn around it or not.
drawFrame | draw frame |
Reimplemented in QgsComposerLabel.
Definition at line 413 of file qgscomposeritem.cpp.
void QgsComposerItem::setFrameJoinStyle | ( | const Qt::PenJoinStyle | style | ) |
Sets join style used when drawing the item's frame.
style | Join style for outline frame |
Definition at line 451 of file qgscomposeritem.cpp.
|
virtual |
Sets frame outline color.
color | new color for outline frame |
Definition at line 425 of file qgscomposeritem.cpp.
|
virtual |
Sets frame outline width.
outlineWidth | new width for outline frame |
Reimplemented in QgsComposerMap, and QgsComposerLabel.
Definition at line 438 of file qgscomposeritem.cpp.
|
virtual |
Set item's id (which is not necessarly unique)
id | new id for item |
Definition at line 1381 of file qgscomposeritem.cpp.
void QgsComposerItem::setIsGroupMember | ( | const bool | isGroupMember | ) |
Sets whether this item is part of a group.
isGroupMember | set to true if item is in a group |
Definition at line 1400 of file qgscomposeritem.cpp.
|
inline |
Sets whether this item has been removed from the composition.
Items removed from the composition are not deleted so that they can be restored via an undo command.
removed | set to true if the item has been removed from the composition |
Definition at line 137 of file qgscomposeritem.h.
void QgsComposerItem::setItemPosition | ( | double | x, |
double | y, | ||
ItemPositionMode | itemPoint = UpperLeft , |
||
int | page = -1 |
||
) |
Moves the item to a new position (in canvas coordinates)
Definition at line 615 of file qgscomposeritem.cpp.
void QgsComposerItem::setItemPosition | ( | double | x, |
double | y, | ||
double | width, | ||
double | height, | ||
ItemPositionMode | itemPoint = UpperLeft , |
||
bool | posIncludesFrame = false , |
||
int | page = -1 |
||
) |
Sets item position and width / height in one go.
x | item position x |
y | item position y |
width | item width |
height | item height |
itemPoint | item position mode |
posIncludesFrame | set to true if the position and size arguments include the item's frame border |
page | if page > 0, y is interpreted as relative to the origin of the specified page, if page <= 0, y is in absolute canvas coordinates |
Definition at line 622 of file qgscomposeritem.cpp.
|
virtualslot |
Sets the item rotation.
r | item rotation in degrees |
adjustPosition | set to true if item should be shifted so that rotation occurs around item center. If false, rotation occurs around item origin |
Definition at line 1046 of file qgscomposeritem.cpp.
void QgsComposerItem::setPositionLock | ( | const bool | lock | ) |
Locks / unlocks the item position for mouse drags.
lock | set to true to prevent item movement and resizing via the mouse |
Definition at line 552 of file qgscomposeritem.cpp.
|
virtualslot |
Sets the item rotation.
Reimplemented in QgsComposerMap.
Definition at line 1039 of file qgscomposeritem.cpp.
|
virtual |
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit.
Reimplemented in QgsComposerScaleBar, QgsComposerAttributeTable, QgsComposerMap, QgsComposerPicture, QgsComposerShape, QgsPaperItem, QgsComposerArrow, QgsComposerFrame, and QgsComposerItemGroup.
Definition at line 684 of file qgscomposeritem.cpp.
|
virtual |
Set selected, selected item should be highlighted.
Definition at line 160 of file qgscomposeritem.cpp.
void QgsComposerItem::setTransparency | ( | const int | transparency | ) |
Sets the item's transparency.
transparency | integer between 0 (transparent) and 255 (opaque) |
Definition at line 904 of file qgscomposeritem.cpp.
|
virtual |
Sets visibility for item.
visible | set to true to show item, false to hide item |
Reimplemented in QgsComposerItemGroup.
Definition at line 1447 of file qgscomposeritem.cpp.
|
protected |
Returns whether the item should be drawn in the current context.
Definition at line 837 of file qgscomposeritem.cpp.
|
signal |
Emitted if the rectangle changes.
|
protected |
Calculates width / height of the bounding box of a rotated rectangle.
Definition at line 1243 of file qgscomposeritem.cpp.
|
protected |
Calculates width / height of the bounding box of a rotated rectangle.
Reimplemented in QgsComposerMap, and QgsComposerPicture.
Definition at line 1235 of file qgscomposeritem.cpp.
double QgsComposerItem::textWidthMillimeters | ( | const QFont & | font, |
const QString & | text | ||
) | const |
Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE.
Definition at line 952 of file qgscomposeritem.cpp.
|
inline |
Returns the item's transparency.
Definition at line 366 of file qgscomposeritem.h.
|
inlineoverridevirtual |
return correct graphics item type.
Reimplemented in QgsComposerLegend, QgsComposerPicture, QgsComposerMap, QgsComposerAttributeTable, QgsComposerFrame, QgsComposerScaleBar, QgsComposerArrow, QgsComposerTable, QgsPaperItem, QgsComposerShape, QgsComposerLabel, QgsComposerItemGroup, and QgsComposerTextTable.
Definition at line 119 of file qgscomposeritem.h.
|
inlinevirtual |
Updates item, with the possibility to do custom update for subclasses.
Reimplemented in QgsComposerMap.
Definition at line 493 of file qgscomposeritem.h.
void QgsComposerItem::updatePagePos | ( | double | newPageWidth, |
double | newPageHeight | ||
) |
Moves the item so that it retains its relative position on the page when the paper size changes.
newPageWidth | new width of the page in mm |
newPageHeight | new height of the page in mm |
Definition at line 602 of file qgscomposeritem.cpp.
|
inline |
Get item identification name.
Definition at line 513 of file qgscomposeritem.h.
|
protected |
Return vertical align snap item.
Creates a new graphics line if 0
Definition at line 1297 of file qgscomposeritem.cpp.
|
inlinevirtual |
Zoom content of item.
Does nothing per default (but implemented in composer map)
delta | value from wheel event that describes direction (positive /negative number) |
x | x-position of mouse cursor (in item coordinates) |
y | y-position of mouse cursor (in item coordinates) |
Reimplemented in QgsComposerMap.
Definition at line 159 of file qgscomposeritem.h.
|
inlinevirtual |
Zoom content of item.
Does nothing per default (but implemented in composer map)
factor | zoom factor, where > 1 results in a zoom in and < 1 results in a zoom out |
point | item point for zoom center |
mode | zoom mode |
Reimplemented in QgsComposerMap.
Definition at line 167 of file qgscomposeritem.h.
|
friend |
Definition at line 822 of file qgscomposeritem.h.
|
protected |
True if item background needs to be painted.
Definition at line 622 of file qgscomposeritem.h.
|
protected |
Background color.
Definition at line 624 of file qgscomposeritem.h.
|
protected |
Composition blend mode for item.
Definition at line 643 of file qgscomposeritem.h.
|
protected |
Rectangle used during move and resize actions.
Definition at line 615 of file qgscomposeritem.h.
|
protected |
The layer that needs to be exported.
Definition at line 666 of file qgscomposeritem.h.
|
protected |
Definition at line 608 of file qgscomposeritem.h.
|
protected |
Definition at line 645 of file qgscomposeritem.h.
|
protected |
Definition at line 644 of file qgscomposeritem.h.
|
protected |
Temporary evaluated item exclusion.
Data defined properties may mean this value differs from mExcludeFromExports.
Definition at line 655 of file qgscomposeritem.h.
|
protected |
Temporary evaluated item rotation in degrees, clockwise.
Data defined rotation may mean this value differs from mItemRotation.
Definition at line 640 of file qgscomposeritem.h.
|
protected |
Whether item should be excluded in exports.
Definition at line 651 of file qgscomposeritem.h.
|
protected |
True if item fram needs to be painted.
Definition at line 620 of file qgscomposeritem.h.
|
protected |
Frame join style.
Definition at line 626 of file qgscomposeritem.h.
|
protected |
Definition at line 616 of file qgscomposeritem.h.
|
protected |
Whether or not this item is part of a group.
Definition at line 661 of file qgscomposeritem.h.
|
protected |
True if item position and size cannot be changed with mouse move.
Definition at line 630 of file qgscomposeritem.h.
|
protected |
Item rotation in degrees, clockwise.
Definition at line 636 of file qgscomposeritem.h.
|
protected |
Position of the last mouse move event (in scene coordinates)
Definition at line 612 of file qgscomposeritem.h.
|
protected |
The item's position mode.
Definition at line 658 of file qgscomposeritem.h.
|
mutableprotected |
Backup to restore item appearance if no view scale factor is available.
Definition at line 633 of file qgscomposeritem.h.
|
protected |
Start point of the last mouse move action (in scene coordinates)
Definition at line 610 of file qgscomposeritem.h.
|
protected |
True if item has been removed from the composition.
Definition at line 606 of file qgscomposeritem.h.
|
protected |
Item transparency.
Definition at line 648 of file qgscomposeritem.h.
|
protected |
Definition at line 617 of file qgscomposeritem.h.