4#include <private/qpaintengine_preview_p.h>
5#include <private/qpainter_p.h>
6#include <private/qpaintengine_p.h>
7#include <private/qpicture_p.h>
9#include <QtPrintSupport/qprintengine.h>
10#include <QtGui/qpainter.h>
11#include <QtGui/qpicture.h>
36 d->proxy_print_engine =
nullptr;
37 d->proxy_paint_engine =
nullptr;
55 page->d_func()->in_memory_only =
true;
57 d->engine =
d->painter->paintEngine();
58 *
d->painter->d_func()->state = *
painter()->d_func()->state;
59 d->pages.append(
page);
78 d->engine->updateState(
state);
84 d->engine->drawPath(
path);
96 d->engine->drawTextItem(
p, textItem);
102 d->engine->drawPixmap(
r, pm, sr);
108 d->engine->drawTiledPixmap(
r, pm,
p);
116 page->d_func()->in_memory_only =
true;
122 *tmp_painter->d_func()->state = *
painter()->d_func()->state;
130 d->painter = tmp_painter;
131 d->pages.append(
page);
132 d->engine = tmp_engine;
155 d->proxy_print_engine = printEngine;
156 d->proxy_paint_engine = paintEngine;
162 d->proxy_print_engine->setProperty(
key,
value);
168 return d->proxy_print_engine->property(
key);
174 return d->proxy_print_engine->metric(
id);
The QPaintEngineState class provides information about the active paint engine's current state....
PolygonDrawMode
\value OddEvenMode The polygon should be drawn using OddEven fill rule.
QPainter * painter() const
Returns the paint engine's painter.
void setDirty(DirtyFlags df)
QPaintEngineState * state
The QPainter class performs low-level painting on widgets and other paint devices.
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
The QPicture class is a paint device that records and replays QPainter commands.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
QPrintEngine * proxy_print_engine
QPreviewPaintEnginePrivate()
~QPreviewPaintEnginePrivate()
QPaintEngine * proxy_paint_engine
QList< const QPicture * > pages
QPrinter::PrinterState state
void drawPath(const QPainterPath &path) override
The default implementation ignores the path and does nothing.
void setProxyEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine)
bool begin(QPaintDevice *dev) override
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
QList< const QPicture * > pages()
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 point...
bool abort() override
Instructs the print engine to abort the printing process.
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
This function draws the text item textItem at position p.
bool end() override
Reimplement this function to finish painting on the current paint device.
QVariant property(PrintEnginePropertyKey key) const override
Returns the print engine's property specified by key.
void updateState(const QPaintEngineState &state) override
Reimplement this function to update the state of a paint engine.
QPrinter::PrinterState printerState() const override
Returns the current state of the printer being used by the print engine.
int metric(QPaintDevice::PaintDeviceMetric) const override
Returns the metric for the given id.
bool newPage() override
Instructs the print engine to start a new page.
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 drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &p) override
Reimplement this function to draw the pixmap in the given rect, starting at the given p.
void setProperty(PrintEnginePropertyKey key, const QVariant &value) override
Sets the print engine's property specified by key to the given value.
PrintEnginePropertyKey
This enum is used to communicate properties between the print engine and QPrinter.
PrinterState
\value Idle \value Active \value Aborted \value Error
\inmodule QtCore\reentrant
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLfixed GLfixed GLint GLint GLfixed points
GLsizei const GLchar *const * path