Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qprintpreviewwidget.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 QPRINTPREVIEWWIDGET_H
5
#define QPRINTPREVIEWWIDGET_H
6
7
#include <QtPrintSupport/qtprintsupportglobal.h>
8
#include <QtWidgets/qwidget.h>
9
#include <QtPrintSupport/qprinter.h>
10
11
QT_REQUIRE_CONFIG
(printpreviewwidget);
12
13
QT_BEGIN_NAMESPACE
14
15
16
class
QPrintPreviewWidgetPrivate
;
17
18
class
Q_PRINTSUPPORT_EXPORT
QPrintPreviewWidget
:
public
QWidget
19
{
20
Q_OBJECT
21
Q_DECLARE_PRIVATE(
QPrintPreviewWidget
)
22
public
:
23
24
enum
ViewMode
{
25
SinglePageView
,
26
FacingPagesView
,
27
AllPagesView
28
};
29
30
enum
ZoomMode
{
31
CustomZoom
,
32
FitToWidth
,
33
FitInView
34
};
35
36
explicit
QPrintPreviewWidget
(
QPrinter
*printer,
QWidget
*
parent
=
nullptr
,
37
Qt::WindowFlags
flags
= Qt::WindowFlags());
38
explicit
QPrintPreviewWidget
(
QWidget
*
parent
=
nullptr
, Qt::WindowFlags
flags
= Qt::WindowFlags());
39
~QPrintPreviewWidget
();
40
41
qreal
zoomFactor()
const
;
42
QPageLayout::Orientation
orientation()
const
;
43
ViewMode viewMode()
const
;
44
ZoomMode zoomMode()
const
;
45
int
currentPage()
const
;
46
int
pageCount()
const
;
47
void
setVisible
(
bool
visible)
override
;
48
49
public
Q_SLOTS
:
50
void
print();
51
52
void
zoomIn(
qreal
zoom = 1.1);
53
void
zoomOut(
qreal
zoom = 1.1);
54
void
setZoomFactor(
qreal
zoomFactor);
55
void
setOrientation(
QPageLayout::Orientation
orientation);
56
void
setViewMode
(ViewMode viewMode);
57
void
setZoomMode(ZoomMode zoomMode);
58
void
setCurrentPage(
int
pageNumber);
59
60
void
fitToWidth();
61
void
fitInView();
62
void
setLandscapeOrientation();
63
void
setPortraitOrientation();
64
void
setSinglePageViewMode();
65
void
setFacingPagesViewMode();
66
void
setAllPagesViewMode();
67
68
void
updatePreview();
69
70
Q_SIGNALS
:
71
void
paintRequested
(
QPrinter
*printer);
72
void
previewChanged
();
73
74
private
:
75
Q_PRIVATE_SLOT
(d_func(),
void
_q_fit())
76
Q_PRIVATE_SLOT
(d_func(),
void
_q_updateCurrentPage())
77
};
78
79
QT_END_NAMESPACE
80
81
#endif
// QPRINTPREVIEWWIDGET_H
QPageLayout::Orientation
Orientation
This enum type defines the page orientation.
Definition
qpagelayout.h:33
QPrintPreviewWidgetPrivate
Definition
qprintpreviewwidget.cpp:145
QPrintPreviewWidget
The QPrintPreviewWidget class provides a widget for previewing page layouts for printer output.
Definition
qprintpreviewwidget.h:19
QPrintPreviewWidget::ViewMode
ViewMode
This enum is used to describe the view mode of the preview widget.
Definition
qprintpreviewwidget.h:24
QPrintPreviewWidget::FacingPagesView
@ FacingPagesView
Definition
qprintpreviewwidget.h:26
QPrintPreviewWidget::SinglePageView
@ SinglePageView
Definition
qprintpreviewwidget.h:25
QPrintPreviewWidget::ZoomMode
ZoomMode
This enum is used to describe zoom mode of the preview widget.
Definition
qprintpreviewwidget.h:30
QPrintPreviewWidget::CustomZoom
@ CustomZoom
Definition
qprintpreviewwidget.h:31
QPrintPreviewWidget::FitToWidth
@ FitToWidth
Definition
qprintpreviewwidget.h:32
QPrintPreviewWidget::previewChanged
void previewChanged()
This signal is emitted whenever the preview widget has changed some internal state,...
QPrintPreviewWidget::paintRequested
void paintRequested(QPrinter *printer)
This signal is emitted when the preview widget needs to generate a set of preview pages.
QPrinter
\reentrant
Definition
qprinter.h:28
QWidget
The QWidget class is the base class of all user interface objects.
Definition
qwidget.h:99
QWidget::setVisible
virtual void setVisible(bool visible)
Definition
qwidget.cpp:8329
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
flags
GLbitfield flags
Definition
qopengles2ext.h:1026
QT_REQUIRE_CONFIG
#define QT_REQUIRE_CONFIG(feature)
Definition
qtconfigmacros.h:66
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
Q_SLOTS
#define Q_SLOTS
Definition
qtmetamacros.h:44
Q_PRIVATE_SLOT
#define Q_PRIVATE_SLOT(d, signature)
Definition
qtmetamacros.h:46
Q_SIGNALS
#define Q_SIGNALS
Definition
qtmetamacros.h:45
qreal
double qreal
Definition
qtypes.h:92
setViewMode
dialog setViewMode(QFileDialog::Detail)
[3]
parent
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
Definition
uiaclientinterfaces_p.h:209
qtbase
src
printsupport
widgets
qprintpreviewwidget.h
Generated by
1.9.7