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
qpaintengine_preview_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPAINTENGINE_PREVIEW_P_H
5#define QPAINTENGINE_PREVIEW_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of QPreviewPrinter and friends. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17//
18
19#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
20#include <QtGui/qpaintengine.h>
21#include <QtPrintSupport/qprintengine.h>
22
23QT_REQUIRE_CONFIG(printpreviewwidget);
24
26
28
30{
31 Q_DECLARE_PRIVATE(QPreviewPaintEngine)
32public:
35
36 bool begin(QPaintDevice *dev) override;
37 bool end() override;
38
39 void updateState(const QPaintEngineState &state) override;
40
41 void drawPath(const QPainterPath &path) override;
42 void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
43 void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
44
45 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
46 void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &p) override;
47
48 QList<const QPicture *> pages();
49
50 QPaintEngine::Type type() const override { return Picture; }
51
52 void setProxyEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
53
56
57 bool newPage() override;
58 bool abort() override;
59
60 int metric(QPaintDevice::PaintDeviceMetric) const override;
61
62 QPrinter::PrinterState printerState() const override;
63};
64
66
67#endif
The QPaintEngineState class provides information about the active paint engine's current state....
\inmodule QtGui
PolygonDrawMode
\value OddEvenMode The polygon should be drawn using OddEven fill rule.
QPaintEngineState * state
Type
\value X11 \value Windows \value MacPrinter \value CoreGraphics \macos's Quartz2D (CoreGraphics) \val...
\inmodule QtGui
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:217
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.
QPaintEngine::Type type() const override
Reimplement this function to return the paint engine \l{Type}.
bool end() override
Reimplement this function to finish painting on the current paint device.
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.
\reentrant
PrintEnginePropertyKey
This enum is used to communicate properties between the print engine and QPrinter.
PrinterState
\value Idle \value Active \value Aborted \value Error
Definition qprinter.h:64
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtGui
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum mode
GLuint64 key
GLboolean r
[2]
GLfixed GLfixed GLint GLint GLfixed points
GLsizei const GLchar *const * path
GLfloat GLfloat p
[1]
#define QT_REQUIRE_CONFIG(feature)
const char property[13]
Definition qwizard.cpp:101
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)