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
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));
28 }
29
30 QRectF boundingRect() const override
31 { return brect; }
32
33 inline int pageNumber() const
34 { return pageNum; }
35
37
38private:
39 int pageNum;
40 const QPicture* pagePicture;
41 QSize paperSize;
42 QRect pageRect;
43 QRectF brect;
44};
45
47{
49
50#if 0
51 // Draw item bounding rect, for debugging
52 painter->save();
57#endif
58
59 QRectF paperRect(0,0, paperSize.width(), paperSize.height());
60
61 // Draw shadow
62 painter->setClipRect(option->exposedRect);
63 qreal shWidth = paperRect.width()/100;
64 QRectF rshadow(paperRect.topRight() + QPointF(0, shWidth),
65 paperRect.bottomRight() + QPointF(shWidth, 0));
66 QLinearGradient rgrad(rshadow.topLeft(), rshadow.topRight());
67 rgrad.setColorAt(0.0, QColor(0,0,0,255));
68 rgrad.setColorAt(1.0, QColor(0,0,0,0));
69 painter->fillRect(rshadow, QBrush(rgrad));
70 QRectF bshadow(paperRect.bottomLeft() + QPointF(shWidth, 0),
71 paperRect.bottomRight() + QPointF(0, shWidth));
72 QLinearGradient bgrad(bshadow.topLeft(), bshadow.bottomLeft());
73 bgrad.setColorAt(0.0, QColor(0,0,0,255));
74 bgrad.setColorAt(1.0, QColor(0,0,0,0));
75 painter->fillRect(bshadow, QBrush(bgrad));
76 QRectF cshadow(paperRect.bottomRight(),
77 paperRect.bottomRight() + QPointF(shWidth, shWidth));
78 QRadialGradient cgrad(cshadow.topLeft(), shWidth, cshadow.topLeft());
79 cgrad.setColorAt(0.0, QColor(0,0,0,255));
80 cgrad.setColorAt(1.0, QColor(0,0,0,0));
81 painter->fillRect(cshadow, QBrush(cgrad));
82
83 painter->setClipRect(paperRect & option->exposedRect);
84 painter->fillRect(paperRect, Qt::white);
85 if (!pagePicture)
86 return;
87 painter->drawPicture(pageRect.topLeft(), *pagePicture);
88
89 // Effect: make anything drawn in the margins look washed out.
91 path.addRect(paperRect);
92 path.addRect(pageRect);
94 painter->setBrush(QColor(255, 255, 255, 180));
96
97#if 0
98 // Draw frame around paper.
101 painter->drawRect(paperRect);
102#endif
103
104 // todo: drawtext "Page N" below paper
105}
106
108{
110public:
111 GraphicsView(QWidget* parent = nullptr)
112 : QGraphicsView(parent)
113 {
114#ifdef Q_OS_MAC
116#endif
117 }
118signals:
119 void resized();
120
121protected:
122 void resizeEvent(QResizeEvent* e) override
123 {
124 {
125 const QSignalBlocker blocker(verticalScrollBar()); // Don't change page, QTBUG-14517
127 }
128 emit resized();
129 }
130
131 void showEvent(QShowEvent* e) override
132 {
134 emit resized();
135 }
136};
137
138} // namespace QtPrivate
139
142
144{
145 Q_DECLARE_PUBLIC(QPrintPreviewWidget)
146public:
153
154 // private slots
155 void _q_fit(bool doFitting = false);
157
158 void init();
159 void populateScene();
160 void layoutPages();
161 void generatePreview();
162 void setCurrentPage(int pageNumber);
163 void zoom(qreal zoom);
165 int calcCurrentPage();
166
169
171 QList<const QPicture *> pictures;
172 QList<QGraphicsItem *> pages;
173
181};
182
184{
186
187 if (curPage < 1 || curPage > pages.size())
188 return;
189
190 if (!doFitting && !fitting)
191 return;
192
193 if (doFitting && fitting) {
194 QRect viewRect = graphicsView->viewport()->rect();
196 const QList<QGraphicsItem*> containedItems = graphicsView->items(viewRect, Qt::ContainsItemBoundingRect);
197 for (QGraphicsItem* item : containedItems) {
198 PageItem* pg = static_cast<PageItem*>(item);
199 if (pg->pageNumber() == curPage)
200 return;
201 }
202 }
203
204 int newPage = calcCurrentPage();
205 if (newPage != curPage)
206 curPage = newPage;
207 }
208
211 // fit two pages
212 if (curPage % 2)
213 target.setLeft(target.left() - target.width());
214 else
215 target.setRight(target.right() + target.width());
218 }
219
222 qreal scale = graphicsView->viewport()->width() / target.width();
223 t.scale(scale, scale);
225 if (doFitting && fitting) {
226 QRectF viewSceneRect = graphicsView->viewportTransform().mapRect(graphicsView->viewport()->rect());
227 viewSceneRect.moveTop(target.top());
228 graphicsView->ensureVisible(viewSceneRect); // Nah...
229 }
230 } else {
233 const int step = qRound(graphicsView->transform().mapRect(target).height());
234 graphicsView->verticalScrollBar()->setSingleStep(step);
235 graphicsView->verticalScrollBar()->setPageStep(step);
236 }
237 }
238
239 zoomFactor = graphicsView->transform().m11() * (float(printer->logicalDpiY()) / q->logicalDpiY());
240 emit q->previewChanged();
241}
242
244{
246
248 return;
249
250 int newPage = calcCurrentPage();
251 if (newPage != curPage) {
252 curPage = newPage;
253 emit q->previewChanged();
254 }
255}
256
258{
259 int maxArea = 0;
260 int newPage = curPage;
261 QRect viewRect = graphicsView->viewport()->rect();
262 const QList<QGraphicsItem*> items = graphicsView->items(viewRect);
263 for (auto *item : items) {
264 PageItem* pg = static_cast<PageItem*>(item);
265 QRect overlap = graphicsView->mapFromScene(pg->sceneBoundingRect()).boundingRect() & viewRect;
266 int area = overlap.width() * overlap.height();
267 if (area > maxArea) {
268 maxArea = area;
269 newPage = pg->pageNumber();
270 } else if (area == maxArea && pg->pageNumber() < newPage) {
271 newPage = pg->pageNumber();
272 }
273 }
274 return newPage;
275}
276
297
299{
300 // remove old pages
301 for (auto *page : std::as_const(pages))
304 pages.clear();
305
308
309 int page = 1;
310 for (auto *picture : std::as_const(pictures)) {
311 PageItem* item = new PageItem(page++, picture, paperSize, pageRect);
314 }
315}
316
318{
319 int numPages = pages.size();
320 if (numPages < 1)
321 return;
322
323 int numPagePlaces = numPages;
324 int cols = 1; // singleMode and default
327 cols = qCeil(qSqrt((float) numPages));
328 else
329 cols = qFloor(qSqrt((float) numPages));
330 cols += cols % 2; // Nicer with an even number of cols
331 }
333 cols = 2;
334 numPagePlaces += 1;
335 }
336 int rows = qCeil(qreal(numPagePlaces) / cols);
337
338 qreal itemWidth = pages.at(0)->boundingRect().width();
339 qreal itemHeight = pages.at(0)->boundingRect().height();
340 int pageNum = 1;
341 for (int i = 0; i < rows && pageNum <= numPages; i++) {
342 for (int j = 0; j < cols && pageNum <= numPages; j++) {
344 // Front page doesn't have a facing page
345 continue;
346 } else {
347 pages.at(pageNum-1)->setPos(QPointF(j*itemWidth, i*itemHeight));
348 pageNum++;
349 }
350 }
351 }
353}
354
356{
357 //### If QPrinter::setPreviewMode() becomes public, handle the
358 //### case that we have been constructed with a printer that
359 //### _already_ has been preview-painted to, so we should
360 //### initially just show the pages it already contains, and not
361 //### emit paintRequested() until the user changes some parameter
362
364 // Avoid previewing a preview
365 if (printer->d_func()->previewMode())
366 return;
367 printer->d_func()->setPreviewMode(true);
368 emit q->paintRequested(printer);
369 printer->d_func()->setPreviewMode(false);
370 pictures = printer->d_func()->previewPages();
371 populateScene(); // i.e. setPreviewPrintedPictures() e.l.
372 layoutPages();
373 curPage = pages.size() > 0 ? qBound(1, curPage, pages.size()) : 1;
374 if (fitting)
375 _q_fit();
376 emit q->previewChanged();
377}
378
380{
381 if (pageNumber < 1 || pageNumber > pages.size())
382 return;
383
384 int lastPage = curPage;
385 curPage = pageNumber;
386
387 if (lastPage != curPage && lastPage > 0 && lastPage <= pages.size()) {
389 QScrollBar *hsc = graphicsView->horizontalScrollBar();
390 QScrollBar *vsc = graphicsView->verticalScrollBar();
392 vsc->setValue(int(pt.y()) - 10);
393 hsc->setValue(int(pt.x()) - 10);
394 } else {
396 }
397 }
398}
399
405
407{
409 zoomFactor = _zoomFactor;
411 int dpi_y = q->logicalDpiY();
412 int printer_dpi_y = printer->logicalDpiY();
413 graphicsView->scale(zoomFactor*(dpi_y/float(printer_dpi_y)),
414 zoomFactor*(dpi_y/float(printer_dpi_y)));
415}
416
418
494{
496 d->printer = printer;
497 d->ownPrinter = false;
498 d->init();
499}
500
510{
512 d->printer = new QPrinter;
513 d->ownPrinter = true;
514 d->init();
515}
516
517
522{
524 if (d->ownPrinter)
525 delete d->printer;
526}
527
532{
533 Q_D(const QPrintPreviewWidget);
534 return d->viewMode;
535}
536
542{
544 d->viewMode = mode;
545 d->layoutPages();
546 if (d->viewMode == AllPagesView) {
547 d->graphicsView->fitInView(d->scene->itemsBoundingRect(), Qt::KeepAspectRatio);
548 d->fitting = false;
550 d->zoomFactor = d->graphicsView->transform().m11() * (float(d->printer->logicalDpiY()) / logicalDpiY());
552 } else {
553 d->fitting = true;
554 d->_q_fit();
555 }
556}
557
563{
564 Q_D(const QPrintPreviewWidget);
565 return d->printer->pageLayout().orientation();
566}
567
573{
575 d->printer->setPageOrientation(orientation);
576 d->generatePreview();
577}
578
583{
585 // ### make use of the generated pages
586 emit paintRequested(d->printer);
587}
588
594{
596 d->fitting = false;
598 d->zoom(factor);
599}
600
606{
608 d->fitting = false;
610 d->zoom(1/factor);
611}
612
617{
618 Q_D(const QPrintPreviewWidget);
619 return d->zoomFactor;
620}
621
630{
632 d->fitting = false;
634 d->setZoomFactor(factor);
635}
636
642{
643 Q_D(const QPrintPreviewWidget);
644 return d->pages.size();
645}
646
651{
652 Q_D(const QPrintPreviewWidget);
653 return d->curPage;
654}
655
661{
663 d->setCurrentPage(page);
664}
665
674
683
690{
692 d->zoomMode = zoomMode;
693 if (d->zoomMode == FitInView || d->zoomMode == FitToWidth) {
694 d->fitting = true;
695 d->_q_fit(true);
696 } else {
697 d->fitting = false;
698 }
699}
700
707{
708 Q_D(const QPrintPreviewWidget);
709 return d->zoomMode;
710}
711
720
729
738
747
756
757
763{
765 d->initialized = true;
766 d->generatePreview();
767 d->graphicsView->updateGeometry();
768}
769
773{
775 if (visible && !d->initialized)
778}
779
797
798#include "moc_qprintpreviewwidget.cpp"
799#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
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.
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
qsizetype size() const noexcept
Definition qlist.h:397
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
void append(parameter_type t)
Definition qlist.h:458
void clear()
Definition qlist.h:434
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
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:28
The QPicture class is a paint device that records and replays QPainter commands.
Definition qpicture.h:19
\inmodule QtCore\reentrant
Definition qpoint.h:217
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:343
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:348
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 setVisible(bool visible) override
\reimp
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:484
constexpr void setLeft(qreal pos) noexcept
Sets the left edge of the rectangle to the given finite x coordinate.
Definition qrect.h:675
constexpr qreal width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:729
constexpr QPointF bottomLeft() const noexcept
Returns the position of the rectangle's bottom-left corner.
Definition qrect.h:514
constexpr QPointF bottomRight() const noexcept
Returns the position of the rectangle's bottom-right corner.
Definition qrect.h:512
constexpr QPointF topRight() const noexcept
Returns the position of the rectangle's top-right corner.
Definition qrect.h:513
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr int height() const noexcept
Returns the height of the rectangle.
Definition qrect.h:239
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
Definition qrect.h:221
constexpr QSize size() const noexcept
Returns the size of the rectangle.
Definition qrect.h:242
constexpr int width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:236
constexpr void moveTop(int pos) noexcept
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
Definition qrect.h:289
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
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:578
Exception-safe wrapper around QObject::blockSignals().
Definition qobject.h:483
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
constexpr int height() const noexcept
Returns the height.
Definition qsize.h:133
constexpr int width() const noexcept
Returns the width.
Definition qsize.h:130
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:651
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
virtual void setVisible(bool visible)
Definition qwidget.cpp:8255
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())
Combined button and popup list for selecting options.
\macro QT_NO_KEYWORDS >
@ KeepAspectRatio
@ gray
Definition qnamespace.h:33
@ white
Definition qnamespace.h:31
@ black
Definition qnamespace.h:30
@ red
Definition qnamespace.h:35
@ NoPen
@ ContainsItemBoundingRect
@ NoBrush
qfloat16 qSqrt(qfloat16 f)
Definition qfloat16.h:289
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:327
static int area(const QSize &s)
Definition qicon.cpp:153
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:52
#define SIGNAL(a)
Definition qobjectdefs.h:53
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:187
QObject::connect nullptr
QByteArray page
[45]
QGraphicsItem * item
QList< QTreeWidgetItem * > items
QPainter painter(this)
[7]
label setFrameStyle(QFrame::Panel|QFrame::Raised)