9#include <private/qpagesetupdialog_p.h>
10#include <private/qprintdevice_p.h>
12#include <private/qcups_p.h>
19#include <ui_qpagesetupwidget.h>
21#include <QtPrintSupport/qprinter.h>
23#include <qpa/qplatformprintplugin.h>
24#include <qpa/qplatformprintersupport.h>
28using namespace Qt::StringLiterals;
35#ifdef PSD_ENABLE_PAPERSOURCE
36static const char *paperSourceNames[] = {
53struct PaperSourceNames
55 PaperSourceNames(
const char *nam, QPrinter::PaperSource ps)
56 : paperSource(ps), name(nam) {}
57 QPrinter::PaperSource paperSource;
72 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
73 setMinimumSize(50, 50);
78 m_pageLayout = layout;
84 m_pagePreviewColumns = columns;
85 m_pagePreviewRows = rows;
92 QSize pageSize = m_pageLayout.fullRectPoints().size();
93 QSizeF scaledSize = pageSize.scaled(width() - 10, height() - 10, Qt::KeepAspectRatio);
94 QRect pageRect = QRect(QPoint(0,0), scaledSize.toSize());
95 pageRect.moveCenter(rect().center());
96 qreal width_factor = scaledSize.width() / pageSize.width();
97 qreal height_factor = scaledSize.height() / pageSize.height();
98 QMarginsF margins = m_pageLayout.margins(QPageLayout::Point);
99 int left = qRound(margins.left() * width_factor);
100 int top = qRound(margins.top() * height_factor);
101 int right = qRound(margins.right() * width_factor);
102 int bottom = qRound(margins.bottom() * height_factor);
103 QRect marginRect(pageRect.x() + left, pageRect.y() + top,
104 pageRect.width() - (left + right + 1), pageRect.height() - (top + bottom + 1));
107 QColor shadow(palette().mid().color());
108 for (
int i=1; i<6; ++i) {
109 shadow.setAlpha(180-i*30);
110 QRect offset(pageRect.adjusted(i, i, i, i));
112 p.drawLine(offset.left(), offset.bottom(), offset.right(), offset.bottom());
113 p.drawLine(offset.right(), offset.top(), offset.right(), offset.bottom()-1);
115 p.fillRect(pageRect, palette().light());
117 if (marginRect.isValid()) {
118 p.setPen(QPen(palette().color(QPalette::Dark), 0, Qt::DotLine));
119 p.drawRect(marginRect);
121 marginRect.adjust(2, 2, -1, -1);
122 p.setClipRect(marginRect);
124 font.setPointSizeF(font.pointSizeF()*0.25);
126 p.setPen(palette().color(QPalette::Dark));
127 QString text(
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."_L1);
128 for (
int i=0; i<3; ++i)
131 const int spacing = pageRect.width() * 0.1;
132 const int textWidth = (marginRect.width() - (spacing * (m_pagePreviewColumns-1))) / m_pagePreviewColumns;
133 const int textHeight = (marginRect.height() - (spacing * (m_pagePreviewRows-1))) / m_pagePreviewRows;
135 for (
int x = 0 ; x < m_pagePreviewColumns; ++x) {
136 for (
int y = 0 ; y < m_pagePreviewRows; ++y) {
137 QRect textRect(marginRect.left() + x * (textWidth + spacing),
138 marginRect.top() + y * (textHeight + spacing),
139 textWidth, textHeight);
140 p.drawText(textRect, Qt::TextWordWrap|Qt::AlignVCenter, text);
148 QPageLayout m_pageLayout;
150 int m_pagePreviewColumns, m_pagePreviewRows;
160 Q_DECLARE_PUBLIC(QPageSetupDialog)
180 Q_Q(QPageSetupDialog);
182 widget =
new QPageSetupWidget(q);
183 widget->setPrinter(printer,
nullptr, printer->outputFormat(), printer->printerName());
185 QDialogButtonBox *buttons =
new QDialogButtonBox(QDialogButtonBox::Ok
186 | QDialogButtonBox::Cancel,
188 QObject::connect(buttons, SIGNAL(accepted()), q, SLOT(accept()));
189 QObject::connect(buttons, SIGNAL(rejected()), q, SLOT(reject()));
191 QVBoxLayout *lay =
new QVBoxLayout(q);
193 lay->addWidget(buttons);
203 m_pagePreview(
nullptr),
205 m_printDevice(
nullptr),
207 m_pageSizePpdOption(
nullptr),
209 m_outputFormat(QPrinter::PdfFormat),
210 m_units(QPageLayout::Point),
211 m_savedUnits(QPageLayout::Point),
212 m_savedPagesPerSheet(-1),
213 m_savedPagesPerSheetLayout(-1),
214 m_blockSignals(
false),
215 m_realCustomPageSizeIndex(-1)
219 QVBoxLayout *lay =
new QVBoxLayout(m_ui.preview);
220 m_pagePreview =
new QPagePreview(m_ui.preview);
223 lay->addWidget(m_pagePreview);
225 setAttribute(Qt::WA_WState_Polished,
false);
227#ifdef PSD_ENABLE_PAPERSOURCE
228 for (
int i=0; paperSourceNames[i]; ++i)
229 m_ui.paperSource->insertItem(paperSourceNames[i]);
231 m_ui.paperSourceLabel->setVisible(
false);
232 m_ui.paperSource->setVisible(
false);
235 m_ui.reverseLandscape->setVisible(
false);
236 m_ui.reversePortrait->setVisible(
false);
241 connect(m_ui.unitCombo, &QComboBox::activated,
this, &
QPageSetupWidget::unitChanged);
243 connect(m_ui.pageSizeCombo, &QComboBox::currentIndexChanged,
this, &QPageSetupWidget::pageSizeChanged);
244 connect(m_ui.pageWidth, &QDoubleSpinBox::valueChanged,
this, &QPageSetupWidget::pageSizeChanged);
245 connect(m_ui.pageHeight, &QDoubleSpinBox::valueChanged,
this, &QPageSetupWidget::pageSizeChanged);
247 connect(m_ui.leftMargin, &QDoubleSpinBox::valueChanged,
this, &
QPageSetupWidget::leftMarginChanged);
248 connect(m_ui.topMargin, &QDoubleSpinBox::valueChanged,
this, &
QPageSetupWidget::topMarginChanged);
249 connect(m_ui.rightMargin, &QDoubleSpinBox::valueChanged,
this, &
QPageSetupWidget::rightMarginChanged);
250 connect(m_ui.bottomMargin, &QDoubleSpinBox::valueChanged,
this, &
QPageSetupWidget::bottomMarginChanged);
252 connect(m_ui.portrait, &QRadioButton::clicked,
this, &
QPageSetupWidget::pageOrientationChanged);
253 connect(m_ui.landscape, &QRadioButton::clicked,
this, &
QPageSetupWidget::pageOrientationChanged);
255 connect(m_ui.pagesPerSheetCombo, &QComboBox::currentIndexChanged,
this, &
QPageSetupWidget::pagesPerSheetChanged);
261 m_ui.unitCombo->addItem(tr(
"Millimeters (mm)"), QVariant::fromValue(QPageLayout::Millimeter));
262 m_ui.unitCombo->addItem(tr(
"Inches (in)"), QVariant::fromValue(QPageLayout::Inch));
263 m_ui.unitCombo->addItem(tr(
"Points (pt)"), QVariant::fromValue(QPageLayout::Point));
264 m_ui.unitCombo->addItem(tr(
"Pica (P̸)"), QVariant::fromValue(QPageLayout::Pica));
265 m_ui.unitCombo->addItem(tr(
"Didot (DD)"), QVariant::fromValue(QPageLayout::Didot));
266 m_ui.unitCombo->addItem(tr(
"Cicero (CC)"), QVariant::fromValue(QPageLayout::Cicero));
269 m_ui.unitCombo->setCurrentIndex(QLocale().measurementSystem() != QLocale::MetricSystem);
276 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Left to Right, Top to Bottom"),
277 QVariant::fromValue(QCUPSSupport::LeftToRightTopToBottom));
278 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Left to Right, Bottom to Top"),
279 QVariant::fromValue(QCUPSSupport::LeftToRightBottomToTop));
280 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Right to Left, Bottom to Top"),
281 QVariant::fromValue(QCUPSSupport::RightToLeftBottomToTop));
282 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Right to Left, Top to Bottom"),
283 QVariant::fromValue(QCUPSSupport::RightToLeftTopToBottom));
284 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Bottom to Top, Left to Right"),
285 QVariant::fromValue(QCUPSSupport::BottomToTopLeftToRight));
286 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Bottom to Top, Right to Left"),
287 QVariant::fromValue(QCUPSSupport::BottomToTopRightToLeft));
288 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Top to Bottom, Left to Right"),
289 QVariant::fromValue(QCUPSSupport::TopToBottomLeftToRight));
290 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr(
"Top to Bottom, Right to Left"),
291 QVariant::fromValue(QCUPSSupport::TopToBottomRightToLeft));
293 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr(
"1 (1x1)"),
294 QVariant::fromValue(QCUPSSupport::OnePagePerSheet));
295 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr(
"2 (2x1)"),
296 QVariant::fromValue(QCUPSSupport::TwoPagesPerSheet));
297 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr(
"4 (2x2)"),
298 QVariant::fromValue(QCUPSSupport::FourPagesPerSheet));
299 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr(
"6 (2x3)"),
300 QVariant::fromValue(QCUPSSupport::SixPagesPerSheet));
301 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr(
"9 (3x3)"),
302 QVariant::fromValue(QCUPSSupport::NinePagesPerSheet));
303 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr(
"16 (4x4)"),
304 QVariant::fromValue(QCUPSSupport::SixteenPagesPerSheet));
307 m_ui.pagesPerSheetCombo->setCurrentIndex(0);
309 m_ui.pagesPerSheetLayoutCombo->setCurrentIndex(0);
312 m_ui.pagesPerSheetButtonGroup->hide();
318 m_blockSignals =
true;
320 m_ui.pageSizeCombo->clear();
322 m_realCustomPageSizeIndex = -1;
324 if (m_outputFormat == QPrinter::NativeFormat && !m_printerName.isEmpty()) {
325 QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
327 QPrintDevice printDevice = ps->createPrintDevice(m_printerName);
328 const QPageSize defaultSize = printDevice.defaultPageSize();
329 const auto pageSizes = printDevice.supportedPageSizes();
330 for (
const QPageSize &pageSize : pageSizes)
331 m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize));
332 if (m_ui.pageSizeCombo->count() > 0) {
333 if (printDevice.supportsCustomPageSizes()) {
334 m_ui.pageSizeCombo->addItem(tr(
"Custom"));
335 m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1;
337 m_blockSignals =
false;
341 m_ui.pageSizeCombo->setCurrentIndex(-1);
342 m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(defaultSize)));
349 for (
int id = 0; id < QPageSize::LastPageSize; ++id) {
350 if (QPageSize::PageSizeId(id) == QPageSize::Custom) {
351 m_ui.pageSizeCombo->addItem(tr(
"Custom"));
352 m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1;
354 QPageSize pageSize = QPageSize(QPageSize::PageSizeId(id));
355 m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize));
359 m_blockSignals =
false;
365 QPrinter::OutputFormat outputFormat,
const QString &printerName)
368 m_printDevice = printDevice;
372 m_pageSizePpdOption = m_printDevice ? QCUPSSupport::findPpdOption(
"PageSize", m_printDevice) :
nullptr;
376 m_pageLayout = m_printer->pageLayout();
379 if (m_pageLayout.units() == QPageLayout::Point) {
380 if (QLocale().measurementSystem() == QLocale::MetricSystem)
381 m_pageLayout.setUnits(QPageLayout::Millimeter);
383 m_pageLayout.setUnits(QPageLayout::Inch);
385 m_units = m_pageLayout.units();
386 m_pagePreview->setPageLayout(m_pageLayout);
388 m_outputFormat = outputFormat;
389 m_printerName = printerName;
394 if (m_ui.pageSizeCombo->currentIndex() == -1) {
397 m_ui.pageSizeCombo->setCurrentIndex(0);
405 m_blockSignals =
true;
409 case QPageLayout::Millimeter:
413 case QPageLayout::Point:
417 case QPageLayout::Inch:
421 case QPageLayout::Pica:
425 case QPageLayout::Didot:
429 case QPageLayout::Cicero:
435 m_ui.unitCombo->setCurrentIndex(m_ui.unitCombo->findData(QVariant::fromValue(m_units)));
437 const bool isCustom = m_realCustomPageSizeIndex != -1
438 && (m_pageLayout.pageSize().id() == QPageSize::Custom
439 || m_ui.pageSizeCombo->currentIndex() == m_realCustomPageSizeIndex);
441 m_ui.pageSizeCombo->setCurrentIndex(m_realCustomPageSizeIndex);
443 m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(m_pageLayout.pageSize())));
448 if (m_pageLayout.mode() == QPageLayout::FullPageMode) {
449 min = QMarginsF(0.0, 0.0, 0.0, 0.0);
450 max = QMarginsF(9999.9999, 9999.9999, 9999.9999, 9999.9999);
452 min = m_pageLayout.minimumMargins();
453 max = m_pageLayout.maximumMargins();
456 m_ui.leftMargin->setSuffix(suffix);
457 m_ui.leftMargin->setMinimum(min.left());
458 m_ui.leftMargin->setMaximum(max.left());
459 m_ui.leftMargin->setValue(m_pageLayout.margins().left());
461 m_ui.rightMargin->setSuffix(suffix);
462 m_ui.rightMargin->setMinimum(min.right());
463 m_ui.rightMargin->setMaximum(max.right());
464 m_ui.rightMargin->setValue(m_pageLayout.margins().right());
466 m_ui.topMargin->setSuffix(suffix);
467 m_ui.topMargin->setMinimum(min.top());
468 m_ui.topMargin->setMaximum(max.top());
469 m_ui.topMargin->setValue(m_pageLayout.margins().top());
471 m_ui.bottomMargin->setSuffix(suffix);
472 m_ui.bottomMargin->setMinimum(min.bottom());
473 m_ui.bottomMargin->setMaximum(max.bottom());
474 m_ui.bottomMargin->setValue(m_pageLayout.margins().bottom());
476 m_ui.pageWidth->setSuffix(suffix);
477 m_ui.pageWidth->setValue(m_pageLayout.fullRect(m_units).width());
478 m_ui.pageWidth->setEnabled(isCustom);
479 m_ui.widthLabel->setEnabled(isCustom);
481 m_ui.pageHeight->setSuffix(suffix);
482 m_ui.pageHeight->setValue(m_pageLayout.fullRect(m_units).height());
483 m_ui.pageHeight->setEnabled(isCustom);
484 m_ui.heightLabel->setEnabled(isCustom);
486 m_ui.portrait->setChecked(m_pageLayout.orientation() == QPageLayout::Portrait);
487 m_ui.landscape->setChecked(m_pageLayout.orientation() == QPageLayout::Landscape);
489 m_ui.pagesPerSheetButtonGroup->setEnabled(m_outputFormat == QPrinter::NativeFormat);
491#ifdef PSD_ENABLE_PAPERSOURCE
492 m_ui.paperSource->setCurrentItem(printer->paperSource());
495 m_blockSignals =
false;
502 m_printer->setPageLayout(m_pageLayout);
503 m_printer->setPageOrientation(m_pageLayout.orientation());
505 QCUPSSupport::PagesPerSheet pagesPerSheet = qvariant_cast<QCUPSSupport::PagesPerSheet>(m_ui.pagesPerSheetCombo->currentData()
507 QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = qvariant_cast<QCUPSSupport::PagesPerSheetLayout>(m_ui.pagesPerSheetLayoutCombo->currentData()
509 QCUPSSupport::setPagesPerSheetLayout(m_printer, pagesPerSheet, pagesPerSheetLayout);
511#ifdef PSD_ENABLE_PAPERSOURCE
512 m_printer->setPaperSource((QPrinter::PaperSource)m_ui.paperSource->currentIndex());
518 m_savedUnits = m_units;
519 m_savedPageLayout = m_pageLayout;
520 m_savedPagesPerSheet = m_ui.pagesPerSheetCombo->currentIndex();
521 m_savedPagesPerSheetLayout = m_ui.pagesPerSheetLayoutCombo->currentIndex();
526 m_units = m_savedUnits;
527 m_pageLayout = m_savedPageLayout;
528 m_pagePreview->setPageLayout(m_pageLayout);
532 m_ui.pagesPerSheetCombo->setCurrentIndex(m_savedPagesPerSheet);
533 m_ui.pagesPerSheetLayoutCombo->setCurrentIndex(m_savedPagesPerSheetLayout);
537bool QPageSetupWidget::hasPpdConflict()
const
539 if (m_pageSizePpdOption) {
540 if (m_pageSizePpdOption->conflicted) {
541 const QIcon warning = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning,
nullptr,
nullptr);
542 const int pixmap_size = m_ui.pageSizeCombo->sizeHint().height() * .75;
543 m_ui.pageSizeWarningLabel->setPixmap(warning.pixmap(pixmap_size, pixmap_size));
545 m_ui.pageSizeWarningLabel->setPixmap(QPixmap());
547 return m_pageSizePpdOption->conflicted;
558 if (m_ui.pageSizeCombo->currentIndex() != m_realCustomPageSizeIndex) {
559 pageSize = qvariant_cast<QPageSize>(m_ui.pageSizeCombo->currentData());
562 if (m_pageSizePpdOption) {
563 ppd_file_t *ppd = qvariant_cast<ppd_file_t*>(m_printDevice->property(PDPK_PpdFile));
564 QStringDecoder toUtf16(ppd->lang_encoding, QStringDecoder::Flag::Stateless);
565 if (!toUtf16.isValid()) {
566 qWarning() <<
"QPrinSupport: Cups uses unsupported encoding" << ppd->lang_encoding;
567 toUtf16 = QStringDecoder(QStringDecoder::Utf8);
569 for (
int i = 0; i < m_pageSizePpdOption->num_choices; ++i) {
570 const ppd_choice_t *choice = &m_pageSizePpdOption->choices[i];
571 if (toUtf16(choice->text) == m_ui.pageSizeCombo->currentText()) {
572 const auto values = QStringList{} << QString::fromLatin1(m_pageSizePpdOption->keyword)
573 << QString::fromLatin1(choice->choice);
574 m_printDevice->setProperty(PDPK_PpdOption, values);
575 emit ppdOptionChanged();
584 if (m_pageLayout.orientation() == QPageLayout::Landscape)
585 customSize = QSizeF(m_ui.pageHeight->value(), m_ui.pageWidth->value());
587 customSize = QSizeF(m_ui.pageWidth->value(), m_ui.pageHeight->value());
588 pageSize = QPageSize(customSize, QPageSize::Unit(m_units));
591 if (m_pageSizePpdOption) {
592 const auto values = QStringList{} << QString::fromLatin1(m_pageSizePpdOption->keyword)
593 << QStringLiteral(
"Custom");
594 m_printDevice->setProperty(PDPK_PpdOption, values);
595 emit ppdOptionChanged();
605 const QMarginsF printable = m_printDevice ? m_printDevice->printableMargins(pageSize, m_pageLayout.orientation(), m_printer->resolution())
607 m_pageLayout.setPageSize(pageSize, qt_convertMargins(printable, QPageLayout::Point, m_pageLayout.units()));
608 m_pagePreview->setPageLayout(m_pageLayout);
617 m_pageLayout.setOrientation(m_ui.portrait->isChecked() ? QPageLayout::Portrait : QPageLayout::Landscape);
618 m_pagePreview->setPageLayout(m_pageLayout);
625 switch (m_ui.pagesPerSheetCombo->currentData().toInt()) {
626 case QCUPSSupport::OnePagePerSheet:
627 m_pagePreview->setPagePreviewLayout(1, 1);
629 case QCUPSSupport::TwoPagesPerSheet:
630 m_pagePreview->setPagePreviewLayout(1, 2);
632 case QCUPSSupport::FourPagesPerSheet:
633 m_pagePreview->setPagePreviewLayout(2, 2);
635 case QCUPSSupport::SixPagesPerSheet:
636 m_pagePreview->setPagePreviewLayout(3, 2);
638 case QCUPSSupport::NinePagesPerSheet:
639 m_pagePreview->setPagePreviewLayout(3, 3);
641 case QCUPSSupport::SixteenPagesPerSheet:
642 m_pagePreview->setPagePreviewLayout(4, 4);
652 m_units = qvariant_cast<QPageLayout::Unit>(m_ui.unitCombo->currentData());
653 m_pageLayout.setUnits(m_units);
661 m_pageLayout.setTopMargin(newValue);
662 m_pagePreview->setPageLayout(m_pageLayout);
669 m_pageLayout.setBottomMargin(newValue);
670 m_pagePreview->setPageLayout(m_pageLayout);
677 m_pageLayout.setLeftMargin(newValue);
678 m_pagePreview->setPageLayout(m_pageLayout);
685 m_pageLayout.setRightMargin(newValue);
686 m_pagePreview->setPageLayout(m_pageLayout);
692QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent)
693 : QDialog(*(
new QUnixPageSetupDialogPrivate(printer)), parent)
695 Q_D(QPageSetupDialog);
696 setWindowTitle(QCoreApplication::translate(
"QPrintPreviewDialog",
"Page Setup"));
697 static_cast<QUnixPageSetupDialogPrivate *>(d)->init();
700QPageSetupDialog::QPageSetupDialog(QWidget *parent)
701 : QDialog(*(
new QUnixPageSetupDialogPrivate(
nullptr)), parent)
703 Q_D(QPageSetupDialog);
704 setWindowTitle(QCoreApplication::translate(
"QPrintPreviewDialog",
"Page Setup"));
705 static_cast<QUnixPageSetupDialogPrivate *>(d)->init();
708int QPageSetupDialog::exec()
710 Q_D(QPageSetupDialog);
712 int ret = QDialog::exec();
713 if (ret == Accepted) {
714 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->setupPrinter();
715 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->updateSavedValues();
717 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->revertToSavedValues();
724#include "moc_qpagesetupdialog_unix_p.cpp"
726#include "moc_qpagesetupdialog.cpp"
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 revertToSavedValues()
void setPrinter(QPrinter *printer, QPrintDevice *printDevice, QPrinter::OutputFormat outputFormat, const QString &printerName)
void setupPrinter() const
QPainter(QPaintDevice *)
Constructs a painter that begins painting the paint device immediately.
QPageSetupWidget * widget
~QUnixPageSetupDialogPrivate()
QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits)