42 #include <private/qpaintengine_preview_p.h> 43 #include <private/qpainter_p.h> 44 #include <private/qpaintengine_p.h> 45 #include <private/qpicture_p.h> 47 #include <QtGui/qprintengine.h> 48 #include <QtGui/qpainter.h> 49 #include <QtGui/qpicture.h> 51 #ifndef QT_NO_PRINTPREVIEWWIDGET 75 d->proxy_print_engine = 0;
76 d->proxy_paint_engine = 0;
94 page->d_func()->in_memory_only =
true;
96 d->engine =
d->painter->paintEngine();
97 d->pages.append(page);
116 d->engine->updateState(state);
122 d->engine->drawPath(path);
128 d->engine->drawPolygon(points, pointCount, mode);
134 d->engine->drawTextItem(p, textItem);
140 d->engine->drawPixmap(r, pm, sr);
146 d->engine->drawTiledPixmap(r, pm, p);
154 page->d_func()->in_memory_only =
true;
160 *tmp_painter->d_func()->state = *
painter()->d_func()->state;
168 d->painter = tmp_painter;
169 d->pages.append(page);
170 d->engine = tmp_engine;
193 d->proxy_print_engine = printEngine;
194 d->proxy_paint_engine = paintEngine;
200 d->proxy_print_engine->setProperty(key, value);
206 return d->proxy_print_engine->property(key);
212 return d->proxy_print_engine->metric(
id);
The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
QList< const QPicture * > pages()
bool abort()
Instructs the print engine to abort the printing process.
QPaintEngine * proxy_paint_engine
#define QT_END_NAMESPACE
This macro expands to.
void syncState()
Updates all dirty states in this engine.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
QPaintEngineState * state
The QPointF class defines a point in the plane using floating point precision.
void setProxyEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine)
~QPreviewPaintEnginePrivate()
bool begin(QPaintDevice *dev)
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &p)
Reimplement this function to draw the pixmap in the given rect, starting at the given p...
QList< const QPicture * > pages
QPrinter::PrinterState state
void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
QPreviewPaintEnginePrivate()
QPainter * painter() const
Returns the paint engine's painter.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
void setProperty(PrintEnginePropertyKey key, const QVariant &value)
Sets the print engine's property specified by key to the given value.
void updateState(const QPaintEngineState &state)
Reimplement this function to update the state of a paint engine.
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...
The QPrintEngine class defines an interface for how QPrinter interacts with a given printing subsyste...
bool newPage()
Instructs the print engine to start a new page.
The QPrinter class is a paint device that paints on a printer.
QPrinter::PrinterState printerState() const
Returns the current state of the printer being used by the print engine.
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
void setDirty(DirtyFlags df)
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
bool end()
Reimplement this function to finish painting on the current paint device.
int metric(QPaintDevice::PaintDeviceMetric) const
Returns the metric for the given id.
#define Q_DECLARE_PUBLIC(Class)
QVariant property(PrintEnginePropertyKey key) const
Returns the print engine's property specified by key.
void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.
QPrintEngine * proxy_print_engine
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QPaintEngineState class provides information about the active paint engine's current state...
The QTextItem class provides all the information required to draw text in a custom paint engine...
The QPicture class is a paint device that records and replays QPainter commands.
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
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...
The QList class is a template class that provides lists.
PrintEnginePropertyKey
This enum is used to communicate properties between the print engine and QPrinter.