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 QPRINTPREVIEWDIALOG_H
5#define QPRINTPREVIEWDIALOG_H
6
7#include <QtPrintSupport/qtprintsupportglobal.h>
8
9#include <QtWidgets/qdialog.h>
10
11QT_REQUIRE_CONFIG(printpreviewdialog);
12
13QT_BEGIN_NAMESPACE
14
15class QGraphicsView;
16class QPrintPreviewDialogPrivate;
17class QPrinter;
18
19class Q_PRINTSUPPORT_EXPORT QPrintPreviewDialog : public QDialog
20{
21 Q_OBJECT
22 Q_DECLARE_PRIVATE(QPrintPreviewDialog)
23
24public:
25 explicit QPrintPreviewDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
26 explicit QPrintPreviewDialog(QPrinter *printer, QWidget *parent = nullptr,
27 Qt::WindowFlags flags = Qt::WindowFlags());
28 ~QPrintPreviewDialog();
29
30 using QDialog::open;
31 void open(QObject *receiver, const char *member);
32
33 QPrinter *printer();
34
35 void setVisible(bool visible) override;
36 void done(int result) override;
37
38Q_SIGNALS:
39 void paintRequested(QPrinter *printer);
40
41private:
42 Q_PRIVATE_SLOT(d_func(), void _q_fit(QAction *action))
43 Q_PRIVATE_SLOT(d_func(), void _q_zoomIn())
44 Q_PRIVATE_SLOT(d_func(), void _q_zoomOut())
45 Q_PRIVATE_SLOT(d_func(), void _q_navigate(QAction *action))
46 Q_PRIVATE_SLOT(d_func(), void _q_setMode(QAction *action))
47 Q_PRIVATE_SLOT(d_func(), void _q_pageNumEdited())
48 Q_PRIVATE_SLOT(d_func(), void _q_print())
49 Q_PRIVATE_SLOT(d_func(), void _q_pageSetup())
50 Q_PRIVATE_SLOT(d_func(), void _q_previewChanged())
51 Q_PRIVATE_SLOT(d_func(), void _q_zoomFactorChanged())
52};
53
54
55QT_END_NAMESPACE
56
57#endif // QPRINTPREVIEWDIALOG_H
58

source code of qtbase/src/printsupport/dialogs/qprintpreviewdialog.h