Qt 4.8
Public Functions | Private Functions | List of all members
QPdfBaseEngine Class Referenceabstract

#include <qpdf_p.h>

Inheritance diagram for QPdfBaseEngine:
QAlphaPaintEngine QPrintEngine QPaintEngine QPdfEngine QPSPrintEngine

Public Functions

bool begin (QPaintDevice *pdev)
 Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. More...
 
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. More...
 
void drawPath (const QPainterPath &path)
 The default implementation ignores the path and does nothing. More...
 
void drawPoints (const QPointF *points, int pointCount)
 Draws the first pointCount points in the buffer points. More...
 
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. More...
 
void drawRects (const QRectF *rects, int rectCount)
 Draws the first rectCount rectangles in the buffer rects. More...
 
void drawTextItem (const QPointF &p, const QTextItem &textItem)
 This function draws the text item textItem at position p. More...
 
bool end ()
 Reimplement this function to finish painting on the current paint device. More...
 
int metric (QPaintDevice::PaintDeviceMetric metricType) const
 Returns the metric for the given id. More...
 
bool newPage ()
 Instructs the print engine to start a new page. More...
 
QVariant property (PrintEnginePropertyKey key) const
 Returns the print engine's property specified by key. More...
 
 QPdfBaseEngine (QPdfBaseEnginePrivate &d, PaintEngineFeatures f)
 
virtual void setBrush ()=0
 
void setPen ()
 
void setProperty (PrintEnginePropertyKey key, const QVariant &value)
 Sets the print engine's property specified by key to the given value. More...
 
void setupGraphicsState (QPaintEngine::DirtyFlags flags)
 
void updateState (const QPaintEngineState &state)
 Reimplement this function to update the state of a paint engine. More...
 
 ~QPdfBaseEngine ()
 
- Public Functions inherited from QAlphaPaintEngine
virtual void drawImage (const QRectF &r, const QImage &image, const QRectF &sr)
 
virtual void drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr)
 Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r. More...
 
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. More...
 
 ~QAlphaPaintEngine ()
 
- Public Functions inherited from QPaintEngine
void clearDirty (DirtyFlags df)
 
virtual QPoint coordinateOffset () const
 Returns the offset from the painters origo to the engines origo. More...
 
virtual void drawEllipse (const QRectF &r)
 Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. More...
 
virtual void drawEllipse (const QRect &r)
 The default implementation of this function calls the floating point version of this function. More...
 
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. More...
 
virtual void drawLines (const QLine *lines, int lineCount)
 The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function. More...
 
virtual void drawPoints (const QPoint *points, int pointCount)
 Draws the first pointCount points in the buffer points. More...
 
virtual void drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode)
 Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. More...
 
virtual void drawRects (const QRect *rects, int rectCount)
 The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function. More...
 
void fix_neg_rect (int *x, int *y, int *w, int *h)
 
virtual HDC getDC () const
 Empty default implementation. More...
 
bool hasFeature (PaintEngineFeatures feature) const
 Returns true if the paint engine supports the specified feature; otherwise returns false. More...
 
bool isActive () const
 Returns true if the paint engine is actively drawing; otherwise returns false. More...
 
bool isExtended () const
 Returns true if the paint engine is a QPaintEngineEx derivative. More...
 
QPaintDevicepaintDevice () const
 Returns the device that this engine is painting on, if painting is active; otherwise returns 0. More...
 
QPainterpainter () const
 Returns the paint engine's painter. More...
 
 QPaintEngine (PaintEngineFeatures features=0)
 Creates a paint engine with the featureset specified by caps. More...
 
virtual void releaseDC (HDC hdc) const
 Empty default implementation. More...
 
void setActive (bool newState)
 Sets the active state of the paint engine to state. More...
 
void setDirty (DirtyFlags df)
 
void setPaintDevice (QPaintDevice *device)
 
void setSystemClip (const QRegion &baseClip)
 Sets the system clip for this engine. More...
 
void setSystemRect (const QRect &rect)
 Sets the target rect for drawing within the backing store. More...
 
void syncState ()
 Updates all dirty states in this engine. More...
 
QRegion systemClip () const
 Returns the system clip. More...
 
QRect systemRect () const
 Retrieves the rect for drawing within the backing store. More...
 
bool testDirty (DirtyFlags df)
 
virtual Type type () const =0
 Reimplement this function to return the paint engine Type. More...
 
virtual ~QPaintEngine ()
 Destroys the paint engine. More...
 
- Public Functions inherited from QPrintEngine
virtual bool abort ()=0
 Instructs the print engine to abort the printing process. More...
 
virtual HDC getPrinterDC () const
 
virtual QPrinter::PrinterState printerState () const =0
 Returns the current state of the printer being used by the print engine. More...
 
virtual void releasePrinterDC (HDC) const
 
virtual ~QPrintEngine ()
 Destroys the print engine. More...
 

Private Functions

void updateClipPath (const QPainterPath &path, Qt::ClipOperation op)
 

Additional Inherited Members

- Public Types inherited from QPaintEngine
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
}
 QPaintEngine::updateState(). More...
 
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  PolygonDrawMode { OddEvenMode, WindingMode, ConvexMode, PolylineMode }
 
enum  Type {
  X11, Windows, QuickDraw, CoreGraphics,
  MacPrinter, QWindowSystem, PostScript, OpenGL,
  Picture, SVG, Raster, Direct3D,
  Pdf, OpenVG, OpenGL2, PaintBuffer,
  Blitter, User = 50, MaxUser = 100
}
 
- Public Types inherited from QPrintEngine
enum  PrintEnginePropertyKey {
  PPK_CollateCopies, PPK_ColorMode, PPK_Creator, PPK_DocumentName,
  PPK_FullPage, PPK_NumberOfCopies, PPK_Orientation, PPK_OutputFileName,
  PPK_PageOrder, PPK_PageRect, PPK_PageSize, PPK_PaperRect,
  PPK_PaperSource, PPK_PrinterName, PPK_PrinterProgram, PPK_Resolution,
  PPK_SelectionOption, PPK_SupportedResolutions, PPK_WindowsPageSize, PPK_FontEmbedding,
  PPK_SuppressSystemPrintStatus, PPK_Duplex, PPK_PaperSources, PPK_CustomPaperSize,
  PPK_PageMargins, PPK_CopyCount, PPK_SupportsMultipleCopies, PPK_PaperSize = PPK_PageSize,
  PPK_CustomBase = 0xff00
}
 This enum is used to communicate properties between the print engine and QPrinter. More...
 
- Protected Functions inherited from QAlphaPaintEngine
QRegion alphaClipping () const
 
void cleanUp ()
 
bool continueCall () const
 
void flushAndInit (bool init=true)
 
 QAlphaPaintEngine (QAlphaPaintEnginePrivate &data, PaintEngineFeatures devcaps=0)
 
- Protected Functions inherited from QPaintEngine
 QPaintEngine (QPaintEnginePrivate &data, PaintEngineFeatures devcaps=0)
 
- Protected Variables inherited from QPaintEngine
uint active: 1
 
QScopedPointer< QPaintEnginePrivated_ptr
 
uint extended: 1
 
PaintEngineFeatures gccaps
 
uint selfDestruct: 1
 
QPaintEngineStatestate
 

Detailed Description

Definition at line 182 of file qpdf_p.h.

Constructors and Destructors

◆ QPdfBaseEngine()

QPdfBaseEngine::QPdfBaseEngine ( QPdfBaseEnginePrivate d,
PaintEngineFeatures  f 
)

Definition at line 919 of file qpdf.cpp.

920  : QAlphaPaintEngine(dd, f)
921 {
923 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
925  QCUPSSupport cups;
926  const cups_dest_t* printers = cups.availablePrinters();
927  int prnCount = cups.availablePrintersCount();
928 
929  for (int i = 0; i < prnCount; ++i) {
930  if (printers[i].is_default) {
931  d->printerName = QString::fromLocal8Bit(printers[i].name);
932  break;
933  }
934  }
935 
936  } else
937 #endif
938  {
939  d->printerName = QString::fromLocal8Bit(qgetenv("PRINTER"));
940  if (d->printerName.isEmpty())
942  if (d->printerName.isEmpty())
943  d->printerName = QString::fromLocal8Bit(qgetenv("NPRINTER"));
944  if (d->printerName.isEmpty())
945  d->printerName = QString::fromLocal8Bit(qgetenv("NGPRINTER"));
946  }
947 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
int availablePrintersCount() const
Definition: qcups.cpp:163
QAlphaPaintEngine(QAlphaPaintEnginePrivate &data, PaintEngineFeatures devcaps=0)
const cups_dest_t * availablePrinters() const
Definition: qcups.cpp:168
static bool isAvailable()
Definition: qcups.cpp:216
#define Q_D(Class)
Definition: qglobal.h:2482
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const char * name
QString printerName
Definition: qpdf_p.h:264

◆ ~QPdfBaseEngine()

QPdfBaseEngine::~QPdfBaseEngine ( )
inline

Definition at line 187 of file qpdf_p.h.

187 {}

Functions

◆ begin()

bool QPdfBaseEngine::begin ( QPaintDevice pdev)
virtual

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.

See also
end() isActive()

Reimplemented from QAlphaPaintEngine.

Reimplemented in QPdfEngine, and QPSPrintEngine.

Definition at line 1617 of file qpdf.cpp.

Referenced by QPSPrintEngine::begin(), and QPdfEngine::begin().

1618 {
1620  d->pdev = pdev;
1621 
1622  d->postscript = false;
1623  d->currentObject = 1;
1624 
1625  d->currentPage = new QPdfPage;
1626  d->stroker.stream = d->currentPage;
1627  d->opacity = 1.0;
1628 
1629  return d->openPrintDevice();
1630 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ drawLines()

void QPdfBaseEngine::drawLines ( const QLineF lines,
int  lineCount 
)
virtual

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.

Reimplemented from QPaintEngine.

Definition at line 967 of file qpdf.cpp.

968 {
969  if (!lines)
970  return;
971 
973  QPainterPath p;
974  for (int i=0; i!=lineCount;++i) {
975  p.moveTo(lines[i].p1());
976  p.lineTo(lines[i].p2());
977  }
978  bool hadBrush = d->hasBrush;
979  d->hasBrush = false;
980  drawPath(p);
981  d->hasBrush = hadBrush;
982 }
double d
Definition: qnumeric_p.h:62
void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
Definition: qpdf.cpp:1061
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
#define Q_D(Class)
Definition: qglobal.h:2482
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.

◆ drawPath()

void QPdfBaseEngine::drawPath ( const QPainterPath path)
virtual

The default implementation ignores the path and does nothing.

Reimplemented from QAlphaPaintEngine.

Definition at line 1061 of file qpdf.cpp.

Referenced by drawLines(), drawPoints(), drawPolygon(), and drawRects().

1062 {
1064 
1065  if (d->useAlphaEngine) {
1067  if (!continueCall())
1068  return;
1069  }
1070 
1071  if (d->clipEnabled && d->allClipped)
1072  return;
1073  if (!d->hasPen && !d->hasBrush)
1074  return;
1075 
1076  if (d->simplePen) {
1077  // draw strokes natively in this case for better output
1078  *d->currentPage << QPdf::generatePath(p, QTransform(), d->hasBrush ? QPdf::FillAndStrokePath : QPdf::StrokePath);
1079  } else {
1080  if (d->hasBrush)
1081  *d->currentPage << QPdf::generatePath(p, d->stroker.matrix, QPdf::FillPath);
1082  if (d->hasPen) {
1083  *d->currentPage << "q\n";
1084  QBrush b = d->brush;
1085  d->brush = d->pen.brush();
1086  setBrush();
1087  d->stroker.strokePath(p);
1088  *d->currentPage << "Q\n";
1089  d->brush = b;
1090  }
1091  }
1092 }
double d
Definition: qnumeric_p.h:62
virtual void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
#define Q_D(Class)
Definition: qglobal.h:2482
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
QByteArray generatePath(const QPainterPath &path, const QTransform &matrix, PathFlags flags)
Definition: qpdf.cpp:272
virtual void setBrush()=0
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ drawPoints()

void QPdfBaseEngine::drawPoints ( const QPointF points,
int  pointCount 
)
virtual

Draws the first pointCount points in the buffer points.

Reimplemented from QPaintEngine.

Definition at line 949 of file qpdf.cpp.

950 {
951  if (!points)
952  return;
953 
955  QPainterPath p;
956  for (int i=0; i!=pointCount;++i) {
957  p.moveTo(points[i]);
958  p.lineTo(points[i] + QPointF(0, 0.001));
959  }
960 
961  bool hadBrush = d->hasBrush;
962  d->hasBrush = false;
963  drawPath(p);
964  d->hasBrush = hadBrush;
965 }
double d
Definition: qnumeric_p.h:62
void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
Definition: qpdf.cpp:1061
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.

◆ drawPolygon()

void QPdfBaseEngine::drawPolygon ( const QPointF points,
int  pointCount,
PolygonDrawMode  mode 
)
virtual

Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note
At least one of the drawPolygon() functions must be reimplemented.

Reimplemented from QAlphaPaintEngine.

Definition at line 1019 of file qpdf.cpp.

1020 {
1022 
1023  if (d->useAlphaEngine) {
1024  QAlphaPaintEngine::drawPolygon(points, pointCount, mode);
1025  if (!continueCall())
1026  return;
1027  }
1028 
1029  if (!points || !pointCount)
1030  return;
1031 
1032  bool hb = d->hasBrush;
1033  QPainterPath p;
1034 
1035  switch(mode) {
1036  case OddEvenMode:
1038  break;
1039  case ConvexMode:
1040  case WindingMode:
1042  break;
1043  case PolylineMode:
1044  d->hasBrush = false;
1045  break;
1046  default:
1047  break;
1048  }
1049 
1050  p.moveTo(points[0]);
1051  for (int i = 1; i < pointCount; ++i)
1052  p.lineTo(points[i]);
1053 
1054  if (mode != PolylineMode)
1055  p.closeSubpath();
1056  drawPath(p);
1057 
1058  d->hasBrush = hb;
1059 }
double d
Definition: qnumeric_p.h:62
void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
Definition: qpdf.cpp:1061
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
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 point...
#define Q_D(Class)
Definition: qglobal.h:2482
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
void setFillRule(Qt::FillRule fillRule)
Sets the fill rule of the painter path to the given fillRule.

◆ drawRects()

void QPdfBaseEngine::drawRects ( const QRectF rects,
int  rectCount 
)
virtual

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 984 of file qpdf.cpp.

Referenced by QPdfEngine::drawTiledPixmap().

985 {
986  if (!rects)
987  return;
988 
990  if (d->useAlphaEngine) {
991  QAlphaPaintEngine::drawRects(rects, rectCount);
992  if (!continueCall())
993  return;
994  }
995 
996  if (d->clipEnabled && d->allClipped)
997  return;
998  if (!d->hasPen && !d->hasBrush)
999  return;
1000 
1001  QBrush penBrush = d->pen.brush();
1002  if (d->simplePen || !d->hasPen) {
1003  // draw strokes natively in this case for better output
1004  if(!d->simplePen && !d->stroker.matrix.isIdentity())
1005  *d->currentPage << "q\n" << QPdf::generateMatrix(d->stroker.matrix);
1006  for (int i = 0; i < rectCount; ++i)
1007  *d->currentPage << rects[i].x() << rects[i].y() << rects[i].width() << rects[i].height() << "re\n";
1008  *d->currentPage << (d->hasPen ? (d->hasBrush ? "B\n" : "S\n") : "f\n");
1009  if(!d->simplePen && !d->stroker.matrix.isIdentity())
1010  *d->currentPage << "Q\n";
1011  } else {
1012  QPainterPath p;
1013  for (int i=0; i!=rectCount; ++i)
1014  p.addRect(rects[i]);
1015  drawPath(p);
1016  }
1017 }
double d
Definition: qnumeric_p.h:62
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
Definition: qpdf.cpp:1061
QByteArray generateMatrix(const QTransform &matrix)
Definition: qpdf.cpp:334
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
virtual void drawRects(const QRect *rects, int rectCount)
The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF an...
#define Q_D(Class)
Definition: qglobal.h:2482
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ drawTextItem()

void QPdfBaseEngine::drawTextItem ( const QPointF p,
const QTextItem textItem 
)
virtual

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 QAlphaPaintEngine.

Definition at line 1094 of file qpdf.cpp.

Referenced by QPdfEnginePrivate::height().

1095 {
1097 
1098  if (d->useAlphaEngine) {
1099  QAlphaPaintEngine::drawTextItem(p, textItem);
1100  if (!continueCall())
1101  return;
1102  }
1103 
1104  if (!d->hasPen || (d->clipEnabled && d->allClipped))
1105  return;
1106 
1107  if (d->stroker.matrix.type() >= QTransform::TxProject) {
1108  QPaintEngine::drawTextItem(p, textItem);
1109  return;
1110  }
1111 
1112  *d->currentPage << "q\n";
1113  if(!d->simplePen)
1114  *d->currentPage << QPdf::generateMatrix(d->stroker.matrix);
1115 
1116  bool hp = d->hasPen;
1117  d->hasPen = false;
1118  QBrush b = d->brush;
1119  d->brush = d->pen.brush();
1120  setBrush();
1121 
1122  const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
1124  d->drawTextItem(p, ti);
1125  d->hasPen = hp;
1126  d->brush = b;
1127  *d->currentPage << "Q\n";
1128 }
double d
Definition: qnumeric_p.h:62
QFontEngine * fontEngine
QByteArray generateMatrix(const QTransform &matrix)
Definition: qpdf.cpp:334
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_D(Class)
Definition: qglobal.h:2482
virtual Type type() const =0
Internal QTextItem.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.
virtual void setBrush()=0
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.

◆ end()

bool QPdfBaseEngine::end ( )
virtual

Reimplement this function to finish painting on the current paint device.

Return true if painting was finished successfully; otherwise return false.

See also
begin() isActive()

Reimplemented from QAlphaPaintEngine.

Reimplemented in QPdfEngine, and QPSPrintEngine.

Definition at line 1632 of file qpdf.cpp.

Referenced by QPSPrintEngine::end(), and QPdfEngine::end().

1633 {
1635  qDeleteAll(d->fonts);
1636  d->fonts.clear();
1637  delete d->currentPage;
1638  d->currentPage = 0;
1639 
1640  d->closePrintDevice();
1641  return true;
1642 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

◆ metric()

int QPdfBaseEngine::metric ( QPaintDevice::PaintDeviceMetric  id) const
virtual

Returns the metric for the given id.

Implements QPrintEngine.

Definition at line 1351 of file qpdf.cpp.

Referenced by QPSPrintEnginePrivate::emitHeader().

1352 {
1353  Q_D(const QPdfBaseEngine);
1354  int val;
1355  QRect r = d->fullPage ? d->paperRect() : d->pageRect();
1356  switch (metricType) {
1358  val = r.width();
1359  break;
1361  val = r.height();
1362  break;
1363  case QPaintDevice::PdmDpiX:
1364  case QPaintDevice::PdmDpiY:
1365  val = d->resolution;
1366  break;
1369  val = 1200;
1370  break;
1372  val = qRound(r.width()*25.4/d->resolution);
1373  break;
1375  val = qRound(r.height()*25.4/d->resolution);
1376  break;
1378  val = INT_MAX;
1379  break;
1381  val = 32;
1382  break;
1383  default:
1384  qWarning("QPrinter::metric: Invalid metric command");
1385  return 0;
1386  }
1387  return val;
1388 }
double d
Definition: qnumeric_p.h:62
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#define Q_D(Class)
Definition: qglobal.h:2482
Q_CORE_EXPORT void qWarning(const char *,...)
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
#define INT_MAX
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ newPage()

bool QPdfBaseEngine::newPage ( )
virtual

Instructs the print engine to start a new page.

Returns true if the printer was able to create the new page; otherwise returns false.

Implements QPrintEngine.

Reimplemented in QPdfEngine, and QPSPrintEngine.

Definition at line 1340 of file qpdf.cpp.

Referenced by QPSPrintEngine::newPage(), and QPdfEngine::newPage().

1341 {
1344  QFile *outfile = qobject_cast<QFile*> (d->outDevice);
1345  if (outfile && outfile->error() != QFile::NoError)
1346  return false;
1347  return true;
1348 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
double d
Definition: qnumeric_p.h:62
void setupGraphicsState(QPaintEngine::DirtyFlags flags)
Definition: qpdf.cpp:1193
#define Q_D(Class)
Definition: qglobal.h:2482
The QFile class provides an interface for reading from and writing to files.
Definition: qfile.h:65
FileError error() const
Returns the file error status.
Definition: qfile.cpp:1984

◆ property()

QVariant QPdfBaseEngine::property ( PrintEnginePropertyKey  key) const
virtual

Returns the print engine's property specified by key.

See also
setProperty()

Implements QPrintEngine.

Definition at line 1478 of file qpdf.cpp.

1479 {
1480  Q_D(const QPdfBaseEngine);
1481 
1482  QVariant ret;
1483  switch (int(key)) {
1484  case PPK_CollateCopies:
1485  ret = d->collate;
1486  break;
1487  case PPK_ColorMode:
1488  ret = d->colorMode;
1489  break;
1490  case PPK_Creator:
1491  ret = d->creator;
1492  break;
1493  case PPK_DocumentName:
1494  ret = d->title;
1495  break;
1496  case PPK_FullPage:
1497  ret = d->fullPage;
1498  break;
1499  case PPK_CopyCount:
1500  ret = d->copies;
1501  break;
1503 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
1505  ret = true;
1506  else
1507 #endif
1508  ret = false;
1509  break;
1510  case PPK_NumberOfCopies:
1511 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
1513  ret = 1;
1514  else
1515 #endif
1516  ret = d->copies;
1517  break;
1518  case PPK_Orientation:
1519  ret = d->orientation;
1520  break;
1521  case PPK_OutputFileName:
1522  ret = d->outputFileName;
1523  break;
1524  case PPK_PageOrder:
1525  ret = d->pageOrder;
1526  break;
1527  case PPK_PaperSize:
1528  ret = d->paperSize;
1529  break;
1530  case PPK_PaperSource:
1531  ret = d->paperSource;
1532  break;
1533  case PPK_PrinterName:
1534  ret = d->printerName;
1535  break;
1536  case PPK_PrinterProgram:
1537  ret = d->printProgram;
1538  break;
1539  case PPK_Resolution:
1540  ret = d->resolution;
1541  break;
1543  ret = QList<QVariant>() << 72;
1544  break;
1545  case PPK_PaperRect:
1546  ret = d->paperRect();
1547  break;
1548  case PPK_PageRect:
1549  ret = d->pageRect();
1550  break;
1551  case PPK_SelectionOption:
1552  ret = d->selectionOption;
1553  break;
1554  case PPK_FontEmbedding:
1555  ret = d->embedFonts;
1556  break;
1557  case PPK_Duplex:
1558  ret = d->duplex;
1559  break;
1560  case PPK_CupsPageRect:
1561  ret = d->cupsPageRect;
1562  break;
1563  case PPK_CupsPaperRect:
1564  ret = d->cupsPaperRect;
1565  break;
1566  case PPK_CupsOptions:
1567  ret = d->cupsOptions;
1568  break;
1570  ret = d->cupsStringPageSize;
1571  break;
1572  case PPK_CustomPaperSize:
1573  ret = d->customPaperSize;
1574  break;
1575  case PPK_PageMargins:
1576  {
1577  QList<QVariant> margins;
1578  if (d->hasCustomPageMargins) {
1579  margins << d->leftMargin << d->topMargin
1580  << d->rightMargin << d->bottomMargin;
1581  } else {
1582  const qreal defaultMargin = 10; // ~3.5 mm
1583  margins << defaultMargin << defaultMargin
1584  << defaultMargin << defaultMargin;
1585  }
1586  ret = margins;
1587  break;
1588  }
1589  default:
1590  break;
1591  }
1592  return ret;
1593 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
double d
Definition: qnumeric_p.h:62
double qreal
Definition: qglobal.h:1193
static bool isAvailable()
Definition: qcups.cpp:216
#define Q_D(Class)
Definition: qglobal.h:2482
#define PPK_CupsStringPageSize
Definition: qpdf_p.h:73
int key
#define PPK_CupsPaperRect
Definition: qpdf_p.h:72
#define PPK_CupsPageRect
Definition: qpdf_p.h:71
#define PPK_CupsOptions
Definition: qpdf_p.h:70

◆ setBrush()

virtual void QPdfBaseEngine::setBrush ( )
pure virtual

Implemented in QPdfEngine, and QPSPrintEngine.

Referenced by drawPath(), drawTextItem(), and setupGraphicsState().

◆ setPen()

void QPdfBaseEngine::setPen ( )

Definition at line 1284 of file qpdf.cpp.

Referenced by setupGraphicsState().

1285 {
1287  if (d->pen.style() == Qt::NoPen)
1288  return;
1289  QBrush b = d->pen.brush();
1290  Q_ASSERT(b.style() == Qt::SolidPattern && b.isOpaque());
1291 
1292  QColor rgba = b.color();
1293  if (d->colorMode == QPrinter::GrayScale) {
1294  qreal gray = qGray(rgba.rgba())/255.;
1295  *d->currentPage << gray << gray << gray;
1296  } else {
1297  *d->currentPage << rgba.redF()
1298  << rgba.greenF()
1299  << rgba.blueF();
1300  }
1301  *d->currentPage << "SCN\n";
1302 
1303  *d->currentPage << d->pen.widthF() << "w ";
1304 
1305  int pdfCapStyle = 0;
1306  switch(d->pen.capStyle()) {
1307  case Qt::FlatCap:
1308  pdfCapStyle = 0;
1309  break;
1310  case Qt::SquareCap:
1311  pdfCapStyle = 2;
1312  break;
1313  case Qt::RoundCap:
1314  pdfCapStyle = 1;
1315  break;
1316  default:
1317  break;
1318  }
1319  *d->currentPage << pdfCapStyle << "J ";
1320 
1321  int pdfJoinStyle = 0;
1322  switch(d->pen.joinStyle()) {
1323  case Qt::MiterJoin:
1324  pdfJoinStyle = 0;
1325  break;
1326  case Qt::BevelJoin:
1327  pdfJoinStyle = 2;
1328  break;
1329  case Qt::RoundJoin:
1330  pdfJoinStyle = 1;
1331  break;
1332  default:
1333  break;
1334  }
1335  *d->currentPage << pdfJoinStyle << "j ";
1336 
1337  *d->currentPage << QPdf::generateDashes(d->pen) << " 0 d\n";
1338 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
double d
Definition: qnumeric_p.h:62
double qreal
Definition: qglobal.h:1193
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
QByteArray generateDashes(const QPen &pen)
Definition: qpdf.cpp:348
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_D(Class)
Definition: qglobal.h:2482
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
bool isOpaque() const
Returns true if the brush is fully opaque otherwise false.
Definition: qbrush.cpp:910
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
Q_GUI_EXPORT_INLINE int qGray(int r, int g, int b)
Definition: qrgb.h:75

◆ setProperty()

void QPdfBaseEngine::setProperty ( PrintEnginePropertyKey  key,
const QVariant value 
)
virtual

Sets the print engine's property specified by key to the given value.

See also
property()

Implements QPrintEngine.

Definition at line 1390 of file qpdf.cpp.

1391 {
1393  switch (int(key)) {
1394  case PPK_CollateCopies:
1395  d->collate = value.toBool();
1396  break;
1397  case PPK_ColorMode:
1398  d->colorMode = QPrinter::ColorMode(value.toInt());
1399  break;
1400  case PPK_Creator:
1401  d->creator = value.toString();
1402  break;
1403  case PPK_DocumentName:
1404  d->title = value.toString();
1405  break;
1406  case PPK_FullPage:
1407  d->fullPage = value.toBool();
1408  break;
1409  case PPK_CopyCount: // fallthrough
1410  case PPK_NumberOfCopies:
1411  d->copies = value.toInt();
1412  break;
1413  case PPK_Orientation:
1414  d->orientation = QPrinter::Orientation(value.toInt());
1415  break;
1416  case PPK_OutputFileName:
1417  d->outputFileName = value.toString();
1418  break;
1419  case PPK_PageOrder:
1420  d->pageOrder = QPrinter::PageOrder(value.toInt());
1421  break;
1422  case PPK_PaperSize:
1423  d->paperSize = QPrinter::PaperSize(value.toInt());
1424  break;
1425  case PPK_PaperSource:
1426  d->paperSource = QPrinter::PaperSource(value.toInt());
1427  break;
1428  case PPK_PrinterName:
1429  d->printerName = value.toString();
1430  break;
1431  case PPK_PrinterProgram:
1432  d->printProgram = value.toString();
1433  break;
1434  case PPK_Resolution:
1435  d->resolution = value.toInt();
1436  break;
1437  case PPK_SelectionOption:
1438  d->selectionOption = value.toString();
1439  break;
1440  case PPK_FontEmbedding:
1441  d->embedFonts = value.toBool();
1442  break;
1443  case PPK_Duplex:
1444  d->duplex = static_cast<QPrinter::DuplexMode> (value.toInt());
1445  break;
1446  case PPK_CupsPageRect:
1447  d->cupsPageRect = value.toRect();
1448  break;
1449  case PPK_CupsPaperRect:
1450  d->cupsPaperRect = value.toRect();
1451  break;
1452  case PPK_CupsOptions:
1453  d->cupsOptions = value.toStringList();
1454  break;
1456  d->cupsStringPageSize = value.toString();
1457  break;
1458  case PPK_CustomPaperSize:
1459  d->paperSize = QPrinter::Custom;
1460  d->customPaperSize = value.toSizeF();
1461  break;
1462  case PPK_PageMargins:
1463  {
1464  QList<QVariant> margins(value.toList());
1465  Q_ASSERT(margins.size() == 4);
1466  d->leftMargin = margins.at(0).toReal();
1467  d->topMargin = margins.at(1).toReal();
1468  d->rightMargin = margins.at(2).toReal();
1469  d->bottomMargin = margins.at(3).toReal();
1470  d->hasCustomPageMargins = true;
1471  break;
1472  }
1473  default:
1474  break;
1475  }
1476 }
double d
Definition: qnumeric_p.h:62
Orientation
This enum type (not to be confused with Orientation) is used to specify each page&#39;s orientation...
Definition: qprinter.h:78
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
Definition: qvariant.cpp:2751
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
Definition: qvariant.cpp:2691
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_D(Class)
Definition: qglobal.h:2482
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
Definition: qvariant.cpp:2259
DuplexMode
This enum is used to indicate whether printing will occur on one or both sides of each sheet of paper...
Definition: qprinter.h:139
QSizeF toSizeF() const
Returns the variant as a QSizeF if the variant has type() SizeF ; otherwise returns an invalid QSizeF...
Definition: qvariant.cpp:2447
#define PPK_CupsStringPageSize
Definition: qpdf_p.h:73
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
Definition: qvariant.cpp:2416
PaperSize
This enum type specifies what paper size QPrinter should use.
Definition: qprinter.h:91
int key
ColorMode
This enum type is used to indicate whether QPrinter should print in color or not. ...
Definition: qprinter.h:100
PageOrder
This enum type is used by QPrinter to tell the application program how to print.
Definition: qprinter.h:97
#define PPK_CupsPaperRect
Definition: qpdf_p.h:72
#define PPK_CupsPageRect
Definition: qpdf_p.h:71
#define PPK_CupsOptions
Definition: qpdf_p.h:70
PaperSource
This enum type specifies what paper source QPrinter is to use.
Definition: qprinter.h:103

◆ setupGraphicsState()

void QPdfBaseEngine::setupGraphicsState ( QPaintEngine::DirtyFlags  flags)

Definition at line 1193 of file qpdf.cpp.

Referenced by newPage(), and updateState().

1194 {
1196  if (flags & DirtyClipPath)
1198 
1199  if (flags & DirtyTransform) {
1200  *d->currentPage << "Q\n";
1201  flags |= DirtyPen|DirtyBrush;
1202  }
1203 
1204  if (flags & DirtyClipPath) {
1205  *d->currentPage << "Q q\n";
1206 
1207  d->allClipped = false;
1208  if (d->clipEnabled && !d->clips.isEmpty()) {
1209  for (int i = 0; i < d->clips.size(); ++i) {
1210  if (d->clips.at(i).isEmpty()) {
1211  d->allClipped = true;
1212  break;
1213  }
1214  }
1215  if (!d->allClipped) {
1216  for (int i = 0; i < d->clips.size(); ++i) {
1217  *d->currentPage << QPdf::generatePath(d->clips.at(i), QTransform(), QPdf::ClipPath);
1218  }
1219  }
1220  }
1221  }
1222 
1223  if (flags & DirtyTransform) {
1224  *d->currentPage << "q\n";
1225  if (d->simplePen && !d->stroker.matrix.isIdentity())
1226  *d->currentPage << QPdf::generateMatrix(d->stroker.matrix);
1227  }
1228  if (flags & DirtyBrush)
1229  setBrush();
1230  if (d->simplePen && (flags & DirtyPen))
1231  setPen();
1232 }
double d
Definition: qnumeric_p.h:62
QByteArray generateMatrix(const QTransform &matrix)
Definition: qpdf.cpp:334
#define Q_D(Class)
Definition: qglobal.h:2482
void setPen()
Definition: qpdf.cpp:1284
QByteArray generatePath(const QPainterPath &path, const QTransform &matrix, PathFlags flags)
Definition: qpdf.cpp:272
virtual void setBrush()=0
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ updateClipPath()

void QPdfBaseEngine::updateClipPath ( const QPainterPath path,
Qt::ClipOperation  op 
)
private

Definition at line 1236 of file qpdf.cpp.

Referenced by updateState().

1237 {
1239  QPainterPath path = d->stroker.matrix.map(p);
1240  //qDebug() << "updateClipPath: " << d->stroker.matrix << p.boundingRect() << path.boundingRect() << op;
1241 
1242  if (op == Qt::NoClip) {
1243  d->clipEnabled = false;
1244  d->clips.clear();
1245  } else if (op == Qt::ReplaceClip) {
1246  d->clips.clear();
1247  d->clips.append(path);
1248  } else if (op == Qt::IntersectClip) {
1249  d->clips.append(path);
1250  } else { // UniteClip
1251  // ask the painter for the current clipping path. that's the easiest solution
1252  path = painter()->clipPath();
1253  path = d->stroker.matrix.map(path);
1254  d->clips.clear();
1255  d->clips.append(path);
1256  }
1257 
1258  if (d->useAlphaEngine) {
1259  // if we have an alpha region, we have to subtract that from the
1260  // any existing clip region since that region will be filled in
1261  // later with images
1263  if (!alphaClip.isEmpty()) {
1264  if (!d->clipEnabled) {
1265  QRect r = d->fullPage ? d->paperRect() : d->pageRect();
1266  QPainterPath dev;
1267  dev.addRect(QRect(0, 0, r.width(), r.height()));
1268  if (path.isEmpty())
1269  path = dev;
1270  else
1271  path = path.intersected(dev);
1272  d->clipEnabled = true;
1273  } else {
1274  path = painter()->clipPath();
1275  path = d->stroker.matrix.map(path);
1276  }
1277  path = path.subtracted(alphaClip);
1278  d->clips.clear();
1279  d->clips.append(path);
1280  }
1281  }
1282 }
QPainterPath clipPath() const
Returns the currently clip as a path.
Definition: qpainter.cpp:2690
double d
Definition: qnumeric_p.h:62
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
Definition: qpainterpath.h:392
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
QPainterPath subtracted(const QPainterPath &r) const
Returns a path which is p&#39;s fill area subtracted from this path&#39;s fill area.
QPainterPath intersected(const QPainterPath &r) const
Returns a path which is the intersection of this path&#39;s fill area and p&#39;s fill area.
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#define Q_D(Class)
Definition: qglobal.h:2482
QPainter * painter() const
Returns the paint engine&#39;s painter.
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion &region)
Definition: qregion.cpp:1160
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QRegion alphaClipping() const

◆ updateState()

void QPdfBaseEngine::updateState ( const QPaintEngineState state)
virtual

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 GetFunction{get function} to retrieve the current values for the given properties.

See also
QPaintEngineState

Reimplemented from QAlphaPaintEngine.

Definition at line 1131 of file qpdf.cpp.

1132 {
1134 
1135  if (d->useAlphaEngine) {
1137  if (!continueCall())
1138  return;
1139  }
1140 
1141  QPaintEngine::DirtyFlags flags = state.state();
1142 
1143  if (flags & DirtyTransform)
1144  d->stroker.matrix = state.transform();
1145 
1146  if (flags & DirtyPen) {
1147  d->pen = state.pen();
1148  d->hasPen = d->pen.style() != Qt::NoPen;
1149  d->stroker.setPen(d->pen);
1150  QBrush penBrush = d->pen.brush();
1151  bool oldSimple = d->simplePen;
1152  d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque());
1153  if (oldSimple != d->simplePen)
1154  flags |= DirtyTransform;
1155  }
1156  if (flags & DirtyBrush) {
1157  d->brush = state.brush();
1158  if (d->brush.color().alpha() == 0 && d->brush.style() == Qt::SolidPattern)
1159  d->brush.setStyle(Qt::NoBrush);
1160  d->hasBrush = d->brush.style() != Qt::NoBrush;
1161  }
1162  if (flags & DirtyBrushOrigin) {
1163  d->brushOrigin = state.brushOrigin();
1164  flags |= DirtyBrush;
1165  }
1166  if (flags & DirtyOpacity)
1167  d->opacity = state.opacity();
1168 
1169  bool ce = d->clipEnabled;
1170  if (flags & DirtyClipPath) {
1171  d->clipEnabled = true;
1172  updateClipPath(state.clipPath(), state.clipOperation());
1173  } else if (flags & DirtyClipRegion) {
1174  d->clipEnabled = true;
1175  QPainterPath path;
1176  QVector<QRect> rects = state.clipRegion().rects();
1177  for (int i = 0; i < rects.size(); ++i)
1178  path.addRect(rects.at(i));
1179  updateClipPath(path, state.clipOperation());
1180  flags |= DirtyClipPath;
1181  } else if (flags & DirtyClipEnabled) {
1182  d->clipEnabled = state.isClipEnabled();
1183  }
1184 
1185  if (ce != d->clipEnabled)
1186  flags |= DirtyClipPath;
1187  else if (!d->clipEnabled)
1188  flags &= ~DirtyClipPath;
1189 
1190  setupGraphicsState(flags);
1191 }
double d
Definition: qnumeric_p.h:62
QPaintEngine::DirtyFlags state() const
Returns a combination of flags identifying the set of properties that need to be updated when updatin...
Definition: qpaintengine.h:292
qreal opacity() const
Returns the opacity in the current paint engine state.
Definition: qpainter.cpp:9529
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
void setupGraphicsState(QPaintEngine::DirtyFlags flags)
Definition: qpdf.cpp:1193
QTransform transform() const
Returns the matrix in the current paint engine state.
Definition: qpainter.cpp:9377
bool isClipEnabled() const
Returns whether clipping is enabled or not in the current paint engine state.
Definition: qpainter.cpp:9473
#define Q_D(Class)
Definition: qglobal.h:2482
QBrush brush() const
Returns the brush in the current paint engine state.
Definition: qpainter.cpp:9273
Qt::ClipOperation clipOperation() const
Returns the clip operation in the current paint engine state.
Definition: qpainter.cpp:9396
QPointF brushOrigin() const
Returns the brush origin in the current paint engine state.
Definition: qpainter.cpp:9287
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
QPainterPath clipPath() const
Returns the clip path in the current paint engine state.
Definition: qpainter.cpp:9457
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
bool isOpaque() const
Returns true if the brush is fully opaque otherwise false.
Definition: qbrush.cpp:910
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
QRegion clipRegion() const
Returns the clip region in the current paint engine state.
Definition: qpainter.cpp:9443
QPen pen() const
Returns the pen in the current paint engine state.
Definition: qpainter.cpp:9259
virtual void updateState(const QPaintEngineState &state)
Reimplement this function to update the state of a paint engine.
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
void updateClipPath(const QPainterPath &path, Qt::ClipOperation op)
Definition: qpdf.cpp:1236

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