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