Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsvggraphics.cpp File Reference
#include "qsvggraphics_p.h"
#include "qsvgfont_p.h"
#include <qabstracttextdocumentlayout.h>
#include <qdebug.h>
#include <qloggingcategory.h>
#include <qpainter.h>
#include <qscopedvaluerollback.h>
#include <qtextcursor.h>
#include <qtextdocument.h>
#include <private/qfixed_p.h>
#include <QElapsedTimer>
#include <QLoggingCategory>
#include <math.h>
#include <limits.h>
+ Include dependency graph for qsvggraphics.cpp:

Go to the source code of this file.

Macros

#define QT_SVG_TIMING_ENTER    QElapsedTimer qtSvgTimer; qtSvgTimer.start();
 
#define QT_SVG_TIMING_EXIT(TYPE)
 
#define QT_SVG_DRAW_SHAPE(command)
 
#define QT_SVG_MAX_LAYOUT_SIZE   (qint64(QFIXED_MAX / 2))
 

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 != Qt::NoPen && oldPen.brush() != Qt::NoBrush && oldPen.widthF() != 0) { \
p->setOpacity(oldOpacity * states.strokeOpacity); \
command; \
p->setBrush(oldBrush); \
} \
p->setOpacity(oldOpacity); }
\inmodule QtGui
Definition qbrush.h:30
\inmodule QtGui
Definition qpen.h:25
qreal widthF() const
Returns the pen width with floating point precision.
Definition qpen.cpp:598
void setBrush(const QBrush &brush)
Sets the brush used to fill strokes generated with this pen to the given brush.
Definition qpen.cpp:752
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition qpen.cpp:741
@ NoPen
@ NoBrush
GLfloat GLfloat p
[1]
GLuint * states
double qreal
Definition qtypes.h:92

Definition at line 35 of file qsvggraphics.cpp.

◆ QT_SVG_MAX_LAYOUT_SIZE

#define QT_SVG_MAX_LAYOUT_SIZE   (qint64(QFIXED_MAX / 2))

Definition at line 52 of file qsvggraphics.cpp.

◆ QT_SVG_TIMING_ENTER

#define QT_SVG_TIMING_ENTER    QElapsedTimer qtSvgTimer; qtSvgTimer.start();

Definition at line 28 of file qsvggraphics.cpp.

◆ QT_SVG_TIMING_EXIT

#define QT_SVG_TIMING_EXIT (   TYPE)
Value:
if (Q_UNLIKELY(lcSvgTiming().isDebugEnabled())) \
qCDebug(lcSvgTiming) << "Drawing" << TYPE << "took" << (qtSvgTimer.nsecsElapsed() / 1000000.0f) << "ms";
#define Q_UNLIKELY(x)
const char * TYPE

Definition at line 31 of file qsvggraphics.cpp.

Function Documentation

◆ boundsOnStroke()

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

Definition at line 60 of file qsvggraphics.cpp.

References QPainterPath::boundingRect(), QPainterPathStroker::createStroke(), and QPainterPathStroker::setWidth().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function: