Qt 4.8
Public Functions | Public Variables | List of all members
QPaintEnginePrivate Class Reference

#include <qpaintengine_p.h>

Inheritance diagram for QPaintEnginePrivate:
QAlphaPaintEnginePrivate QCoreGraphicsPaintEnginePrivate QMacPrintEnginePrivate QPaintEngineExPrivate QPicturePaintEnginePrivate QPreviewPaintEnginePrivate QSvgPaintEnginePrivate QtopiaPrintEnginePrivate QX11PaintEnginePrivate

Public Functions

void drawBoxTextItem (const QPointF &p, const QTextItemInt &ti)
 
 QPaintEnginePrivate ()
 
void setSystemTransform (const QTransform &xform)
 
void setSystemViewport (const QRegion &region)
 
virtual void systemStateChanged ()
 
void transformSystemClip ()
 
virtual ~QPaintEnginePrivate ()
 

Public Variables

QWidgetcurrentClipWidget
 
uint hasSystemTransform: 1
 
uint hasSystemViewport: 1
 
QPaintDevicepdev
 
QPaintEngineq_ptr
 
QRegion systemClip
 
QRect systemRect
 
QTransform systemTransform
 
QRegion systemViewport
 

Detailed Description

Definition at line 65 of file qpaintengine_p.h.

Constructors and Destructors

◆ QPaintEnginePrivate()

QPaintEnginePrivate::QPaintEnginePrivate ( )
inline

Definition at line 69 of file qpaintengine_p.h.

70  hasSystemViewport(0) {}
QPaintDevice * pdev
QWidget * currentClipWidget
QPaintEngine * q_ptr

◆ ~QPaintEnginePrivate()

virtual QPaintEnginePrivate::~QPaintEnginePrivate ( )
inlinevirtual

Definition at line 71 of file qpaintengine_p.h.

71 { }

Functions

◆ drawBoxTextItem()

void QPaintEnginePrivate::drawBoxTextItem ( const QPointF p,
const QTextItemInt ti 
)

Definition at line 1098 of file qpaintengine.cpp.

Referenced by systemStateChanged().

1099 {
1100  if (!ti.glyphs.numGlyphs)
1101  return;
1102 
1103  // any fixes here should probably also be done in QFontEngineBox::draw
1104  const int size = qRound(ti.fontEngine->ascent());
1106  QVarLengthArray<glyph_t> glyphs;
1107  QTransform matrix = QTransform::fromTranslate(p.x(), p.y() - size);
1108  ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
1109  if (glyphs.size() == 0)
1110  return;
1111 
1112  QSize s(size - 3, size - 3);
1113 
1114  QPainter *painter = q_func()->state->painter();
1115  painter->save();
1116  painter->setBrush(Qt::NoBrush);
1117  QPen pen = painter->pen();
1119  painter->setPen(pen);
1120  for (int k = 0; k < positions.size(); k++)
1121  painter->drawRect(QRectF(positions[k].toPointF(), s));
1122  painter->restore();
1123 }
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
virtual QFixed lineThickness() const
QFontEngine * fontEngine
RenderFlags flags
void restore()
Restores the current painter state (pops a saved state off the stack).
Definition: qpainter.cpp:1620
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
void save()
Saves the current painter state (pushes the state onto a stack).
Definition: qpainter.cpp:1590
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
QGlyphLayout glyphs
const QPen & pen() const
Returns the painter&#39;s current pen.
Definition: qpainter.cpp:4152
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
static const QCssKnownValue positions[NumKnownPositionModes - 1]
Definition: qcssparser.cpp:329
virtual QFixed ascent() const =0
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
Definition: qpen.cpp:690
void setBrush(const QBrush &brush)
Sets the painter&#39;s brush to the given brush.
Definition: qpainter.cpp:4171
void setPen(const QColor &color)
Sets the painter&#39;s pen to have style Qt::SolidLine, width 0 and the specified color.
Definition: qpainter.cpp:4047
qreal toReal() const
Definition: qfixed_p.h:77
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
Definition: qpainter.h:650
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
static QTransform fromTranslate(qreal dx, qreal dy)
Creates a matrix which corresponds to a translation of dx along the x axis and dy along the y axis...
Definition: qtransform.cpp:462
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
int size() const
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ setSystemTransform()

void QPaintEnginePrivate::setSystemTransform ( const QTransform xform)
inline

Definition at line 104 of file qpaintengine_p.h.

Referenced by QPainterPrivate::attachPainterPrivate(), and QWidget::render().

105  {
106  systemTransform = xform;
107  if ((hasSystemTransform = !xform.isIdentity()) || hasSystemViewport)
110  }
bool isIdentity() const
Returns true if the matrix is the identity matrix, otherwise returns false.
Definition: qtransform.h:204
QTransform systemTransform
virtual void systemStateChanged()

◆ setSystemViewport()

void QPaintEnginePrivate::setSystemViewport ( const QRegion region)
inline

Definition at line 112 of file qpaintengine_p.h.

Referenced by QWidget::render().

113  {
114  systemViewport = region;
116  }
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098

◆ systemStateChanged()

virtual void QPaintEnginePrivate::systemStateChanged ( )
inlinevirtual

◆ transformSystemClip()

void QPaintEnginePrivate::transformSystemClip ( )
inline

Definition at line 82 of file qpaintengine_p.h.

Referenced by setSystemTransform().

83  {
84  if (systemClip.isEmpty())
85  return;
86 
87  if (hasSystemTransform) {
90  else
92  }
93 
94  // Make sure we're inside the viewport.
95  if (hasSystemViewport) {
97  if (systemClip.isEmpty()) {
98  // We don't want to paint without system clip, so set it to 1 pixel :)
100  }
101  }
102  }
qreal dy() const
Returns the vertical translation factor.
Definition: qtransform.h:277
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
TransformationType type() const
Returns the transformation type of this matrix.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
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...
QTransform systemTransform
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
qreal dx() const
Returns the horizontal translation factor.
Definition: qtransform.h:273
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
Definition: qregion.cpp:4116
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

Properties

◆ currentClipWidget

QWidget* QPaintEnginePrivate::currentClipWidget

Definition at line 78 of file qpaintengine_p.h.

Referenced by QPainterPrivate::attachPainterPrivate().

◆ hasSystemTransform

uint QPaintEnginePrivate::hasSystemTransform

Definition at line 79 of file qpaintengine_p.h.

Referenced by setSystemTransform(), and transformSystemClip().

◆ hasSystemViewport

uint QPaintEnginePrivate::hasSystemViewport

Definition at line 80 of file qpaintengine_p.h.

Referenced by setSystemTransform(), setSystemViewport(), and transformSystemClip().

◆ pdev

QPaintDevice* QPaintEnginePrivate::pdev

Definition at line 72 of file qpaintengine_p.h.

Referenced by QAlphaPaintEngine::begin().

◆ q_ptr

QPaintEngine* QPaintEnginePrivate::q_ptr

◆ systemClip

QRegion QPaintEnginePrivate::systemClip

Definition at line 74 of file qpaintengine_p.h.

Referenced by QWidget::render().

◆ systemRect

QRect QPaintEnginePrivate::systemRect

Definition at line 75 of file qpaintengine_p.h.

◆ systemTransform

QTransform QPaintEnginePrivate::systemTransform

Definition at line 77 of file qpaintengine_p.h.

Referenced by QWidget::render().

◆ systemViewport

QRegion QPaintEnginePrivate::systemViewport

Definition at line 76 of file qpaintengine_p.h.

Referenced by QWidget::render(), and transformSystemClip().


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