Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPainterPrivate Class Reference

#include <qpainter_p.h>

+ Collaboration diagram for QPainterPrivate:

Classes

struct  QPaintEngineDestructor
 
struct  SmallStack
 

Public Types

enum  DrawOperation { StrokeDraw = 0x1 , FillDraw = 0x2 , StrokeAndFillDraw = 0x3 }
 

Public Member Functions

 QPainterPrivate (QPainter *painter)
 
 ~QPainterPrivate ()
 
QPainterDummyStatefakeState () const
 
void updateEmulationSpecifier (QPainterState *s)
 
void updateStateImpl (QPainterState *state)
 
void updateState (QPainterState *state)
 
void updateState (std::unique_ptr< QPainterState > &state)
 
void draw_helper (const QPainterPath &path, DrawOperation operation=StrokeAndFillDraw)
 
void drawStretchedGradient (const QPainterPath &path, DrawOperation operation)
 
void drawOpaqueBackground (const QPainterPath &path, DrawOperation operation)
 
void drawTextItem (const QPointF &p, const QTextItem &_ti, QTextEngine *textEngine)
 
void drawGlyphs (const QPointF &decorationPosition, const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, QFontEngine *fontEngine, bool overline=false, bool underline=false, bool strikeOut=false)
 
void updateMatrix ()
 
void updateInvMatrix ()
 
void checkEmulation ()
 
QTransform viewTransform () const
 
qreal effectiveDevicePixelRatio () const
 
QTransform hidpiScaleTransform () const
 
void detachPainterPrivate (QPainter *q)
 
void initFrom (const QPaintDevice *device)
 

Static Public Member Functions

static QPainterPrivateget (QPainter *painter)
 
static bool attachPainterPrivate (QPainter *q, QPaintDevice *pdev)
 

Public Attributes

QPainterq_ptr
 
QVarLengthArray< QPainterPrivate *, NDPtrsd_ptrs
 
std::unique_ptr< QPainterStatestate
 
SmallStack< std::unique_ptr< QPainterState > > savedStates
 
std::unique_ptr< QPainterDummyStatedummyState
 
QTransform invMatrix
 
uint txinv:1
 
uint inDestructor: 1
 
uint refcount = 1
 
QPaintDevicedevice = nullptr
 
QPaintDeviceoriginal_device = nullptr
 
QPaintDevicehelper_device = nullptr
 
std::unique_ptr< QPaintEngine, QPaintEngineDestructorengine
 
std::unique_ptr< QEmulationPaintEngineemulationEngine
 
QPaintEngineExextended = nullptr
 
QBrush colorBrush
 

Static Public Attributes

static constexpr qsizetype NDPtrs = 4
 

Detailed Description

Definition at line 157 of file qpainter_p.h.

Member Enumeration Documentation

◆ DrawOperation

Enumerator
StrokeDraw 
FillDraw 
StrokeAndFillDraw 

Definition at line 185 of file qpainter_p.h.

Constructor & Destructor Documentation

◆ QPainterPrivate()

QPainterPrivate::QPainterPrivate ( QPainter * painter)
explicit

Definition at line 199 of file qpainter.cpp.

Referenced by detachPainterPrivate().

+ Here is the caller graph for this function:

◆ ~QPainterPrivate()

QPainterPrivate::~QPainterPrivate ( )
default

Member Function Documentation

◆ attachPainterPrivate()

bool QPainterPrivate::attachPainterPrivate ( QPainter * q,
QPaintDevice * pdev )
static

Definition at line 237 of file qpainter.cpp.

References QPaintEnginePrivate::currentClipDevice, QTransform::fromTranslate(), QPaintDevice::height(), Q_ASSERT, Q_UNUSED, QPaintDevice::redirected(), QPaintEnginePrivate::setSystemTransform(), QPaintDevice::sharedPainter(), sp, QPaintEnginePrivate::systemStateChanged(), and QPaintDevice::width().

Referenced by QPainter::QPainter(), and QPainter::begin().

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

◆ checkEmulation()

void QPainterPrivate::checkEmulation ( )

Definition at line 171 of file qpainter.cpp.

References QPaintEngineEx::DoNotEmulate, emulationEngine, extended, QPaintEngineEx::flags(), needsEmulation(), Qt::OpaqueMode, Q_ASSERT, qpen_brush(), QPaintEngineEx::setState(), and state.

+ Here is the call graph for this function:

◆ detachPainterPrivate()

void QPainterPrivate::detachPainterPrivate ( QPainter * q)

Definition at line 290 of file qpainter.cpp.

References QPainterPrivate(), QVarLengthArray< T, Prealloc >::back(), d_ptrs, emulationEngine, extended, inDestructor, QVarLengthArray< T, Prealloc >::pop_back(), Q_ASSERT, Q_UNUSED, and refcount.

+ Here is the call graph for this function:

◆ draw_helper()

◆ drawGlyphs()

void QPainterPrivate::drawGlyphs ( const QPointF & decorationPosition,
const quint32 * glyphArray,
QFixedPoint * positionArray,
int glyphCount,
QFontEngine * fontEngine,
bool overline = false,
bool underline = false,
bool strikeOut = false )

Definition at line 5330 of file qpainter.cpp.

References QStaticTextItem::color, QPaintEngineEx::drawStaticTextItem(), engine, extended, QTextItemInt::fontEngine, positions, qt_draw_decoration_for_glyphs(), state, and updateState().

+ Here is the call graph for this function:

◆ drawOpaqueBackground()

void QPainterPrivate::drawOpaqueBackground ( const QPainterPath & path,
DrawOperation operation )

Definition at line 473 of file qpainter.cpp.

References FillDraw, Qt::NoBrush, Qt::NoPen, Qt::OpaqueMode, state, StrokeDraw, and Qt::TransparentMode.

Referenced by draw_helper().

+ Here is the caller graph for this function:

◆ drawStretchedGradient()

void QPainterPrivate::drawStretchedGradient ( const QPainterPath & path,
DrawOperation operation )

◆ drawTextItem()

void QPainterPrivate::drawTextItem ( const QPointF & p,
const QTextItem & _ti,
QTextEngine * textEngine )

◆ effectiveDevicePixelRatio()

qreal QPainterPrivate::effectiveDevicePixelRatio ( ) const

Definition at line 218 of file qpainter.cpp.

References device, QPaintDevice::devicePixelRatio(), QPaintDevice::devType(), and QInternal::Printer.

Referenced by hidpiScaleTransform().

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

◆ fakeState()

QPainterDummyState * QPainterPrivate::fakeState ( ) const
inline

Definition at line 190 of file qpainter_p.h.

References dummyState.

◆ get()

static QPainterPrivate * QPainterPrivate::get ( QPainter * painter)
inlinestatic

Definition at line 217 of file qpainter_p.h.

References painter.

◆ hidpiScaleTransform()

QTransform QPainterPrivate::hidpiScaleTransform ( ) const

Definition at line 227 of file qpainter.cpp.

References effectiveDevicePixelRatio(), and QTransform::fromScale().

Referenced by updateMatrix().

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

◆ initFrom()

void QPainterPrivate::initFrom ( const QPaintDevice * device)

Definition at line 1521 of file qpainter.cpp.

References device, QPaintEngine::DirtyBrush, QPaintEngine::DirtyFont, QPaintEngine::DirtyPen, engine, extended, QPaintDevice::initPainter(), QPaintEngineEx::penChanged(), and qWarning.

+ Here is the call graph for this function:

◆ updateEmulationSpecifier()

void QPainterPrivate::updateEmulationSpecifier ( QPainterState * s)

Definition at line 655 of file qpainter.cpp.

References QPaintEngine::AlphaBlend, QPaintEngine::BlendModes, QPaintEngine::BrushStroke, QPainter::CompositionMode_Xor, QPaintEngine::ConicalGradientFill, Qt::ConicalGradientPattern, QPaintEngine::ConstantOpacity, coordinateMode(), QPaintEngine::DirtyBackgroundMode, QPaintEngine::DirtyBrush, QPaintEngine::DirtyHints, QPaintEngine::DirtyOpacity, QPaintEngine::DirtyPen, QPaintEngine::DirtyTransform, engine, is_brush_transparent(), is_pen_transparent(), QTransform::isAffine(), QTransform::isIdentity(), QPaintEngine::LinearGradientFill, Qt::LinearGradientPattern, QPaintEngine::MaskedBrush, Qt::NoBrush, Qt::NoPen, QGradient::ObjectBoundingMode, QPaintEngine::ObjectBoundingModeGradients, QGradient::ObjectMode, Qt::OpaqueMode, QPaintEngine::PatternBrush, QPaintEngine::PatternTransform, QPaintEngine::PerspectiveTransform, QPaintEngine::PrimitiveTransform, qbrush_style(), qDebug, QGradient_StretchToDevice, qHasPixmapTexture(), QPaintEngine_OpaqueBackground, qpen_brush(), qpen_style(), qt_isExtendedRadialGradient(), QPaintEngine::RadialGradientFill, Qt::RadialGradientPattern, Qt::SolidPattern, state, QGradient::StretchToDeviceMode, Qt::TexturePattern, QTransform::TxNone, QTransform::TxTranslate, and xform.

Referenced by updateStateImpl().

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

◆ updateInvMatrix()

void QPainterPrivate::updateInvMatrix ( )

Definition at line 646 of file qpainter.cpp.

References QTransform::inverted(), invMatrix, Q_ASSERT, state, and txinv.

+ Here is the call graph for this function:

◆ updateMatrix()

void QPainterPrivate::updateMatrix ( )

Definition at line 626 of file qpainter.cpp.

References QPaintEngine::DirtyTransform, extended, hidpiScaleTransform(), state, QPaintEngineEx::transformChanged(), txinv, and viewTransform().

+ Here is the call graph for this function:

◆ updateState() [1/2]

void QPainterPrivate::updateState ( QPainterState * state)

Definition at line 892 of file qpainter.cpp.

References engine, newState(), and updateStateImpl().

Referenced by draw_helper(), drawGlyphs(), drawStretchedGradient(), and drawTextItem().

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

◆ updateState() [2/2]

void QPainterPrivate::updateState ( std::unique_ptr< QPainterState > & state)
inline

Definition at line 199 of file qpainter_p.h.

References state, and updateState().

Referenced by updateState().

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

◆ updateStateImpl()

void QPainterPrivate::updateStateImpl ( QPainterState * state)

Definition at line 860 of file qpainter.cpp.

References QPaintEngine::AllDirty, QPainterState::changeFlags, QPaintEngine::DirtyBackground, QPaintEngine::DirtyBackgroundMode, QPaintEngineState::dirtyFlags, engine, newState(), QPaintEngine::state, and updateEmulationSpecifier().

Referenced by updateState().

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

◆ viewTransform()

QTransform QPainterPrivate::viewTransform ( ) const

Definition at line 207 of file qpainter.cpp.

References state.

Referenced by updateMatrix().

+ Here is the caller graph for this function:

Member Data Documentation

◆ colorBrush

QBrush QPainterPrivate::colorBrush

Definition at line 244 of file qpainter_p.h.

◆ d_ptrs

QVarLengthArray<QPainterPrivate*, NDPtrs> QPainterPrivate::d_ptrs

Definition at line 169 of file qpainter_p.h.

Referenced by detachPainterPrivate().

◆ device

QPaintDevice* QPainterPrivate::device = nullptr

Definition at line 229 of file qpainter_p.h.

Referenced by draw_helper(), effectiveDevicePixelRatio(), and initFrom().

◆ dummyState

std::unique_ptr<QPainterDummyState> QPainterPrivate::dummyState
mutable

Definition at line 178 of file qpainter_p.h.

Referenced by fakeState().

◆ emulationEngine

std::unique_ptr<QEmulationPaintEngine> QPainterPrivate::emulationEngine

Definition at line 242 of file qpainter_p.h.

Referenced by checkEmulation(), and detachPainterPrivate().

◆ engine

◆ extended

QPaintEngineEx* QPainterPrivate::extended = nullptr

◆ helper_device

QPaintDevice* QPainterPrivate::helper_device = nullptr

Definition at line 231 of file qpainter_p.h.

Referenced by draw_helper(), and drawStretchedGradient().

◆ inDestructor

uint QPainterPrivate::inDestructor

Definition at line 182 of file qpainter_p.h.

Referenced by detachPainterPrivate().

◆ invMatrix

QTransform QPainterPrivate::invMatrix

Definition at line 180 of file qpainter_p.h.

Referenced by draw_helper(), and updateInvMatrix().

◆ NDPtrs

constexpr qsizetype QPainterPrivate::NDPtrs = 4
staticconstexpr

Definition at line 168 of file qpainter_p.h.

◆ original_device

QPaintDevice* QPainterPrivate::original_device = nullptr

Definition at line 230 of file qpainter_p.h.

◆ q_ptr

QPainter* QPainterPrivate::q_ptr

Definition at line 164 of file qpainter_p.h.

◆ refcount

uint QPainterPrivate::refcount = 1

Definition at line 183 of file qpainter_p.h.

Referenced by detachPainterPrivate().

◆ savedStates

SmallStack<std::unique_ptr<QPainterState> > QPainterPrivate::savedStates

Definition at line 176 of file qpainter_p.h.

◆ state

◆ txinv

uint QPainterPrivate::txinv

Definition at line 181 of file qpainter_p.h.

Referenced by draw_helper(), updateInvMatrix(), and updateMatrix().


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