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 QPRINTDIALOG_H
5#define QPRINTDIALOG_H
6
7#include <QtPrintSupport/qtprintsupportglobal.h>
8
9#include <QtPrintSupport/qabstractprintdialog.h>
10
11QT_REQUIRE_CONFIG(printdialog);
12
13QT_BEGIN_NAMESPACE
14
15class QPrintDialogPrivate;
16class QPushButton;
17class QPrinter;
18
19class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog
20{
21 Q_OBJECT
22 Q_DECLARE_PRIVATE(QPrintDialog)
23 Q_PROPERTY(PrintDialogOptions options READ options WRITE setOptions)
24
25public:
26 explicit QPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
27 explicit QPrintDialog(QWidget *parent = nullptr);
28 ~QPrintDialog();
29
30 int exec() override;
31#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
32 virtual void accept() override;
33#endif
34 void done(int result) override;
35
36 void setOption(PrintDialogOption option, bool on = true);
37 bool testOption(PrintDialogOption option) const;
38 void setOptions(PrintDialogOptions options);
39 PrintDialogOptions options() const;
40
41#if defined(Q_OS_UNIX) || defined(Q_OS_WIN)
42 void setVisible(bool visible) override;
43#endif
44
45 using QDialog::open;
46 void open(QObject *receiver, const char *member);
47
48#ifdef Q_QDOC
49 QPrinter *printer();
50#endif
51
52 using QDialog::accepted;
53
54Q_SIGNALS:
55 void accepted(QPrinter *printer);
56
57private:
58#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
59 Q_PRIVATE_SLOT(d_func(), void _q_togglePageSetCombo(bool))
60 Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog())
61#if QT_CONFIG(messagebox)
62 Q_PRIVATE_SLOT(d_func(), void _q_checkFields())
63#endif // QT_CONFIG(messagebox)
64 friend class QUnixPrintWidget;
65# endif // Q_OS_UNIX
66};
67
68QT_END_NAMESPACE
69
70#endif // QPRINTDIALOG_H
71

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