Qt 4.8
Macros | Functions
qsvggraphics.cpp File Reference
#include "qsvggraphics_p.h"
#include "qsvgfont_p.h"
#include "qpainter.h"
#include "qtextdocument.h"
#include "qabstracttextdocumentlayout.h"
#include "qtextcursor.h"
#include "qdebug.h"
#include <math.h>
#include <limits.h>

Go to the source code of this file.

Macros

#define QT_SVG_DRAW_SHAPE(command)
 

Functions

static QRectF boundsOnStroke (QPainter *p, const QPainterPath &path, qreal width)
 

Macro Definition Documentation

◆ QT_SVG_DRAW_SHAPE

#define QT_SVG_DRAW_SHAPE (   command)
Value:
qreal oldOpacity = p->opacity(); \
QBrush oldBrush = p->brush(); \
QPen oldPen = p->pen(); \
p->setPen(Qt::NoPen); \
p->setOpacity(oldOpacity * states.fillOpacity); \
command; \
p->setPen(oldPen); \
if (oldPen.widthF() != 0) { \
p->setOpacity(oldOpacity * states.strokeOpacity); \
p->setBrush(Qt::NoBrush); \
command; \
p->setBrush(oldBrush); \
} \
p->setOpacity(oldOpacity);
double qreal
Definition: qglobal.h:1193

Definition at line 59 of file qsvggraphics.cpp.

Referenced by QSvgEllipse::draw(), QSvgPath::draw(), QSvgPolygon::draw(), and QSvgRect::draw().

Function Documentation

◆ boundsOnStroke()

static QRectF boundsOnStroke ( QPainter p,
const QPainterPath path,
qreal  width 
)
inlinestatic

Definition at line 81 of file qsvggraphics.cpp.

Referenced by QSvgArc::bounds(), QSvgEllipse::bounds(), QSvgLine::bounds(), QSvgPath::bounds(), QSvgPolygon::bounds(), QSvgPolyline::bounds(), and QSvgRect::bounds().

82 {
83  QPainterPathStroker stroker;
84  stroker.setWidth(width);
85  QPainterPath stroke = stroker.createStroke(path);
86  return p->transform().map(stroke).boundingRect();
87 }
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
QPainterPath createStroke(const QPainterPath &path) const
Generates a new path that is a fillable area representing the outline of the given path...
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
The QPainterPathStroker class is used to generate fillable outlines for a given painter path...
Definition: qpainterpath.h:264
void setWidth(qreal width)
Sets the width of the generated outline painter path to width.