Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qabstractprintdialog.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// Qt-Security score:significant reason:default
4
5#ifndef QABSTRACTPRINTDIALOG_H
6#define QABSTRACTPRINTDIALOG_H
7
8#include <QtPrintSupport/qtprintsupportglobal.h>
9
10#include <QtWidgets/qdialog.h>
11
13
14QT_BEGIN_NAMESPACE
15
16class QAbstractPrintDialogPrivate;
17class QPrinter;
18
19class Q_PRINTSUPPORT_EXPORT QAbstractPrintDialog : public QDialog
20{
21 Q_DECLARE_PRIVATE(QAbstractPrintDialog)
22 Q_OBJECT
23
24public:
25 // Keep in sync with QPrinter::PrintRange
26 enum PrintRange {
27 AllPages,
28 Selection,
29 PageRange,
30 CurrentPage
31 };
32
33 enum PrintDialogOption {
34 PrintToFile = 0x0001,
35 PrintSelection = 0x0002,
36 PrintPageRange = 0x0004,
37 PrintShowPageSize = 0x0008,
38 PrintCollateCopies = 0x0010,
39 PrintCurrentPage = 0x0040
40 };
41 Q_ENUM(PrintDialogOption)
42
43 Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption)
44 Q_FLAG(PrintDialogOptions)
45
46 explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
47 ~QAbstractPrintDialog();
48
49 void setOptionTabs(const QList<QWidget*> &tabs);
50
51 void setPrintRange(PrintRange range);
52 PrintRange printRange() const;
53
54 void setMinMax(int min, int max);
55 int minPage() const;
56 int maxPage() const;
57
58 void setFromTo(int fromPage, int toPage);
59 int fromPage() const;
60 int toPage() const;
61
62 QPrinter *printer() const;
63
64protected:
65 QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = nullptr);
66
67private:
68 Q_DISABLE_COPY(QAbstractPrintDialog)
69
70};
71
72Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractPrintDialog::PrintDialogOptions)
73
74QT_END_NAMESPACE
75
76#endif // QABSTRACTPRINTDIALOG_H
The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure pri...
QT_REQUIRE_CONFIG(printdialog)