Qt 4.8
Public Functions | Properties | List of all members
QSvgImage Class Reference

#include <qsvggraphics_p.h>

Inheritance diagram for QSvgImage:
QSvgNode

Public Functions

virtual QRectF bounds (QPainter *p, QSvgExtraStates &states) const
 
virtual void draw (QPainter *p, QSvgExtraStates &states)
 
 QSvgImage (QSvgNode *parent, const QImage &image, const QRect &bounds)
 
virtual Type type () const
 
- Public Functions inherited from QSvgNode
void appendStyleProperty (QSvgStyleProperty *prop, const QString &id)
 
void applyStyle (QPainter *p, QSvgExtraStates &states) const
 
DisplayMode displayMode () const
 
QSvgTinyDocumentdocument () const
 
bool isVisible () const
 
QString nodeId () const
 
QSvgNodeparent () const
 
 QSvgNode (QSvgNode *parent=0)
 
const QStringListrequiredExtensions () const
 
const QStringListrequiredFeatures () const
 
const QStringListrequiredFonts () const
 
const QStringListrequiredFormats () const
 
const QStringListrequiredLanguages () const
 
void revertStyle (QPainter *p, QSvgExtraStates &states) const
 
void setDisplayMode (DisplayMode display)
 
void setNodeId (const QString &i)
 
void setRequiredExtensions (const QStringList &lst)
 
void setRequiredFeatures (const QStringList &lst)
 
void setRequiredFonts (const QStringList &lst)
 
void setRequiredFormats (const QStringList &lst)
 
void setRequiredLanguages (const QStringList &lst)
 
void setVisible (bool visible)
 
void setXmlClass (const QString &str)
 
QSvgStylePropertystyleProperty (QSvgStyleProperty::Type type) const
 
QSvgFillStylePropertystyleProperty (const QString &id) const
 
virtual QRectF transformedBounds (QPainter *p, QSvgExtraStates &states) const
 
QRectF transformedBounds () const
 
QString xmlClass () const
 
virtual ~QSvgNode ()
 

Properties

QRect m_bounds
 
QImage m_image
 

Additional Inherited Members

- Public Types inherited from QSvgNode
enum  DisplayMode {
  InlineMode, BlockMode, ListItemMode, RunInMode,
  CompactMode, MarkerMode, TableMode, InlineTableMode,
  TableRowGroupMode, TableHeaderGroupMode, TableFooterGroupMode, TableRowMode,
  TableColumnGroupMode, TableColumnMode, TableCellMode, TableCaptionMode,
  NoneMode, InheritMode
}
 
enum  Type {
  DOC, G, DEFS, SWITCH,
  ANIMATION, ARC, CIRCLE, ELLIPSE,
  IMAGE, LINE, PATH, POLYGON,
  POLYLINE, RECT, TEXT, TEXTAREA,
  TSPAN, USE, VIDEO
}
 
- Static Protected Functions inherited from QSvgNode
static qreal strokeWidth (QPainter *p)
 
- Protected Variables inherited from QSvgNode
QSvgStyle m_style
 

Detailed Description

Definition at line 106 of file qsvggraphics_p.h.

Constructors and Destructors

◆ QSvgImage()

QSvgImage::QSvgImage ( QSvgNode parent,
const QImage image,
const QRect bounds 
)

Definition at line 127 of file qsvggraphics.cpp.

129  : QSvgNode(parent), m_image(image),
130  m_bounds(bounds)
131 {
132  if (m_bounds.width() == 0)
134  if (m_bounds.height() == 0)
136 }
void setHeight(int h)
Sets the height of the rectangle to the given height.
Definition: qrect.h:445
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
QSvgNode(QSvgNode *parent=0)
Definition: qsvgnode.cpp:52
QImage m_image
QRect m_bounds
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
void setWidth(int w)
Sets the width of the rectangle to the given width.
Definition: qrect.h:442
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572

Functions

◆ bounds()

QRectF QSvgImage::bounds ( QPainter p,
QSvgExtraStates states 
) const
virtual

Reimplemented from QSvgNode.

Definition at line 589 of file qsvggraphics.cpp.

590 {
591  return p->transform().mapRect(m_bounds);
592 }
const QTransform & transform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9558
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
QRect m_bounds

◆ draw()

void QSvgImage::draw ( QPainter p,
QSvgExtraStates states 
)
virtual

Implements QSvgNode.

Definition at line 138 of file qsvggraphics.cpp.

139 {
140  applyStyle(p, states);
142  revertStyle(p, states);
143 }
void applyStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:118
QImage m_image
QRect m_bounds
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Definition: qpainter.cpp:5936
void revertStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:123

◆ type()

QSvgNode::Type QSvgImage::type ( ) const
virtual

Implements QSvgNode.

Definition at line 514 of file qsvggraphics.cpp.

515 {
516  return IMAGE;
517 }

Properties

◆ m_bounds

QRect QSvgImage::m_bounds
private

Definition at line 116 of file qsvggraphics_p.h.

Referenced by draw(), and QSvgImage().

◆ m_image

QImage QSvgImage::m_image
private

Definition at line 115 of file qsvggraphics_p.h.

Referenced by draw(), and QSvgImage().


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