Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qprintdialog.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 QPRINTDIALOG_H
5#define QPRINTDIALOG_H
6
7#include <QtPrintSupport/qtprintsupportglobal.h>
8
9#include <QtPrintSupport/qabstractprintdialog.h>
10
11QT_REQUIRE_CONFIG(printdialog);
12
14
16class QPushButton;
17class QPrinter;
18
19class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog
20{
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);
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
50#endif
51
53
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
69
70#endif // QPRINTDIALOG_H
The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure pri...
PrintDialogOption
Used to specify which parts of the print dialog should be visible.
QPrinter * printer() const
Returns the printer that this printer dialog operates on.
virtual int exec()
Shows the dialog as a \l{QDialog::Modal Dialogs}{modal dialog}, blocking until the user closes it.
Definition qdialog.cpp:539
void accepted()
virtual void done(int)
Closes the dialog and sets its result code to r.
Definition qdialog.cpp:598
virtual void open()
Definition qdialog.cpp:499
virtual void accept()
Hides the modal dialog and sets the result code to Accepted.
Definition qdialog.cpp:624
\inmodule QtCore
Definition qobject.h:90
The QPrintDialog class provides a dialog for specifying the printer's configuration.
void accepted(QPrinter *printer)
This signal is emitted when the user accepts the values set in the print dialog.
\reentrant
Definition qprinter.h:28
The QPushButton widget provides a command button.
Definition qpushbutton.h:20
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
virtual void setVisible(bool visible)
Definition qwidget.cpp:8329
Combined button and popup list for selecting options.
GLuint64EXT * result
[6]
GLuint GLenum option
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent