kernel/qpaintengine_preview.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6class QPreviewPaintEnginePrivate : public QPaintEnginePrivate -
7{ -
8 inline QPreviewPaintEngine* q_func() { return static_cast<QPreviewPaintEngine *>(q_ptr); } inline const QPreviewPaintEngine* q_func() const { return static_cast<const QPreviewPaintEngine *>(q_ptr); } friend class QPreviewPaintEngine; -
9public: -
10 QPreviewPaintEnginePrivate() : state(QPrinter::Idle) {}
never executed: }
0
11 ~QPreviewPaintEnginePrivate() {} -
12 -
13 QList<const QPicture *> pages; -
14 QPaintEngine *engine; -
15 QPainter *painter; -
16 QPrinter::PrinterState state; -
17 -
18 QPaintEngine *proxy_paint_engine; -
19 QPrintEngine *proxy_print_engine; -
20}; -
21 -
22 -
23QPreviewPaintEngine::QPreviewPaintEngine() -
24 : QPaintEngine(*(new QPreviewPaintEnginePrivate), PaintEngineFeatures(AllFeatures & ~ObjectBoundingModeGradients)) -
25{ -
26 QPreviewPaintEnginePrivate * const d = d_func(); -
27 d->proxy_print_engine = 0; -
28 d->proxy_paint_engine = 0; -
29}
never executed: }
0
30 -
31QPreviewPaintEngine::~QPreviewPaintEngine() -
32{ -
33 QPreviewPaintEnginePrivate * const d = d_func(); -
34 -
35 qDeleteAll(d->pages); -
36}
never executed: }
0
37 -
38bool QPreviewPaintEngine::begin(QPaintDevice *) -
39{ -
40 QPreviewPaintEnginePrivate * const d = d_func(); -
41 -
42 qDeleteAll(d->pages); -
43 d->pages.clear(); -
44 -
45 QPicture *page = new QPicture; -
46 page->d_func()->in_memory_only = true; -
47 d->painter = new QPainter(page); -
48 d->engine = d->painter->paintEngine(); -
49 d->pages.append(page); -
50 d->state = QPrinter::Active; -
51 return true;
never executed: return true;
0
52} -
53 -
54bool QPreviewPaintEngine::end() -
55{ -
56 QPreviewPaintEnginePrivate * const d = d_func(); -
57 -
58 delete d->painter; -
59 d->painter = 0; -
60 d->engine = 0; -
61 d->state = QPrinter::Idle; -
62 return true;
never executed: return true;
0
63} -
64 -
65void QPreviewPaintEngine::updateState(const QPaintEngineState &state) -
66{ -
67 QPreviewPaintEnginePrivate * const d = d_func(); -
68 d->engine->updateState(state); -
69}
never executed: }
0
70 -
71void QPreviewPaintEngine::drawPath(const QPainterPath &path) -
72{ -
73 QPreviewPaintEnginePrivate * const d = d_func(); -
74 d->engine->drawPath(path); -
75}
never executed: }
0
76 -
77void QPreviewPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) -
78{ -
79 QPreviewPaintEnginePrivate * const d = d_func(); -
80 d->engine->drawPolygon(points, pointCount, mode); -
81}
never executed: }
0
82 -
83void QPreviewPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) -
84{ -
85 QPreviewPaintEnginePrivate * const d = d_func(); -
86 d->engine->drawTextItem(p, textItem); -
87}
never executed: }
0
88 -
89void QPreviewPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) -
90{ -
91 QPreviewPaintEnginePrivate * const d = d_func(); -
92 d->engine->drawPixmap(r, pm, sr); -
93}
never executed: }
0
94 -
95void QPreviewPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &p) -
96{ -
97 QPreviewPaintEnginePrivate * const d = d_func(); -
98 d->engine->drawTiledPixmap(r, pm, p); -
99}
never executed: }
0
100 -
101bool QPreviewPaintEngine::newPage() -
102{ -
103 QPreviewPaintEnginePrivate * const d = d_func(); -
104 -
105 QPicture *page = new QPicture; -
106 page->d_func()->in_memory_only = true; -
107 QPainter *tmp_painter = new QPainter(page); -
108 QPaintEngine *tmp_engine = tmp_painter->paintEngine(); -
109 -
110 -
111 qt_noop(); -
112 *tmp_painter->d_func()->state = *painter()->d_func()->state; -
113 -
114 -
115 -
116 tmp_engine->setDirty(DirtyFlags(AllDirty & ~DirtyCompositionMode)); -
117 tmp_engine->syncState(); -
118 -
119 delete d->painter; -
120 d->painter = tmp_painter; -
121 d->pages.append(page); -
122 d->engine = tmp_engine; -
123 return true;
never executed: return true;
0
124} -
125 -
126bool QPreviewPaintEngine::abort() -
127{ -
128 QPreviewPaintEnginePrivate * const d = d_func(); -
129 end(); -
130 qDeleteAll(d->pages); -
131 d->state = QPrinter::Aborted; -
132 -
133 return true;
never executed: return true;
0
134} -
135 -
136QList<const QPicture *> QPreviewPaintEngine::pages() -
137{ -
138 QPreviewPaintEnginePrivate * const d = d_func(); -
139 return d->pages;
never executed: return d->pages;
0
140} -
141 -
142void QPreviewPaintEngine::setProxyEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine) -
143{ -
144 QPreviewPaintEnginePrivate * const d = d_func(); -
145 d->proxy_print_engine = printEngine; -
146 d->proxy_paint_engine = paintEngine; -
147}
never executed: }
0
148 -
149void QPreviewPaintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &value) -
150{ -
151 QPreviewPaintEnginePrivate * const d = d_func(); -
152 d->proxy_print_engine->setProperty(key, value); -
153}
never executed: }
0
154 -
155QVariant QPreviewPaintEngine::property(PrintEnginePropertyKey key) const -
156{ -
157 const QPreviewPaintEnginePrivate * const d = d_func(); -
158 return d->proxy_print_engine->property(key);
never executed: return d->proxy_print_engine->property(key);
0
159} -
160 -
161int QPreviewPaintEngine::metric(QPaintDevice::PaintDeviceMetric id) const -
162{ -
163 const QPreviewPaintEnginePrivate * const d = d_func(); -
164 return d->proxy_print_engine->metric(id);
never executed: return d->proxy_print_engine->metric(id);
0
165} -
166 -
167QPrinter::PrinterState QPreviewPaintEngine::printerState() const -
168{ -
169 const QPreviewPaintEnginePrivate * const d = d_func(); -
170 return d->state;
never executed: return d->state;
0
171} -
172 -
173 -
174 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial