![]() |
Qt 6.x
The Qt SDK
|
Public Member Functions | |
QSvgPaintEngine (QSvgGenerator::SvgVersion version) | |
bool | begin (QPaintDevice *device) override |
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. | |
bool | end () override |
Reimplement this function to finish painting on the current paint device. | |
void | updateState (const QPaintEngineState &state) override |
Reimplement this function to update the state of a paint engine. | |
void | updateClipState (const QPaintEngineState &state) |
void | popGroup () |
void | drawEllipse (const QRectF &r) override |
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. | |
void | drawPath (const QPainterPath &path) override |
The default implementation ignores the path and does nothing. | |
void | drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr) override |
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r. | |
void | drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode) override |
Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. | |
void | drawRects (const QRectF *rects, int rectCount) override |
Draws the first rectCount rectangles in the buffer rects. | |
void | drawTextItem (const QPointF &pt, const QTextItem &item) override |
This function draws the text item textItem at position p. | |
void | drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override |
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap. | |
QPaintEngine::Type | type () const override |
Reimplement this function to return the paint engine \l{Type}. | |
QSize | size () const |
void | setSize (const QSize &size) |
QRectF | viewBox () const |
void | setViewBox (const QRectF &viewBox) |
QString | documentTitle () const |
void | setDocumentTitle (const QString &title) |
QString | documentDescription () const |
void | setDocumentDescription (const QString &description) |
QIODevice * | outputDevice () const |
void | setOutputDevice (QIODevice *device) |
int | resolution () const |
void | setResolution (int resolution) |
QSvgGenerator::SvgVersion | svgVersion () const |
QString | savePatternMask (Qt::BrushStyle style) |
QString | savePatternBrush (const QString &color, const QBrush &brush) |
void | saveLinearGradientBrush (const QGradient *g) |
void | saveRadialGradientBrush (const QGradient *g) |
void | saveConicalGradientBrush (const QGradient *) |
void | saveGradientStops (QTextStream &str, const QGradient *g) |
void | saveGradientUnits (QTextStream &str, const QGradient *gradient) |
void | generateQtDefaults () |
QTextStream & | stream () |
void | qpenToSvg (const QPen &spen) |
void | qbrushToSvg (const QBrush &sbrush) |
void | qfontToSvg (const QFont &sfont) |
![]() | |
QPaintEngine (PaintEngineFeatures features=PaintEngineFeatures()) | |
Creates a paint engine with the featureset specified by caps. | |
virtual | ~QPaintEngine () |
Destroys the paint engine. | |
bool | isActive () const |
Returns true if the paint engine is actively drawing; otherwise returns false . | |
void | setActive (bool newState) |
Sets the active state of the paint engine to state. | |
virtual bool | begin (QPaintDevice *pdev)=0 |
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. | |
virtual bool | end ()=0 |
Reimplement this function to finish painting on the current paint device. | |
virtual void | updateState (const QPaintEngineState &state)=0 |
Reimplement this function to update the state of a paint engine. | |
virtual void | drawRects (const QRect *rects, int rectCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function. | |
virtual void | drawRects (const QRectF *rects, int rectCount) |
Draws the first rectCount rectangles in the buffer rects. | |
virtual void | drawLines (const QLine *lines, int lineCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function. | |
virtual void | drawLines (const QLineF *lines, int lineCount) |
The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine. | |
virtual void | drawEllipse (const QRectF &r) |
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. | |
virtual void | drawEllipse (const QRect &r) |
The default implementation of this function calls the floating point version of this function. | |
virtual void | drawPath (const QPainterPath &path) |
The default implementation ignores the path and does nothing. | |
virtual void | drawPoints (const QPointF *points, int pointCount) |
Draws the first pointCount points in the buffer points. | |
virtual void | drawPoints (const QPoint *points, int pointCount) |
Draws the first pointCount points in the buffer points. | |
virtual void | drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode) |
Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. | |
virtual void | drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. | |
virtual void | drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr)=0 |
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r. | |
virtual void | drawTextItem (const QPointF &p, const QTextItem &textItem) |
This function draws the text item textItem at position p. | |
virtual void | drawTiledPixmap (const QRectF &r, const QPixmap &pixmap, const QPointF &s) |
Reimplement this function to draw the pixmap in the given rect, starting at the given p. | |
virtual void | drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) |
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap. | |
void | setPaintDevice (QPaintDevice *device) |
QPaintDevice * | paintDevice () const |
Returns the device that this engine is painting on, if painting is active; otherwise returns \nullptr. | |
void | setSystemClip (const QRegion &baseClip) |
QRegion | systemClip () const |
void | setSystemRect (const QRect &rect) |
QRect | systemRect () const |
virtual QPoint | coordinateOffset () const |
virtual Type | type () const =0 |
Reimplement this function to return the paint engine \l{Type}. | |
void | fix_neg_rect (int *x, int *y, int *w, int *h) |
bool | testDirty (DirtyFlags df) |
void | setDirty (DirtyFlags df) |
void | clearDirty (DirtyFlags df) |
bool | hasFeature (PaintEngineFeatures feature) const |
Returns true if the paint engine supports the specified feature; otherwise returns false . | |
QPainter * | painter () const |
Returns the paint engine's painter. | |
void | syncState () |
bool | isExtended () const |
virtual QPixmap | createPixmap (QSize size) |
virtual QPixmap | createPixmapFromImage (QImage image, Qt::ImageConversionFlags flags=Qt::AutoColor) |
Additional Inherited Members | |
![]() | |
enum | PaintEngineFeature { PrimitiveTransform = 0x00000001 , PatternTransform = 0x00000002 , PixmapTransform = 0x00000004 , PatternBrush = 0x00000008 , LinearGradientFill = 0x00000010 , RadialGradientFill = 0x00000020 , ConicalGradientFill = 0x00000040 , AlphaBlend = 0x00000080 , PorterDuff = 0x00000100 , PainterPaths = 0x00000200 , Antialiasing = 0x00000400 , BrushStroke = 0x00000800 , ConstantOpacity = 0x00001000 , MaskedBrush = 0x00002000 , PerspectiveTransform = 0x00004000 , BlendModes = 0x00008000 , ObjectBoundingModeGradients = 0x00010000 , RasterOpModes = 0x00020000 , PaintOutsidePaintEvent = 0x20000000 , AllFeatures = 0xffffffff } |
This enum is used to describe the features or capabilities that the paint engine has. More... | |
enum | DirtyFlag { DirtyPen = 0x0001 , DirtyBrush = 0x0002 , DirtyBrushOrigin = 0x0004 , DirtyFont = 0x0008 , DirtyBackground = 0x0010 , DirtyBackgroundMode = 0x0020 , DirtyTransform = 0x0040 , DirtyClipRegion = 0x0080 , DirtyClipPath = 0x0100 , DirtyHints = 0x0200 , DirtyCompositionMode = 0x0400 , DirtyClipEnabled = 0x0800 , DirtyOpacity = 0x1000 , AllDirty = 0xffff } |
\value DirtyPen The pen is dirty and needs to be updated. More... | |
enum | PolygonDrawMode { OddEvenMode , WindingMode , ConvexMode , PolylineMode } |
\value OddEvenMode The polygon should be drawn using OddEven fill rule. More... | |
enum | Type { X11 , Windows , QuickDraw , CoreGraphics , MacPrinter , QWindowSystem , OpenGL , Picture , SVG , Raster , Direct3D , Pdf , OpenVG , OpenGL2 , PaintBuffer , Blitter , Direct2D , User = 50 , MaxUser = 100 } |
\value X11 \value Windows \value MacPrinter \value CoreGraphics \macos's Quartz2D (CoreGraphics) \value QuickDraw \macos's QuickDraw \value QWindowSystem Qt for Embedded Linux \value OpenGL \value Picture QPicture format \value SVG Scalable Vector Graphics XML format \value Raster \value Direct3D Windows only, Direct3D based engine \value Pdf Portable Document Format \value OpenVG \value User First user type ID \value MaxUser Last user type ID \value OpenGL2 \value PaintBuffer \value Blitter \value Direct2D Windows only, Direct2D based engine More... | |
![]() | |
QPaintEngine (QPaintEnginePrivate &data, PaintEngineFeatures devcaps=PaintEngineFeatures()) | |
![]() | |
QPaintEngineState * | state |
PaintEngineFeatures | gccaps |
uint | active: 1 |
uint | selfDestruct: 1 |
uint | extended: 1 |
QScopedPointer< QPaintEnginePrivate > | d_ptr |
Definition at line 142 of file qsvggenerator.cpp.
|
inlineexplicit |
Definition at line 147 of file qsvggenerator.cpp.
|
overridevirtual |
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev.
Return true if the initialization was successful; otherwise return false.
Implements QPaintEngine.
Definition at line 873 of file qsvggenerator.cpp.
References d, Qt::endl(), generateQtDefaults(), qPrintable, qWarning, QSvgGenerator::Svg11, QSvgGenerator::SvgTiny12, QIODeviceBase::Text, and QIODeviceBase::WriteOnly.
|
inline |
Definition at line 188 of file qsvggenerator.cpp.
|
inline |
Definition at line 183 of file qsvggenerator.cpp.
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
The default implementation calls drawPolygon().
Reimplemented from QPaintEngine.
Definition at line 1086 of file qsvggenerator.cpp.
References d, Qt::endl(), QPen::isCosmetic(), QPaintEngineState::pen(), and QPaintEngine::state.
|
overridevirtual |
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap.
Reimplemented from QPaintEngine.
Definition at line 972 of file qsvggenerator.cpp.
References Q_UNUSED, QIODeviceBase::ReadWrite, QPaintEngineState::renderHints(), QPainter::SmoothPixmapTransform, QPaintEngine::state, and stream().
Referenced by drawPixmap().
|
overridevirtual |
The default implementation ignores the path and does nothing.
Reimplemented from QPaintEngine.
Definition at line 1103 of file qsvggenerator.cpp.
References QPainterPath::CurveToDataElement, QPainterPath::CurveToElement, d, e, Qt::endl(), i, QPen::isCosmetic(), QPainterPath::LineToElement, QPainterPath::MoveToElement, Qt::OddEvenFill, QPaintEngineState::pen(), and QPaintEngine::state.
Referenced by drawPolygon(), and updateClipState().
|
overridevirtual |
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
Implements QPaintEngine.
Definition at line 966 of file qsvggenerator.cpp.
References drawImage(), and QPixmap::toImage().
|
overridevirtual |
Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.
Reimplemented from QPaintEngine.
Definition at line 1147 of file qsvggenerator.cpp.
References drawPath(), Qt::endl(), i, QPen::isCosmetic(), QPaintEngineState::pen(), QPaintEngine::PolylineMode, Q_ASSERT, QPaintEngine::state, stream(), QPointF::x(), and QPointF::y().
Draws the first rectCount rectangles in the buffer rects.
The default implementation of this function calls drawPath() or drawPolygon() depending on the feature set of the paint engine.
Reimplemented from QPaintEngine.
Definition at line 1173 of file qsvggenerator.cpp.
References d, Qt::endl(), i, QPen::isCosmetic(), QRectF::normalized(), QPaintEngineState::pen(), rect, and QPaintEngine::state.
|
overridevirtual |
This function draws the text item textItem at position p.
The default implementation of this function converts the text to a QPainterPath and paints the resulting path.
Reimplemented from QPaintEngine.
Definition at line 1188 of file qsvggenerator.cpp.
References QTextItemInt::chars, d, QPaintEngine::drawTextItem(), Qt::endl(), QTextItem::font(), QString::fromRawData(), Qt::NoPen, QTextItemInt::num_chars, qfontToSvg(), QPointF::x(), and QPointF::y().
|
overridevirtual |
Reimplement this function to finish painting on the current paint device.
Return true if painting was finished successfully; otherwise return false.
Implements QPaintEngine.
Definition at line 941 of file qsvggenerator.cpp.
References d, and Qt::endl().
|
inline |
Definition at line 330 of file qsvggenerator.cpp.
Referenced by begin().
|
inline |
Definition at line 193 of file qsvggenerator.cpp.
void QSvgPaintEngine::popGroup | ( | ) |
Definition at line 435 of file qsvggenerator.cpp.
References QString::arg(), Qt::BDiagPattern, QBrush::color(), Qt::ConicalGradientPattern, Qt::CrossPattern, Qt::Dense1Pattern, Qt::Dense2Pattern, Qt::Dense3Pattern, Qt::Dense4Pattern, Qt::Dense5Pattern, Qt::Dense6Pattern, Qt::Dense7Pattern, Qt::DiagCrossPattern, Qt::FDiagPattern, QString::fill(), QString::fromLatin1(), QBrush::gradient(), Qt::HorPattern, Qt::LinearGradientPattern, Qt::NoBrush, QStringLiteral, Qt::RadialGradientPattern, saveConicalGradientBrush(), saveLinearGradientBrush(), savePatternBrush(), saveRadialGradientBrush(), Qt::SolidPattern, stream(), QBrush::style(), translate_color(), and Qt::VerPattern.
Referenced by updateState().
Definition at line 499 of file qsvggenerator.cpp.
References d, Qt::endl(), and QString::number().
Referenced by drawTextItem(), and updateState().
Definition at line 346 of file qsvggenerator.cpp.
References Qt::BevelJoin, QPen::capStyle(), QPen::color(), Qt::CustomDashLine, Qt::DashDotDotLine, Qt::DashDotLine, Qt::DashLine, QPen::dashOffset(), QPen::dashPattern(), Qt::DotLine, Qt::FlatCap, QPen::joinStyle(), Qt::MiterJoin, QPen::miterLimit(), Qt::NoPen, QString::number(), qWarning, Qt::RoundCap, Qt::RoundJoin, Qt::SolidLine, Qt::SquareCap, stream(), QPen::style(), Qt::SvgMiterJoin, translate_color(), translate_dashPattern(), QPen::width(), and QPen::widthF().
Referenced by updateState().
|
inline |
Definition at line 199 of file qsvggenerator.cpp.
Referenced by setResolution().
Definition at line 274 of file qsvggenerator.cpp.
References qWarning.
Referenced by qbrushToSvg().
|
inline |
Definition at line 279 of file qsvggenerator.cpp.
References QList< T >::append(), QList< T >::at(), QList< T >::back(), QGradient::ColorInterpolation, QLatin1StringView::first(), fromColor(), QColor::fromRgba(), QColor::HexRgb, i, INTERPOLATE_PIXEL_256(), j, qCeil(), qPremultiply(), QRgb, qUnpremultiply(), QList< T >::size(), spacing, str, and toColor().
Referenced by saveLinearGradientBrush(), and saveRadialGradientBrush().
|
inline |
Definition at line 320 of file qsvggenerator.cpp.
References QGradient::coordinateMode(), QGradient::ObjectBoundingMode, QGradient::ObjectMode, and str.
Referenced by saveLinearGradientBrush(), and saveRadialGradientBrush().
Definition at line 240 of file qsvggenerator.cpp.
References QIODeviceBase::Append, Qt::endl(), QLinearGradient::finalStop(), saveGradientStops(), saveGradientUnits(), QLinearGradient::start(), str, QPointF::x(), and QPointF::y().
Referenced by qbrushToSvg().
Definition at line 225 of file qsvggenerator.cpp.
References QIODeviceBase::Append, QString::arg(), Qt::endl(), QStringLiteral, savePatternMask(), and str.
Referenced by qbrushToSvg().
|
inline |
Definition at line 207 of file qsvggenerator.cpp.
References QIODeviceBase::Append, QString::arg(), arg, Qt::endl(), QBitmap::fromData(), QStringLiteral, qt_imageForBrush(), and str.
Referenced by savePatternBrush().
Definition at line 257 of file qsvggenerator.cpp.
References QIODeviceBase::Append, QRadialGradient::center(), Qt::endl(), QRadialGradient::focalPoint(), QRadialGradient::radius(), saveGradientStops(), saveGradientUnits(), str, QPointF::x(), and QPointF::y().
Referenced by qbrushToSvg().
Definition at line 189 of file qsvggenerator.cpp.
Definition at line 184 of file qsvggenerator.cpp.
References title.
Definition at line 194 of file qsvggenerator.cpp.
References device, QPaintEngine::isActive(), and Q_ASSERT.
|
inline |
Definition at line 200 of file qsvggenerator.cpp.
References QPaintEngine::isActive(), Q_ASSERT, and resolution().
Definition at line 172 of file qsvggenerator.cpp.
References QPaintEngine::isActive(), Q_ASSERT, and size().
Definition at line 178 of file qsvggenerator.cpp.
References QPaintEngine::isActive(), Q_ASSERT, and viewBox().
|
inline |
Definition at line 171 of file qsvggenerator.cpp.
Referenced by setSize().
|
inline |
Definition at line 340 of file qsvggenerator.cpp.
Referenced by drawImage(), drawPolygon(), qbrushToSvg(), qpenToSvg(), and updateState().
|
inline |
Definition at line 205 of file qsvggenerator.cpp.
|
inlineoverridevirtual |
Reimplement this function to return the paint engine \l{Type}.
Implements QPaintEngine.
Definition at line 169 of file qsvggenerator.cpp.
References QPaintEngine::SVG.
void QSvgPaintEngine::updateClipState | ( | const QPaintEngineState & | state | ) |
Definition at line 1047 of file qsvggenerator.cpp.
References QLatin1StringView::arg(), QPaintEngineState::clipOperation(), d, QPaintEngine::DirtyClipEnabled, QPaintEngine::DirtyClipPath, QPaintEngine::DirtyClipRegion, drawPath(), Qt::IntersectClip, QPaintEngineState::isClipEnabled(), QTransform::map(), Qt::NoClip, QPaintEngine::painter(), Qt::ReplaceClip, QPaintEngine::state, QPaintEngineState::state(), QSvgGenerator::Svg11, QSvgGenerator::SvgTiny12, and QPainter::transform().
Referenced by updateState().
|
overridevirtual |
Reimplement this function to update the state of a paint engine.
When implemented, this function is responsible for checking the paint engine's current state and update the properties that are changed. Use the QPaintEngineState::state() function to find out which properties that must be updated, then use the corresponding \l {GetFunction}{get function} to retrieve the current values for the given properties.
Implements QPaintEngine.
Definition at line 1004 of file qsvggenerator.cpp.
References QPaintEngineState::brush(), d, Qt::endl(), QPaintEngineState::font(), QPaintEngineState::opacity(), QPaintEngineState::pen(), qbrushToSvg(), qfontToSvg(), qFuzzyIsNull(), qpenToSvg(), QStringLiteral, QPaintEngine::state, stream(), QPaintEngineState::transform(), and updateClipState().
|
inline |
Definition at line 177 of file qsvggenerator.cpp.
Referenced by setViewBox().