QgsComposerPicture Class Reference
[MapComposer]

#include <qgscomposerpicture.h>

Inheritance diagram for QgsComposerPicture:

Inheritance graph
[legend]
Collaboration diagram for QgsComposerPicture:

Collaboration graph
[legend]
List of all members.

Detailed Description

A composer class that displays svg files or raster format (jpg, png, .

..)

Definition at line 28 of file qgscomposerpicture.h.

Signals

void settingsChanged ()
 Tell the configuration widget that the settings need to be updated.

Public Member Functions

 QgsComposerPicture (QgsComposition *composition)
 ~QgsComposerPicture ()
void paint (QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget)
 Reimplementation of QCanvasItem::paint.
void setPictureFile (const QString &path)
 Sets the source file of the image (may be svg or a raster format).
QString pictureFile () const
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 setRotation (double rotation)
double rotation () const
bool writeXML (QDomElement &elem, QDomDocument &doc) const
 stores state in Dom node
bool readXML (const QDomElement &itemElem, const QDomDocument &doc)
 sets state from Dom document

Private Types

enum  Mode { SVG, RASTER, Unknown }

Private Member Functions

 QgsComposerPicture ()
void updateImageFromSvg ()
 Updates content of current image using svg generator.

Private Attributes

QImage mImage
double mRotation
QFile mSourceFile
Mode mMode
bool mSvgCacheUpToDate
 False if image needs to be rendered from svg.
int mCachedDpi
QSize mDefaultSvgSize


Member Enumeration Documentation

enum QgsComposerPicture::Mode [private]

Enumerator:
SVG 
RASTER 
Unknown 

Definition at line 63 of file qgscomposerpicture.h.


Constructor & Destructor Documentation

QgsComposerPicture::QgsComposerPicture ( QgsComposition composition  ) 

Definition at line 27 of file qgscomposerpicture.cpp.

QgsComposerPicture::~QgsComposerPicture (  ) 

Definition at line 36 of file qgscomposerpicture.cpp.

QgsComposerPicture::QgsComposerPicture (  )  [private]

Definition at line 31 of file qgscomposerpicture.cpp.


Member Function Documentation

void QgsComposerPicture::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  itemStyle,
QWidget *  pWidget 
)

Reimplementation of QCanvasItem::paint.

Definition at line 41 of file qgscomposerpicture.cpp.

References QgsComposerItem::drawBackground(), QgsComposerItem::drawFrame(), QgsComposerItem::drawSelectionBoxes(), mCachedDpi, mImage, mMode, mRotation, mSvgCacheUpToDate, SVG, Unknown, and updateImageFromSvg().

void QgsComposerPicture::setPictureFile ( const QString &  path  ) 

Sets the source file of the image (may be svg or a raster format).

Definition at line 96 of file qgscomposerpicture.cpp.

References mDefaultSvgSize, mImage, mMode, mSourceFile, mSvgCacheUpToDate, RASTER, setSceneRect(), settingsChanged(), SVG, and Unknown.

Referenced by readXML().

QString QgsComposerPicture::pictureFile (  )  const

Definition at line 200 of file qgscomposerpicture.cpp.

References mSourceFile.

void QgsComposerPicture::setSceneRect ( const QRectF &  rectangle  )  [virtual]

Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit.

Reimplemented from QgsComposerItem.

Definition at line 160 of file qgscomposerpicture.cpp.

References mCachedDpi, mDefaultSvgSize, mImage, mMode, mSvgCacheUpToDate, QgsComposerItem::setSceneRect(), settingsChanged(), and SVG.

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

void QgsComposerPicture::setRotation ( double  rotation  ) 

Definition at line 188 of file qgscomposerpicture.cpp.

References mRotation.

double QgsComposerPicture::rotation (  )  const [inline]

Definition at line 48 of file qgscomposerpicture.h.

bool QgsComposerPicture::writeXML ( QDomElement &  elem,
QDomDocument &  doc 
) const [virtual]

stores state in Dom node

Parameters:
node is Dom node corresponding to 'Composer' tag
temp write template file

Implements QgsComposerItem.

Definition at line 205 of file qgscomposerpicture.cpp.

References QgsComposerItem::_writeXML(), mRotation, and mSourceFile.

bool QgsComposerPicture::readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc 
) [virtual]

sets state from Dom document

Parameters:
itemElem is Dom node corresponding to item tag

Implements QgsComposerItem.

Definition at line 219 of file qgscomposerpicture.cpp.

References QgsComposerItem::_readXML(), mCachedDpi, mDefaultSvgSize, mRotation, mSvgCacheUpToDate, and setPictureFile().

void QgsComposerPicture::updateImageFromSvg (  )  [private]

Updates content of current image using svg generator.

Definition at line 147 of file qgscomposerpicture.cpp.

References mImage, mSourceFile, and mSvgCacheUpToDate.

Referenced by paint().

void QgsComposerPicture::settingsChanged (  )  [signal]

Tell the configuration widget that the settings need to be updated.

Referenced by setPictureFile(), and setSceneRect().


Member Data Documentation

QImage QgsComposerPicture::mImage [private]

Definition at line 75 of file qgscomposerpicture.h.

Referenced by paint(), setPictureFile(), setSceneRect(), and updateImageFromSvg().

double QgsComposerPicture::mRotation [private]

Definition at line 76 of file qgscomposerpicture.h.

Referenced by paint(), readXML(), setRotation(), and writeXML().

QFile QgsComposerPicture::mSourceFile [private]

Definition at line 77 of file qgscomposerpicture.h.

Referenced by pictureFile(), setPictureFile(), updateImageFromSvg(), and writeXML().

Mode QgsComposerPicture::mMode [private]

Definition at line 78 of file qgscomposerpicture.h.

Referenced by paint(), setPictureFile(), and setSceneRect().

bool QgsComposerPicture::mSvgCacheUpToDate [private]

False if image needs to be rendered from svg.

Definition at line 80 of file qgscomposerpicture.h.

Referenced by paint(), readXML(), setPictureFile(), setSceneRect(), and updateImageFromSvg().

int QgsComposerPicture::mCachedDpi [private]

Definition at line 81 of file qgscomposerpicture.h.

Referenced by paint(), readXML(), and setSceneRect().

QSize QgsComposerPicture::mDefaultSvgSize [private]

Definition at line 82 of file qgscomposerpicture.h.

Referenced by readXML(), setPictureFile(), and setSceneRect().


The documentation for this class was generated from the following files:
Generated on Tue Jan 6 16:51:19 2009 for Quantum GIS API Documentation by  doxygen 1.5.1