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

#include <qsvggraphics_p.h>

Inheritance diagram for QSvgRect:
QSvgNode

Public Functions

virtual QRectF bounds (QPainter *p, QSvgExtraStates &states) const
 
virtual void draw (QPainter *p, QSvgExtraStates &states)
 
 QSvgRect (QSvgNode *paren, const QRectF &rect, int rx=0, int ry=0)
 
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

QRectF m_rect
 
int m_rx
 
int m_ry
 

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 167 of file qsvggraphics_p.h.

Constructors and Destructors

◆ QSvgRect()

QSvgRect::QSvgRect ( QSvgNode paren,
const QRectF rect,
int  rx = 0,
int  ry = 0 
)

Definition at line 234 of file qsvggraphics.cpp.

235  : QSvgNode(node),
236  m_rect(rect), m_rx(rx), m_ry(ry)
237 {
238 }
QSvgNode(QSvgNode *parent=0)
Definition: qsvgnode.cpp:52
QRectF m_rect

Functions

◆ bounds()

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

Reimplemented from QSvgNode.

Definition at line 240 of file qsvggraphics.cpp.

241 {
242  qreal sw = strokeWidth(p);
243  if (qFuzzyIsNull(sw)) {
244  return p->transform().mapRect(m_rect);
245  } else {
246  QPainterPath path;
247  path.addRect(m_rect);
248  return boundsOnStroke(p, path, sw);
249  }
250 }
double qreal
Definition: qglobal.h:1193
const QTransform & transform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9558
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
static qreal strokeWidth(QPainter *p)
Definition: qsvgnode.cpp:335
QRectF m_rect
static QRectF boundsOnStroke(QPainter *p, const QPainterPath &path, qreal width)
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
Definition: qglobal.h:2043

◆ draw()

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

Implements QSvgNode.

Definition at line 252 of file qsvggraphics.cpp.

253 {
254  applyStyle(p, states);
255  if (m_rx || m_ry) {
257  } else {
259  }
260  revertStyle(p, states);
261 }
void applyStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:118
#define QT_SVG_DRAW_SHAPE(command)
QRectF m_rect
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
Definition: qpainter.h:650
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
Draws the given rectangle rect with rounded corners.
Definition: qpainter.cpp:4348
void revertStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:123

◆ type()

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

Implements QSvgNode.

Definition at line 539 of file qsvggraphics.cpp.

540 {
541  return RECT;
542 }

Properties

◆ m_rect

QRectF QSvgRect::m_rect
private

Definition at line 175 of file qsvggraphics_p.h.

Referenced by bounds(), and draw().

◆ m_rx

int QSvgRect::m_rx
private

Definition at line 176 of file qsvggraphics_p.h.

Referenced by draw().

◆ m_ry

int QSvgRect::m_ry
private

Definition at line 176 of file qsvggraphics_p.h.

Referenced by draw().


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