Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qprintpreviewwidget.cpp
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
5#include "private/qwidget_p.h"
6#include <private/qprinter_p.h>
7
8#include <QtCore/qmath.h>
9#include <QtWidgets/qboxlayout.h>
10#include <QtWidgets/qgraphicsitem.h>
11#include <QtWidgets/qgraphicsview.h>
12#include <QtWidgets/qscrollbar.h>
13#include <QtWidgets/qstyleoption.h>
14
16
17namespace QtPrivate {
18class PageItem : public QGraphicsItem
19{
20public:
21 PageItem(int _pageNum, const QPicture* _pagePicture, QSize _paperSize, QRect _pageRect)
22 : pageNum(_pageNum), pagePicture(_pagePicture),
23 paperSize(_paperSize), pageRect(_pageRect)
24 {
25 qreal border = qMax(paperSize.height(), paperSize.width()) / 25;
26 brect = QRectF(QPointF(-border, -border),
27 QSizeF(paperSize)+QSizeF(2*border, 2*border));
29 }
30
31 QRectF boundingRect() const override
32 { return brect; }
33
34 inline int pageNumber() const
35 { return pageNum; }
36
38
39private:
40 int pageNum;
41 const QPicture* pagePicture;
42 QSize paperSize;
43 QRect pageRect;
44 QRectF brect;
45};
46
48{
50
51#if 0
52 // Draw item bounding rect, for debugging
53 painter->save();
58#endif
59
60 QRectF paperRect(0,0, paperSize.width(), paperSize.height());
61
62 // Draw shadow
63 painter->setClipRect(option->exposedRect);
64 qreal shWidth = paperRect.width()/100;
65 QRectF rshadow(paperRect.topRight() + QPointF(0, shWidth),
66 paperRect.bottomRight() + QPointF(shWidth, 0));
67 QLinearGradient rgrad(rshadow.topLeft(), rshadow.topRight());
68 rgrad.setColorAt(0.0, QColor(0,0,0,255));
69 rgrad.setColorAt(1.0, QColor(0,0,0,0));
70 painter->fillRect(rshadow, QBrush(rgrad));
71 QRectF bshadow(paperRect.bottomLeft() + QPointF(shWidth, 0),
72 paperRect.bottomRight() + QPointF(0, shWidth));
73 QLinearGradient bgrad(bshadow.topLeft(), bshadow.bottomLeft());
74 bgrad.setColorAt(0.0, QColor(0,0,0,255));
75 bgrad.setColorAt(1.0, QColor(0,0,0,0));
76 painter->fillRect(bshadow, QBrush(bgrad));
77 QRectF cshadow(paperRect.bottomRight(),
78 paperRect.bottomRight() + QPointF(shWidth, shWidth));
79 QRadialGradient cgrad(cshadow.topLeft(), shWidth, cshadow.topLeft());
80 cgrad.setColorAt(0.0, QColor(0,0,0,255));
81 cgrad.setColorAt(1.0, QColor(0,0,0,0));
82 painter->fillRect(cshadow, QBrush(cgrad));
83
84 painter->setClipRect(paperRect & option->exposedRect);
85 painter->fillRect(paperRect, Qt::white);
86 if (!pagePicture)
87 return;
88 painter->drawPicture(pageRect.topLeft(), *pagePicture);
89
90 // Effect: make anything drawn in the margins look washed out.
92 path.addRect(paperRect);
93 path.addRect(pageRect);
95 painter->setBrush(QColor(255, 255, 255, 180));
97
98#if 0
99 // Draw frame around paper.
102 painter->drawRect(paperRect);
103#endif
104
105 // todo: drawtext "Page N" below paper
106}
107
109{
111public:
114 {
115#ifdef Q_OS_MAC
117#endif
118 }
119signals:
120 void resized();
121
122protected:
123 void resizeEvent(QResizeEvent* e) override
124 {
125 {
126 const QSignalBlocker blocker(verticalScrollBar()); // Don't change page, QTBUG-14517
128 }
129 emit resized();
130 }
131
132 void showEvent(QShowEvent* e) override
133 {
135 emit resized();
136 }
137};
138
139} // namespace QtPrivate
140
143
145{
146 Q_DECLARE_PUBLIC(QPrintPreviewWidget)
147public:
149 : scene(nullptr), curPage(1),
150 viewMode(QPrintPreviewWidget::SinglePageView),
151 zoomMode(QPrintPreviewWidget::FitInView),
153 {}
154
155 // private slots
156 void _q_fit(bool doFitting = false);
158
159 void init();
160 void populateScene();
161 void layoutPages();
162 void generatePreview();
163 void setCurrentPage(int pageNumber);
164 void zoom(qreal zoom);
166 int calcCurrentPage();
167
170
174
182};
183
185{
187
188 if (curPage < 1 || curPage > pages.size())
189 return;
190
191 if (!doFitting && !fitting)
192 return;
193
194 if (doFitting && fitting) {
195 QRect viewRect = graphicsView->viewport()->rect();
197 const QList<QGraphicsItem*> containedItems = graphicsView->items(viewRect, Qt::ContainsItemBoundingRect);
198 for (QGraphicsItem* item : containedItems) {
199 PageItem* pg = static_cast<PageItem*>(item);
200 if (pg->pageNumber() == curPage)
201 return;
202 }
203 }
204
205 int newPage = calcCurrentPage();
206 if (newPage != curPage)
207 curPage = newPage;
208 }
209
212 // fit two pages
213 if (curPage % 2)
214 target.setLeft(target.left() - target.width());
215 else
216 target.setRight(target.right() + target.width());
219 }
220
223 qreal scale = graphicsView->viewport()->width() / target.width();
224 t.scale(scale, scale);
226 if (doFitting && fitting) {
227 QRectF viewSceneRect = graphicsView->viewportTransform().mapRect(graphicsView->viewport()->rect());
228 viewSceneRect.moveTop(target.top());
229 graphicsView->ensureVisible(viewSceneRect); // Nah...
230 }
231 } else {
234 const int step = qRound(graphicsView->transform().mapRect(target).height());
235 graphicsView->verticalScrollBar()->setSingleStep(step);
236 graphicsView->verticalScrollBar()->setPageStep(step);
237 }
238 }
239
240 zoomFactor = graphicsView->transform().m11() * (float(printer->logicalDpiY()) / q->logicalDpiY());
241 emit q->previewChanged();
242}
243
245{
247
249 return;
250
251 int newPage = calcCurrentPage();
252 if (newPage != curPage) {
253 curPage = newPage;
254 emit q->previewChanged();
255 }
256}
257
259{
260 int maxArea = 0;
261 int newPage = curPage;
262 QRect viewRect = graphicsView->viewport()->rect();
264 for (auto *item : items) {
265 PageItem* pg = static_cast<PageItem*>(item);
266 QRect overlap = graphicsView->mapFromScene(pg->sceneBoundingRect()).boundingRect() & viewRect;
267 int area = overlap.width() * overlap.height();
268 if (area > maxArea) {
269 maxArea = area;
270 newPage = pg->pageNumber();
271 } else if (area == maxArea && pg->pageNumber() < newPage) {
272 newPage = pg->pageNumber();
273 }
274 }
275 return newPage;
276}
277
279{
281
286 QObject::connect(graphicsView->verticalScrollBar(), SIGNAL(valueChanged(int)),
289
293
295 layout->setContentsMargins(0, 0, 0, 0);
297}
298
300{
301 // remove old pages
302 for (auto *page : std::as_const(pages))
305 pages.clear();
306
309
310 int page = 1;
311 for (auto *picture : std::as_const(pictures)) {
312 PageItem* item = new PageItem(page++, picture, paperSize, pageRect);
315 }
316}
317
319{
320 int numPages = pages.size();
321 if (numPages < 1)
322 return;
323
324 int numPagePlaces = numPages;
325 int cols = 1; // singleMode and default
328 cols = qCeil(qSqrt((float) numPages));
329 else
330 cols = qFloor(qSqrt((float) numPages));
331 cols += cols % 2; // Nicer with an even number of cols
332 }
334 cols = 2;
335 numPagePlaces += 1;
336 }
337 int rows = qCeil(qreal(numPagePlaces) / cols);
338
339 qreal itemWidth = pages.at(0)->boundingRect().width();
340 qreal itemHeight = pages.at(0)->boundingRect().height();
341 int pageNum = 1;
342 for (int i = 0; i < rows && pageNum <= numPages; i++) {
343 for (int j = 0; j < cols && pageNum <= numPages; j++) {
345 // Front page doesn't have a facing page
346 continue;
347 } else {
348 pages.at(pageNum-1)->setPos(QPointF(j*itemWidth, i*itemHeight));
349 pageNum++;
350 }
351 }
352 }
354}
355
357{
358 //### If QPrinter::setPreviewMode() becomes public, handle the
359 //### case that we have been constructed with a printer that
360 //### _already_ has been preview-painted to, so we should
361 //### initially just show the pages it already contains, and not
362 //### emit paintRequested() until the user changes some parameter
363
365 printer->d_func()->setPreviewMode(true);
366 emit q->paintRequested(printer);
367 printer->d_func()->setPreviewMode(false);
368 pictures = printer->d_func()->previewPages();
369 populateScene(); // i.e. setPreviewPrintedPictures() e.l.
370 layoutPages();
371 curPage = pages.size() > 0 ? qBound(1, curPage, pages.size()) : 1;
372 if (fitting)
373 _q_fit();
374 emit q->previewChanged();
375}
376
378{
379 if (pageNumber < 1 || pageNumber > pages.size())
380 return;
381
382 int lastPage = curPage;
383 curPage = pageNumber;
384
385 if (lastPage != curPage && lastPage > 0 && lastPage <= pages.size()) {
387 QScrollBar *hsc = graphicsView->horizontalScrollBar();
388 QScrollBar *vsc = graphicsView->verticalScrollBar();
390 vsc->setValue(int(pt.y()) - 10);
391 hsc->setValue(int(pt.x()) - 10);
392 } else {
394 }
395 }
396}
397
399{
400 zoomFactor *= zoom;
402}
403
405{
407 zoomFactor = _zoomFactor;
409 int dpi_y = q->logicalDpiY();
410 int printer_dpi_y = printer->logicalDpiY();
411 graphicsView->scale(zoomFactor*(dpi_y/float(printer_dpi_y)),
412 zoomFactor*(dpi_y/float(printer_dpi_y)));
413}
414
416
492{
494 d->printer = printer;
495 d->ownPrinter = false;
496 d->init();
497}
498
508{
510 d->printer = new QPrinter;
511 d->ownPrinter = true;
512 d->init();
513}
514
515
520{
522 if (d->ownPrinter)
523 delete d->printer;
524}
525
530{
531 Q_D(const QPrintPreviewWidget);
532 return d->viewMode;
533}
534
540{
542 d->viewMode = mode;
543 d->layoutPages();
544 if (d->viewMode == AllPagesView) {
545 d->graphicsView->fitInView(d->scene->itemsBoundingRect(), Qt::KeepAspectRatio);
546 d->fitting = false;
548 d->zoomFactor = d->graphicsView->transform().m11() * (float(d->printer->logicalDpiY()) / logicalDpiY());
550 } else {
551 d->fitting = true;
552 d->_q_fit();
553 }
554}
555
561{
562 Q_D(const QPrintPreviewWidget);
563 return d->printer->pageLayout().orientation();
564}
565
571{
573 d->printer->setPageOrientation(orientation);
574 d->generatePreview();
575}
576
581{
583 // ### make use of the generated pages
584 emit paintRequested(d->printer);
585}
586
592{
594 d->fitting = false;
596 d->zoom(factor);
597}
598
604{
606 d->fitting = false;
608 d->zoom(1/factor);
609}
610
615{
616 Q_D(const QPrintPreviewWidget);
617 return d->zoomFactor;
618}
619
628{
630 d->fitting = false;
632 d->setZoomFactor(factor);
633}
634
640{
641 Q_D(const QPrintPreviewWidget);
642 return d->pages.size();
643}
644
649{
650 Q_D(const QPrintPreviewWidget);
651 return d->curPage;
652}
653
659{
661 d->setCurrentPage(page);
662}
663
669{
671}
672
678{
680}
681
688{
690 d->zoomMode = zoomMode;
691 if (d->zoomMode == FitInView || d->zoomMode == FitToWidth) {
692 d->fitting = true;
693 d->_q_fit(true);
694 } else {
695 d->fitting = false;
696 }
697}
698
705{
706 Q_D(const QPrintPreviewWidget);
707 return d->zoomMode;
708}
709
715{
717}
718
724{
726}
727
733{
735}
736
742{
744}
745
751{
753}
754
755
761{
763 d->initialized = true;
764 d->generatePreview();
765 d->graphicsView->updateGeometry();
766}
767
771{
773 if (visible && !d->initialized)
776}
777
795
796#include "moc_qprintpreviewwidget.cpp"
797#include "qprintpreviewwidget.moc"
\inmodule QtGui
Definition qbrush.h:30
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
@ NoFrame
Definition qframe.h:39
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
Definition qbrush.cpp:1563
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QPointF pos() const
Returns the position of the item in parent coordinates.
QRectF sceneBoundingRect() const
Returns the bounding rect of this item in scene coordinates, by combining sceneTransform() with bound...
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
void setPos(const QPointF &pos)
Sets the position of the item to pos, which is in parent coordinates.
void setCacheMode(CacheMode mode, const QSize &cacheSize=QSize())
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
void addItem(QGraphicsItem *item)
Adds or moves the item and all its children to this scene.
QRectF itemsBoundingRect() const
Calculates and returns the bounding rect of all items on the scene.
void setSceneRect(const QRectF &rect)
void setBackgroundBrush(const QBrush &brush)
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
void setInteractive(bool allowed)
QList< QGraphicsItem * > items() const
Returns a list of all the items in the associated scene, in descending stacking order (i....
void centerOn(const QPointF &pos)
Scrolls the contents of the viewport to ensure that the scene coordinate pos, is centered in the view...
void setTransform(const QTransform &matrix, bool combine=false)
Sets the view's current transformation matrix to matrix.
void setDragMode(DragMode mode)
QTransform transform() const
Returns the current transformation matrix for the view.
void resetTransform()
Resets the view transformation to the identity matrix.
void ensureVisible(const QRectF &rect, int xmargin=50, int ymargin=50)
Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specif...
void scale(qreal sx, qreal sy)
Scales the current view transformation by (sx, sy).
void fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRadioMode=Qt::IgnoreAspectRatio)
Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits insid...
QTransform viewportTransform() const
Returns a matrix that maps scene coordinates to viewport coordinates.
void resizeEvent(QResizeEvent *event) override
\reimp
void setScene(QGraphicsScene *scene)
Sets the current scene to scene.
void showEvent(QShowEvent *event) override
\reimp
QPoint mapFromScene(const QPointF &point) const
Returns the scene coordinate point to viewport coordinates.
void setViewportUpdateMode(ViewportUpdateMode mode)
void addWidget(QWidget *w)
Adds widget w to this layout in a manner specific to the layout.
Definition qlayout.cpp:186
void setContentsMargins(int left, int top, int right, int bottom)
Definition qlayout.cpp:288
\inmodule QtGui
Definition qbrush.h:394
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
void append(parameter_type t)
Definition qlist.h:441
void clear()
Definition qlist.h:417
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
Orientation orientation() const
Returns the page orientation of the page layout.
QRect paintRectPixels(int resolution) const
Returns the paintable rectangle in rounded device pixels for the given resolution.
Orientation
This enum type defines the page orientation.
Definition qpagelayout.h:33
QRect fullRectPixels(int resolution) const
Returns the full page rectangle in device pixels for the given resolution.
QPageLayout pageLayout() const
int logicalDpiY() const
\inmodule QtGui
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
Definition qpainter.h:519
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void restore()
Restores the current painter state (pops a saved state off the stack).
void save()
Saves the current painter state (pushes the state onto a stack).
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
void drawPicture(const QPointF &p, const QPicture &picture)
Replays the given picture at the given point.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
\inmodule QtGui
Definition qpen.h:25
The QPicture class is a paint device that records and replays QPainter commands.
Definition qpicture.h:19
\inmodule QtCore\reentrant
Definition qpoint.h:214
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:333
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:338
QPrintPreviewWidget::ZoomMode zoomMode
void _q_fit(bool doFitting=false)
QList< const QPicture * > pictures
void setZoomFactor(qreal zoomFactor)
QList< QGraphicsItem * > pages
QPrintPreviewWidget::ViewMode viewMode
void setCurrentPage(int pageNumber)
The QPrintPreviewWidget class provides a widget for previewing page layouts for printer output.
ViewMode
This enum is used to describe the view mode of the preview widget.
int currentPage() const
Returns the currently viewed page in the preview.
void setPortraitOrientation()
This is a convenience function and is the same as calling {setOrientation(QPageLayout::Portrait)}.
void print()
Prints the preview to the printer associated with the preview.
void setSinglePageViewMode()
This is a convenience function and is the same as calling {setViewMode(QPrintPreviewWidget::SinglePag...
void updatePreview()
This function updates the preview, which causes the paintRequested() signal to be emitted.
void setFacingPagesViewMode()
This is a convenience function and is the same as calling {setViewMode(QPrintPreviewWidget::FacingPag...
QPrintPreviewWidget(QPrinter *printer, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Constructs a QPrintPreviewWidget based on printer and with parent as the parent widget.
void fitToWidth()
This is a convenience function and is the same as calling {setZoomMode(QPrintPreviewWidget::FitToWidt...
void zoomIn(qreal zoom=1.1)
Zooms the current view in by factor.
void setViewMode(ViewMode viewMode)
Sets the view mode to mode.
void setOrientation(QPageLayout::Orientation orientation)
Sets the current orientation to orientation.
void zoomOut(qreal zoom=1.1)
Zooms the current view out by factor.
qreal zoomFactor() const
Returns the zoom factor of the view.
ZoomMode
This enum is used to describe zoom mode of the preview widget.
void previewChanged()
This signal is emitted whenever the preview widget has changed some internal state,...
void paintRequested(QPrinter *printer)
This signal is emitted when the preview widget needs to generate a set of preview pages.
void setCurrentPage(int pageNumber)
Sets the current page in the preview.
void setAllPagesViewMode()
This is a convenience function and is the same as calling {setViewMode(QPrintPreviewWidget::AllPagesV...
void setLandscapeOrientation()
This is a convenience function and is the same as calling {setOrientation(QPageLayout::Landscape)}.
void fitInView()
This is a convenience function and is the same as calling {setZoomMode(QPrintPreviewWidget::FitInView...
void setZoomFactor(qreal zoomFactor)
Sets the zoom factor of the view to factor.
void setZoomMode(ZoomMode zoomMode)
Sets the zoom mode to zoomMode.
~QPrintPreviewWidget()
Destroys the QPrintPreviewWidget.
QPageLayout::Orientation orientation() const
Returns the current orientation of the preview.
ZoomMode zoomMode() const
Returns the current zoom mode.
ViewMode viewMode() const
Returns the current view mode.
\reentrant
Definition qprinter.h:28
int resolution() const
Returns the current assumed resolution of the printer, as set by setResolution() or by the printer dr...
\inmodule QtGui
Definition qbrush.h:412
\inmodule QtCore\reentrant
Definition qrect.h:483
constexpr void setLeft(qreal pos) noexcept
Sets the left edge of the rectangle to the given finite x coordinate.
Definition qrect.h:661
constexpr qreal height() const noexcept
Returns the height of the rectangle.
Definition qrect.h:718
constexpr qreal width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:715
constexpr QPointF bottomLeft() const noexcept
Returns the position of the rectangle's bottom-left corner.
Definition qrect.h:513
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
Definition qrect.h:510
constexpr QPointF bottomRight() const noexcept
Returns the position of the rectangle's bottom-right corner.
Definition qrect.h:511
constexpr void moveTop(qreal pos) noexcept
Moves the rectangle vertically, leaving the rectangle's top line at the given finite y coordinate.
Definition qrect.h:691
constexpr QPointF topRight() const noexcept
Returns the position of the rectangle's top-right corner.
Definition qrect.h:512
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr int height() const noexcept
Returns the height of the rectangle.
Definition qrect.h:238
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
Definition qrect.h:220
constexpr QSize size() const noexcept
Returns the size of the rectangle.
Definition qrect.h:241
constexpr int width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:235
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:547
The QScrollBar widget provides a vertical or horizontal scroll bar.
Definition qscrollbar.h:20
The QShowEvent class provides an event that is sent when a widget is shown.
Definition qevent.h:577
Exception-safe wrapper around QObject::blockSignals().
Definition qobject.h:443
\inmodule QtCore
Definition qsize.h:207
\inmodule QtCore
Definition qsize.h:25
constexpr int height() const noexcept
Returns the height.
Definition qsize.h:132
constexpr int width() const noexcept
Returns the width.
Definition qsize.h:129
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
QPoint map(const QPoint &p) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
qreal m11() const
Returns the horizontal scaling factor.
Definition qtransform.h:199
QRect mapRect(const QRect &) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVBoxLayout class lines up widgets vertically.
Definition qboxlayout.h:91
QLayout * layout
Definition qwidget_p.h:643
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
virtual void setVisible(bool visible)
Definition qwidget.cpp:8329
bool visible
whether the widget is visible
Definition qwidget.h:144
GraphicsView(QWidget *parent=nullptr)
void resizeEvent(QResizeEvent *e) override
void showEvent(QShowEvent *e) override
QRectF boundingRect() const override
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) override
This function, which is usually called by QGraphicsView, paints the contents of an item in local coor...
PageItem(int _pageNum, const QPicture *_pagePicture, QSize _paperSize, QRect _pageRect)
QOpenGLWidget * widget
[1]
QPainter paint
qDeleteAll(list.begin(), list.end())
double e
Combined button and popup list for selecting options.
\macro QT_NAMESPACE
@ KeepAspectRatio
@ gray
Definition qnamespace.h:32
@ white
Definition qnamespace.h:30
@ black
Definition qnamespace.h:29
@ red
Definition qnamespace.h:34
@ NoPen
@ ContainsItemBoundingRect
@ NoBrush
qfloat16 qSqrt(qfloat16 f)
Definition qfloat16.h:243
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:281
static int area(const QSize &s)
Definition qicon.cpp:152
int qFloor(T v)
Definition qmath.h:42
int qCeil(T v)
Definition qmath.h:36
constexpr const T & qBound(const T &min, const T &val, const T &max)
Definition qminmax.h:44
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
#define SLOT(a)
Definition qobjectdefs.h:51
#define SIGNAL(a)
Definition qobjectdefs.h:52
GLenum mode
GLint GLsizei GLsizei height
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLint GLsizei width
GLenum target
GLbitfield flags
GLdouble GLdouble t
Definition qopenglext.h:243
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLsizei const GLchar *const * path
GLuint GLenum option
GLenum GLenum GLenum GLenum GLenum scale
static const QRectF boundingRect(const QPointF *points, int pointCount)
QtPrivate::GraphicsView GraphicsView
QtPrivate::PageItem PageItem
#define Q_OBJECT
#define signals
#define emit
#define Q_UNUSED(x)
double qreal
Definition qtypes.h:92
QObject::connect nullptr
QByteArray page
[45]
QGraphicsItem * item
QList< QTreeWidgetItem * > items
QPainter painter(this)
[7]
label setFrameStyle(QFrame::Panel|QFrame::Raised)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent