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
qpagesetupdialog_unix_p.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#ifndef QPAGESETUPDIALOG_UNIX_P_H
5#define QPAGESETUPDIALOG_UNIX_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// to version without notice, or even be removed.
14//
15// We mean it.
16//
17//
18
19#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
20
21#include "qprinter.h"
22#include "kernel/qprint_p.h"
23
24#include <QtGui/qpagelayout.h>
25
26#include <ui_qpagesetupwidget.h>
27
29
30QT_BEGIN_NAMESPACE
31
32class QPrinter;
33class QPrintDevice;
34class QPagePreview;
35
36class QPageSetupWidget : public QWidget {
38public:
39 explicit QPageSetupWidget(QWidget *parent = nullptr);
40
41 void setPrinter(QPrinter *printer, QPrintDevice *printDevice,
42 QPrinter::OutputFormat outputFormat, const QString &printerName);
43 void setupPrinter() const;
44 void updateSavedValues();
46
47#if QT_CONFIG(cups)
48 bool hasPpdConflict() const;
49
51 void ppdOptionChanged();
52#endif
53
54private slots:
55 void pageSizeChanged();
56 void pageOrientationChanged();
57 void pagesPerSheetChanged();
58 void unitChanged();
59 void topMarginChanged(double newValue);
60 void bottomMarginChanged(double newValue);
61 void leftMarginChanged(double newValue);
62 void rightMarginChanged(double newValue);
63
64private:
65 friend class QUnixPrintWidgetPrivate; // Needed by checkFields()
66
67 void updateWidget();
68 void initUnits();
69 void initPagesPerSheet();
70 void initPageSizes();
71
72 Ui::QPageSetupWidget m_ui;
73 QPagePreview *m_pagePreview;
74 QPrinter *m_printer;
75 QPrintDevice *m_printDevice;
76#if QT_CONFIG(cups)
78#endif
79 QPrinter::OutputFormat m_outputFormat;
80 QString m_printerName;
81 QPageLayout m_pageLayout;
82 QPageLayout m_savedPageLayout;
83 QPageLayout::Unit m_units;
84 QPageLayout::Unit m_savedUnits;
85 int m_savedPagesPerSheet;
86 int m_savedPagesPerSheetLayout;
87 bool m_blockSignals;
88 int m_realCustomPageSizeIndex;
89};
90
91QT_END_NAMESPACE
92
93#endif
void setPageLayout(const QPageLayout &layout)
void setPagePreviewLayout(int columns, int rows)
QPagePreview(QWidget *parent)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void setPrinter(QPrinter *printer, QPrintDevice *printDevice, QPrinter::OutputFormat outputFormat, const QString &printerName)
QPainter(QPaintDevice *)
Constructs a painter that begins painting the paint device immediately.
friend class QWidget
Definition qpainter.h:432
QT_REQUIRE_CONFIG(printdialog)
QT_REQUIRE_CONFIG(animation)
QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits)