Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsComposerItem Class Referenceabstract

A item that forms part of a map composition. More...

#include <qgscomposeritem.h>

Inheritance diagram for QgsComposerItem:
Inheritance graph
[legend]
Collaboration diagram for QgsComposerItem:
Collaboration graph
[legend]

Public Types

enum  ItemType {
  ComposerItem = UserType + 100, ComposerArrow, ComposerItemGroup, ComposerLabel,
  ComposerLegend, ComposerMap, ComposerPaper, ComposerPicture,
  ComposerScaleBar, ComposerShape, ComposerTable, ComposerAttributeTable,
  ComposerTextTable
}
 
enum  MouseMoveAction {
  MoveItem, ResizeUp, ResizeDown, ResizeLeft,
  ResizeRight, ResizeLeftUp, ResizeRightUp, ResizeLeftDown,
  ResizeRightDown, NoAction
}
 Describes the action (move or resize in different directon) to be done during mouse move. More...
 
enum  ItemPositionMode {
  UpperLeft, UpperMiddle, UpperRight, MiddleLeft,
  Middle, MiddleRight, LowerLeft, LowerMiddle,
  LowerRight
}
 

Public Slots

virtual void setRotation (double r)
 
void repaint ()
 

Signals

void rotationChanged (double newRotation)
 Is emitted on rotation change to notify north arrow pictures. More...
 
void itemChanged ()
 Used e.g. More...
 

Public Member Functions

 QgsComposerItem (QgsComposition *composition, bool manageZValue=true)
 Constructor. More...
 
 QgsComposerItem (qreal x, qreal y, qreal width, qreal height, QgsComposition *composition, bool manageZValue=true)
 Constructor with box position and composer object. More...
 
virtual ~QgsComposerItem ()
 
virtual int type () const
 return correct graphics item type. More...
 
virtual void setSelected (bool s)
 Set selected, selected item should be highlighted. More...
 
virtual bool selected (void)
 Is selected. More...
 
virtual bool writeSettings (void)
 stores state in project More...
 
virtual bool readSettings (void)
 read state from project More...
 
virtual bool removeSettings (void)
 delete settings from project file More...
 
void move (double dx, double dy)
 Moves item in canvas coordinates. More...
 
virtual void moveContent (double dx, double dy)
 Move Content of item. More...
 
virtual void zoomContent (int delta, double x, double y)
 Zoom content of item. More...
 
void setItemPosition (double x, double y, ItemPositionMode itemPoint=UpperLeft)
 Moves the item to a new position (in canvas coordinates) More...
 
void setItemPosition (double x, double y, double width, double height, ItemPositionMode itemPoint=UpperLeft)
 Sets item position and width / height in one go. More...
 
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. More...
 
virtual bool writeXML (QDomElement &elem, QDomDocument &doc) const =0
 stores state in Dom element More...
 
bool _writeXML (QDomElement &itemElem, QDomDocument &doc) const
 Writes parameter that are not subclass specific in document. More...
 
virtual bool readXML (const QDomElement &itemElem, const QDomDocument &doc)=0
 sets state from Dom document More...
 
bool _readXML (const QDomElement &itemElem, const QDomDocument &doc)
 Reads parameter that are not subclass specific in document. More...
 
bool frame () const
 
void setFrame (bool drawFrame)
 
virtual void addItem (QgsComposerItem *item)
 Composite operations for item groups do nothing per default. More...
 
virtual void removeItems ()
 
const QgsCompositioncomposition () const
 
void beginCommand (const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
 Starts new composer undo command. More...
 
void endCommand ()
 Finish current command and push it onto the undo stack. More...
 
void cancelCommand ()
 
void drawText (QPainter *p, double x, double y, const QString &text, const QFont &font) const
 Draws Text. More...
 
void drawText (QPainter *p, const QRectF &rect, const QString &text, const QFont &font, Qt::AlignmentFlag halignement=Qt::AlignLeft, Qt::AlignmentFlag valignement=Qt::AlignTop) const
 Like the above, but with a rectangle for multiline text. More...
 
double textWidthMillimeters (const QFont &font, const QString &text) const
 Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More...
 
double fontHeightCharacterMM (const QFont &font, const QChar &c) const
 Returns the font height of a character in millimeters. More...
 
double fontAscentMillimeters (const QFont &font) const
 Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More...
 
double pixelFontSize (double pointSize) const
 Calculates font to from point size to pixel size. More...
 
QFont scaledFontPixelSize (const QFont &font) const
 Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE. More...
 
void setPositionLock (bool lock)
 Locks / unlocks the item position for mouse drags. More...
 
bool positionLock () const
 Returns position lock for mouse drags (true means locked) More...
 
void updateCursor (const QPointF &itemPos)
 Update mouse cursor at (item) position. More...
 
double rotation () const
 

Protected Member Functions

virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
 
Qt::CursorShape cursorForPosition (const QPointF &itemCoordPos)
 Finds out the appropriate cursor for the current mouse position in the widget (e.g. More...
 
QgsComposerItem::MouseMoveAction mouseMoveActionForPosition (const QPointF &itemCoordPos)
 Finds out which mouse move action to choose depending on the cursor position inside the widget. More...
 
void changeItemRectangle (const QPointF &currentPosition, const QPointF &mouseMoveStartPos, const QGraphicsRectItem *originalItem, double dx, double dy, QGraphicsRectItem *changeItem)
 Changes the rectangle of an item depending on current mouse action (resize or move) More...
 
virtual void drawSelectionBoxes (QPainter *p)
 Draw selection boxes around item. More...
 
virtual void drawFrame (QPainter *p)
 Draw black frame around item. More...
 
virtual void drawBackground (QPainter *p)
 Draw background. More...
 
void drawArrowHead (QPainter *p, double x, double y, double angle, double arrowHeadWidth) const
 Draws arrowhead. More...
 
double angle (const QPointF &p1, const QPointF &p2) const
 Returns angle of the line from p1 to p2 (clockwise, starting at N) More...
 
double rectHandlerBorderTolerance () const
 Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to the \ item border for resizing. More...
 
double lockSymbolSize () const
 Returns the size of the lock symbol depending on the composer zoom level and the item size. More...
 
double horizontalViewScaleFactor () const
 Returns the zoom factor of the graphics view. More...
 
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. More...
 
bool cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height) const
 Calculates corner point after rotation and scaling. More...
 
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. More...
 
void sizeChangedByRotation (double &width, double &height)
 Calculates width / height of the bounding box of a rotated rectangle (mRotation) More...
 
void rotate (double angle, double &x, double &y) const
 Rotates a point / vector. More...
 

Protected Attributes

QgsCompositionmComposition
 
QgsComposerItem::MouseMoveAction mCurrentMouseMoveAction
 
QPointF mMouseMoveStartPos
 Start point of the last mouse move action (in scene coordinates) More...
 
QPointF mLastMouseEventPos
 Position of the last mouse move event (in scene coordinates) More...
 
QGraphicsRectItem * mBoundingResizeRectangle
 Rectangle used during move and resize actions. More...
 
bool mFrame
 True if item fram needs to be painted. More...
 
bool mItemPositionLocked
 True if item position and size cannot be changed with mouse move. More...
 
double mLastValidViewScaleFactor
 Backup to restore item appearance if no view scale factor is available. More...
 
double mRotation
 Item rotation in degrees, clockwise. More...
 

Detailed Description

A item that forms part of a map composition.

Definition at line 33 of file qgscomposeritem.h.

Member Enumeration Documentation

Enumerator
UpperLeft 
UpperMiddle 
UpperRight 
MiddleLeft 
Middle 
MiddleRight 
LowerLeft 
LowerMiddle 
LowerRight 

Definition at line 73 of file qgscomposeritem.h.

Enumerator
ComposerItem 
ComposerArrow 
ComposerItemGroup 
ComposerLabel 
ComposerLegend 
ComposerMap 
ComposerPaper 
ComposerPicture 
ComposerScaleBar 
ComposerShape 
ComposerTable 
ComposerAttributeTable 
ComposerTextTable 

Definition at line 38 of file qgscomposeritem.h.

Describes the action (move or resize in different directon) to be done during mouse move.

Enumerator
MoveItem 
ResizeUp 
ResizeDown 
ResizeLeft 
ResizeRight 
ResizeLeftUp 
ResizeRightUp 
ResizeLeftDown 
ResizeRightDown 
NoAction 

Definition at line 59 of file qgscomposeritem.h.

Constructor & Destructor Documentation

QgsComposerItem::QgsComposerItem ( QgsComposition composition,
bool  manageZValue = true 
)

Constructor.

Parameters
compositionparent composition
manageZValuetrue if the z-Value of this object should be managed by mComposition

Definition at line 38 of file qgscomposeritem.cpp.

References QgsComposition::addItemToZList(), and mComposition.

QgsComposerItem::QgsComposerItem ( qreal  x,
qreal  y,
qreal  width,
qreal  height,
QgsComposition composition,
bool  manageZValue = true 
)

Constructor with box position and composer object.

Parameters
xx coordinate of item
yy coordinate of item
widthwidth of item
heightheight of item
compositionparent composition
manageZValuetrue if the z-Value of this object should be managed by mComposition

Definition at line 64 of file qgscomposeritem.cpp.

References QgsComposition::addItemToZList(), and mComposition.

QgsComposerItem::~QgsComposerItem ( )
virtual

Member Function Documentation

bool QgsComposerItem::_readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc 
)
bool QgsComposerItem::_writeXML ( QDomElement &  itemElem,
QDomDocument &  doc 
) const
virtual void QgsComposerItem::addItem ( QgsComposerItem item)
inlinevirtual

Composite operations for item groups do nothing per default.

Reimplemented in QgsComposerItemGroup.

Definition at line 167 of file qgscomposeritem.h.

double QgsComposerItem::angle ( const QPointF &  p1,
const QPointF &  p2 
) const
protected

Returns angle of the line from p1 to p2 (clockwise, starting at N)

Definition at line 833 of file qgscomposeritem.cpp.

References M_PI.

Referenced by QgsComposerArrow::drawHardcodedMarker(), and QgsComposerArrow::drawSVGMarker().

void QgsComposerItem::beginCommand ( const QString &  commandText,
QgsComposerMergeCommand::Context  c = QgsComposerMergeCommand::Unknown 
)

Starts new composer undo command.

Parameters
commandTextcommand title
ccontext for mergeable commands (unknown for non-mergeable commands

Definition at line 274 of file qgscomposeritem.cpp.

References QgsComposition::beginCommand(), and mComposition.

Referenced by mouseReleaseEvent(), and QgsComposerView::wheelEvent().

void QgsComposerItem::cancelCommand ( )

Definition at line 290 of file qgscomposeritem.cpp.

References QgsComposition::cancelCommand(), and mComposition.

void QgsComposerItem::changeItemRectangle ( const QPointF &  currentPosition,
const QPointF &  mouseMoveStartPos,
const QGraphicsRectItem *  originalItem,
double  dx,
double  dy,
QGraphicsRectItem *  changeItem 
)
protected

Changes the rectangle of an item depending on current mouse action (resize or move)

Parameters
currentPositioncurrent position of mouse cursor
mouseMoveStartPoscursor position at the start of the current mouse action
originalItemItem position at the start of the mouse action
dxx-Change of mouse cursor
dyy-Change of mouse cursor
changeItemItem to change size (can be the same as originalItem or a differen one)

Definition at line 482 of file qgscomposeritem.cpp.

References mComposition, mCurrentMouseMoveAction, MoveItem, NoAction, ResizeDown, ResizeLeft, ResizeLeftDown, ResizeLeftUp, ResizeRight, ResizeRightDown, ResizeRightUp, ResizeUp, setSceneRect(), and QgsComposition::snapPointToGrid().

Referenced by mouseMoveEvent(), and mouseReleaseEvent().

const QgsComposition* QgsComposerItem::composition ( ) const
inline
bool QgsComposerItem::cornerPointOnRotatedAndScaledRect ( double &  x,
double &  y,
double  width,
double  height 
) const
protected

Calculates corner point after rotation and scaling.

Definition at line 1005 of file qgscomposeritem.cpp.

References M_PI, and mRotation.

Referenced by imageSizeConsideringRotation().

Qt::CursorShape QgsComposerItem::cursorForPosition ( const QPointF &  itemCoordPos)
protected

Finds out the appropriate cursor for the current mouse position in the widget (e.g.

move in the middle, resize at border)

Definition at line 383 of file qgscomposeritem.cpp.

References mouseMoveActionForPosition(), MoveItem, NoAction, ResizeDown, ResizeLeftDown, ResizeLeftUp, ResizeRightDown, ResizeRightUp, and ResizeUp.

Referenced by hoverMoveEvent(), and updateCursor().

void QgsComposerItem::drawArrowHead ( QPainter *  p,
double  x,
double  y,
double  angle,
double  arrowHeadWidth 
) const
protected

Draws arrowhead.

Definition at line 762 of file qgscomposeritem.cpp.

References M_PI.

Referenced by QgsComposerArrow::drawHardcodedMarker().

void QgsComposerItem::drawBackground ( QPainter *  p)
protectedvirtual
void QgsComposerItem::drawFrame ( QPainter *  p)
protectedvirtual
void QgsComposerItem::drawSelectionBoxes ( QPainter *  p)
protectedvirtual
void QgsComposerItem::drawText ( QPainter *  p,
double  x,
double  y,
const QString &  text,
const QFont &  font 
) const
void QgsComposerItem::drawText ( QPainter *  p,
const QRectF &  rect,
const QString &  text,
const QFont &  font,
Qt::AlignmentFlag  halignement = Qt::AlignLeft,
Qt::AlignmentFlag  valignement = Qt::AlignTop 
) const

Like the above, but with a rectangle for multiline text.

Definition at line 748 of file qgscomposeritem.cpp.

References FONT_WORKAROUND_SCALE, and scaledFontPixelSize().

void QgsComposerItem::endCommand ( )

Finish current command and push it onto the undo stack.

Definition at line 282 of file qgscomposeritem.cpp.

References QgsComposition::endCommand(), and mComposition.

Referenced by mouseReleaseEvent().

double QgsComposerItem::fontAscentMillimeters ( const QFont &  font) const
double QgsComposerItem::fontHeightCharacterMM ( const QFont &  font,
const QChar &  c 
) const

Returns the font height of a character in millimeters.

Note
this method was added in version 1.7

Definition at line 806 of file qgscomposeritem.cpp.

References FONT_WORKAROUND_SCALE, and scaledFontPixelSize().

Referenced by QgsComposerMap::drawCoordinateAnnotation(), and QgsComposerLegend::drawLayerChildItems().

bool QgsComposerItem::frame ( ) const
inline

Definition at line 163 of file qgscomposeritem.h.

Referenced by _readXML().

double QgsComposerItem::horizontalViewScaleFactor ( ) const
protected

Returns the zoom factor of the graphics view.

Returns
the factor or -1 in case of error (e.g. graphic view does not exist)
Note
: this function was introduced in version 1.2

Definition at line 851 of file qgscomposeritem.cpp.

References mLastValidViewScaleFactor.

Referenced by QgsComposerMap::cache(), QgsComposerArrow::drawSVGMarker(), lockSymbolSize(), QgsComposerMap::paint(), and rectHandlerBorderTolerance().

void QgsComposerItem::hoverMoveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 727 of file qgscomposeritem.cpp.

References cursorForPosition().

bool QgsComposerItem::imageSizeConsideringRotation ( double &  width,
double &  height 
) const
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 922 of file qgscomposeritem.cpp.

References cornerPointOnRotatedAndScaledRect(), mRotation, and pointOnLineWithDistance().

Referenced by QgsComposerPicture::setSceneRect(), and QgsComposerShape::setSceneRect().

void QgsComposerItem::itemChanged ( )
signal
double QgsComposerItem::lockSymbolSize ( ) const
protected

Returns the size of the lock symbol depending on the composer zoom level and the item size.

Note
: this function was introduced in version 1.2

Definition at line 888 of file qgscomposeritem.cpp.

References horizontalViewScaleFactor().

Referenced by drawSelectionBoxes().

QgsComposerItem::MouseMoveAction QgsComposerItem::mouseMoveActionForPosition ( const QPointF &  itemCoordPos)
protected

Finds out which mouse move action to choose depending on the cursor position inside the widget.

Definition at line 413 of file qgscomposeritem.cpp.

References mItemPositionLocked, MoveItem, NoAction, rectHandlerBorderTolerance(), ResizeDown, ResizeLeft, ResizeLeftDown, ResizeLeftUp, ResizeRight, ResizeRightDown, ResizeRightUp, and ResizeUp.

Referenced by cursorForPosition(), and mousePressEvent().

void QgsComposerItem::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual
void QgsComposerItem::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual
void QgsComposerItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual
void QgsComposerItem::move ( double  dx,
double  dy 
)

Moves item in canvas coordinates.

Definition at line 644 of file qgscomposeritem.cpp.

References setSceneRect().

virtual void QgsComposerItem::moveContent ( double  dx,
double  dy 
)
inlinevirtual

Move Content of item.

Does nothing per default (but implemented in composer map)

Parameters
dxmove in x-direction (canvas coordinates)
dymove in y-direction(canvas coordinates)

Reimplemented in QgsComposerMap.

Definition at line 124 of file qgscomposeritem.h.

Referenced by QgsComposerView::mouseReleaseEvent().

double QgsComposerItem::pixelFontSize ( double  pointSize) const

Calculates font to from point size to pixel size.

Definition at line 820 of file qgscomposeritem.cpp.

Referenced by scaledFontPixelSize().

QPointF QgsComposerItem::pointOnLineWithDistance ( const QPointF &  startPoint,
const QPointF &  directionPoint,
double  distance 
) const
protected

Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point.

Definition at line 1042 of file qgscomposeritem.cpp.

Referenced by QgsComposerMap::drawGrid(), and imageSizeConsideringRotation().

bool QgsComposerItem::positionLock ( ) const
inline

Returns position lock for mouse drags (true means locked)

Note
this method was added in version 1.2

Definition at line 212 of file qgscomposeritem.h.

Referenced by _readXML(), and QgsComposerView::mousePressEvent().

bool QgsComposerItem::readSettings ( void  )
virtual

read state from project

Definition at line 113 of file qgscomposeritem.cpp.

virtual bool QgsComposerItem::readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc 
)
pure virtual

sets state from Dom document

Parameters
itemElemis Dom node corresponding to item tag
docis Dom document

Implemented in QgsComposerMap, QgsComposerScaleBar, QgsComposerLegend, QgsComposerArrow, QgsComposerLabel, QgsComposerPicture, QgsComposerItemGroup, QgsComposerShape, QgsComposerAttributeTable, QgsPaperItem, QgsComposerTable, and QgsComposerTextTable.

Referenced by QgsComposerItemCommand::restoreState().

double QgsComposerItem::rectHandlerBorderTolerance ( ) const
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 870 of file qgscomposeritem.cpp.

References horizontalViewScaleFactor().

Referenced by drawSelectionBoxes(), and mouseMoveActionForPosition().

virtual void QgsComposerItem::removeItems ( )
inlinevirtual

Reimplemented in QgsComposerItemGroup.

Definition at line 168 of file qgscomposeritem.h.

bool QgsComposerItem::removeSettings ( void  )
virtual

delete settings from project file

Definition at line 115 of file qgscomposeritem.cpp.

void QgsComposerItem::repaint ( )
slot
void QgsComposerItem::rotate ( double  angle,
double &  x,
double &  y 
) const
protected

Rotates a point / vector.

Parameters
anglerotation angle in degrees, counterclockwise
xin/out: x coordinate before / after the rotation
yin/out: y cooreinate before / after the rotation

Definition at line 1088 of file qgscomposeritem.cpp.

References M_PI.

Referenced by QgsComposerMap::mapPolygon(), QgsComposerMap::mapToItemCoords(), sizeChangedByRotation(), and QgsComposerMap::transformShift().

double QgsComposerItem::rotation ( ) const
inline
void QgsComposerItem::rotationChanged ( double  newRotation)
signal

Is emitted on rotation change to notify north arrow pictures.

Referenced by QgsComposerPicture::readXML(), QgsComposerMap::setMapRotation(), setRotation(), and QgsComposerPicture::setRotationMap().

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 825 of file qgscomposeritem.cpp.

References FONT_WORKAROUND_SCALE, and pixelFontSize().

Referenced by drawText(), fontAscentMillimeters(), fontHeightCharacterMM(), and textWidthMillimeters().

virtual bool QgsComposerItem::selected ( void  )
inlinevirtual

Is selected.

Definition at line 107 of file qgscomposeritem.h.

void QgsComposerItem::setFrame ( bool  drawFrame)
inline

Definition at line 164 of file qgscomposeritem.h.

void QgsComposerItem::setItemPosition ( double  x,
double  y,
ItemPositionMode  itemPoint = UpperLeft 
)

Moves the item to a new position (in canvas coordinates)

Definition at line 651 of file qgscomposeritem.cpp.

void QgsComposerItem::setItemPosition ( double  x,
double  y,
double  width,
double  height,
ItemPositionMode  itemPoint = UpperLeft 
)

Sets item position and width / height in one go.

Note
: this method was added in version 1.6

Definition at line 658 of file qgscomposeritem.cpp.

References LowerLeft, LowerMiddle, LowerRight, Middle, MiddleLeft, MiddleRight, setSceneRect(), UpperMiddle, and UpperRight.

void QgsComposerItem::setPositionLock ( bool  lock)
inline

Locks / unlocks the item position for mouse drags.

Note
this method was added in version 1.2

Definition at line 208 of file qgscomposeritem.h.

Referenced by QgsComposerView::mousePressEvent().

void QgsComposerItem::setRotation ( double  r)
virtualslot
void QgsComposerItem::setSceneRect ( const QRectF &  rectangle)
virtual
void QgsComposerItem::setSelected ( bool  s)
virtual
void QgsComposerItem::sizeChangedByRotation ( double &  width,
double &  height 
)
protected

Calculates width / height of the bounding box of a rotated rectangle (mRotation)

Definition at line 1051 of file qgscomposeritem.cpp.

References mRotation, and rotate().

Referenced by QgsComposerPicture::setRotation(), and QgsComposerShape::setRotation().

double QgsComposerItem::textWidthMillimeters ( const QFont &  font,
const QString &  text 
) const
virtual int QgsComposerItem::type ( ) const
inlinevirtual
void QgsComposerItem::updateCursor ( const QPointF &  itemPos)

Update mouse cursor at (item) position.

Note
this method was added in version 1.2

Definition at line 903 of file qgscomposeritem.cpp.

References cursorForPosition().

Referenced by QgsComposerView::mousePressEvent().

bool QgsComposerItem::writeSettings ( void  )
virtual

stores state in project

Definition at line 111 of file qgscomposeritem.cpp.

virtual bool QgsComposerItem::writeXML ( QDomElement &  elem,
QDomDocument &  doc 
) const
pure virtual

stores state in Dom element

Parameters
elemis Dom element corresponding to 'Composer' tag
docis the Dom document

Implemented in QgsComposerMap, QgsComposerScaleBar, QgsComposerLegend, QgsComposerArrow, QgsComposerLabel, QgsComposerAttributeTable, QgsComposerPicture, QgsComposerItemGroup, QgsComposerShape, QgsPaperItem, QgsComposerTable, and QgsComposerTextTable.

Referenced by QgsComposerItemCommand::saveState().

virtual void QgsComposerItem::zoomContent ( int  delta,
double  x,
double  y 
)
inlinevirtual

Zoom content of item.

Does nothing per default (but implemented in composer map)

Parameters
deltavalue from wheel event that describes magnitude and direction (positive /negative number)
xx-position of mouse cursor (in item coordinates)
yy-position of mouse cursor (in item coordinates)

Reimplemented in QgsComposerMap.

Definition at line 130 of file qgscomposeritem.h.

Member Data Documentation

QGraphicsRectItem* QgsComposerItem::mBoundingResizeRectangle
protected

Rectangle used during move and resize actions.

Definition at line 235 of file qgscomposeritem.h.

Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and ~QgsComposerItem().

QgsComposition* QgsComposerItem::mComposition
protected
QgsComposerItem::MouseMoveAction QgsComposerItem::mCurrentMouseMoveAction
protected

Definition at line 228 of file qgscomposeritem.h.

Referenced by changeItemRectangle(), mousePressEvent(), and mouseReleaseEvent().

bool QgsComposerItem::mFrame
protected

True if item fram needs to be painted.

Definition at line 238 of file qgscomposeritem.h.

Referenced by _readXML(), _writeXML(), QgsComposerItemGroup::drawFrame(), and drawFrame().

bool QgsComposerItem::mItemPositionLocked
protected

True if item position and size cannot be changed with mouse move.

Note
: this member was added in version 1.2

Definition at line 242 of file qgscomposeritem.h.

Referenced by _readXML(), _writeXML(), drawSelectionBoxes(), mouseMoveActionForPosition(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

QPointF QgsComposerItem::mLastMouseEventPos
protected

Position of the last mouse move event (in scene coordinates)

Definition at line 232 of file qgscomposeritem.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

double QgsComposerItem::mLastValidViewScaleFactor
mutableprotected

Backup to restore item appearance if no view scale factor is available.

Definition at line 245 of file qgscomposeritem.h.

Referenced by _readXML(), _writeXML(), QgsComposerMap::cache(), horizontalViewScaleFactor(), and QgsComposerMap::paint().

QPointF QgsComposerItem::mMouseMoveStartPos
protected

Start point of the last mouse move action (in scene coordinates)

Definition at line 230 of file qgscomposeritem.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

double QgsComposerItem::mRotation
protected

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