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_ui.pageSizeCombo->currentIndex() == m_realCustomPageSizeIndex && m_realCustomPageSizeIndex != -1;
439 m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(m_pageLayout.pageSize())));
444 if (m_pageLayout.mode() == QPageLayout::FullPageMode) {
445 min = QMarginsF(0.0, 0.0, 0.0, 0.0);
446 max = QMarginsF(9999.9999, 9999.9999, 9999.9999, 9999.9999);
448 min = m_pageLayout.minimumMargins();
449 max = m_pageLayout.maximumMargins();
452 m_ui.leftMargin->setSuffix(suffix);
453 m_ui.leftMargin->setMinimum(min.left());
454 m_ui.leftMargin->setMaximum(max.left());
455 m_ui.leftMargin->setValue(m_pageLayout.margins().left());
457 m_ui.rightMargin->setSuffix(suffix);
458 m_ui.rightMargin->setMinimum(min.right());
459 m_ui.rightMargin->setMaximum(max.right());
460 m_ui.rightMargin->setValue(m_pageLayout.margins().right());
462 m_ui.topMargin->setSuffix(suffix);
463 m_ui.topMargin->setMinimum(min.top());
464 m_ui.topMargin->setMaximum(max.top());
465 m_ui.topMargin->setValue(m_pageLayout.margins().top());
467 m_ui.bottomMargin->setSuffix(suffix);
468 m_ui.bottomMargin->setMinimum(min.bottom());
469 m_ui.bottomMargin->setMaximum(max.bottom());
470 m_ui.bottomMargin->setValue(m_pageLayout.margins().bottom());
472 m_ui.pageWidth->setSuffix(suffix);
473 m_ui.pageWidth->setValue(m_pageLayout.fullRect(m_units).width());
474 m_ui.pageWidth->setEnabled(isCustom);
475 m_ui.widthLabel->setEnabled(isCustom);
477 m_ui.pageHeight->setSuffix(suffix);
478 m_ui.pageHeight->setValue(m_pageLayout.fullRect(m_units).height());
479 m_ui.pageHeight->setEnabled(isCustom);
480 m_ui.heightLabel->setEnabled(isCustom);
482 m_ui.portrait->setChecked(m_pageLayout.orientation() == QPageLayout::Portrait);
483 m_ui.landscape->setChecked(m_pageLayout.orientation() == QPageLayout::Landscape);
485 m_ui.pagesPerSheetButtonGroup->setEnabled(m_outputFormat == QPrinter::NativeFormat);
487#ifdef PSD_ENABLE_PAPERSOURCE
488 m_ui.paperSource->setCurrentItem(printer->paperSource());
491 m_blockSignals =
false;
498 m_printer->setPageLayout(m_pageLayout);
499 m_printer->setPageOrientation(m_pageLayout.orientation());
501 QCUPSSupport::PagesPerSheet pagesPerSheet = qvariant_cast<QCUPSSupport::PagesPerSheet>(m_ui.pagesPerSheetCombo->currentData()
503 QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = qvariant_cast<QCUPSSupport::PagesPerSheetLayout>(m_ui.pagesPerSheetLayoutCombo->currentData()
505 QCUPSSupport::setPagesPerSheetLayout(m_printer, pagesPerSheet, pagesPerSheetLayout);
507#ifdef PSD_ENABLE_PAPERSOURCE
508 m_printer->setPaperSource((QPrinter::PaperSource)m_ui.paperSource->currentIndex());
514 m_savedUnits = m_units;
515 m_savedPageLayout = m_pageLayout;
516 m_savedPagesPerSheet = m_ui.pagesPerSheetCombo->currentIndex();
517 m_savedPagesPerSheetLayout = m_ui.pagesPerSheetLayoutCombo->currentIndex();
522 m_units = m_savedUnits;
523 m_pageLayout = m_savedPageLayout;
524 m_pagePreview->setPageLayout(m_pageLayout);
528 m_ui.pagesPerSheetCombo->setCurrentIndex(m_savedPagesPerSheet);
529 m_ui.pagesPerSheetLayoutCombo->setCurrentIndex(m_savedPagesPerSheetLayout);
533bool QPageSetupWidget::hasPpdConflict()
const
535 if (m_pageSizePpdOption) {
536 if (m_pageSizePpdOption->conflicted) {
537 const QIcon warning = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning,
nullptr,
nullptr);
538 const int pixmap_size = m_ui.pageSizeCombo->sizeHint().height() * .75;
539 m_ui.pageSizeWarningLabel->setPixmap(warning.pixmap(pixmap_size, pixmap_size));
541 m_ui.pageSizeWarningLabel->setPixmap(QPixmap());
543 return m_pageSizePpdOption->conflicted;
554 if (m_ui.pageSizeCombo->currentIndex() != m_realCustomPageSizeIndex) {
555 pageSize = qvariant_cast<QPageSize>(m_ui.pageSizeCombo->currentData());
558 if (m_pageSizePpdOption) {
559 ppd_file_t *ppd = qvariant_cast<ppd_file_t*>(m_printDevice->property(PDPK_PpdFile));
560 QStringDecoder toUtf16(ppd->lang_encoding, QStringDecoder::Flag::Stateless);
561 if (!toUtf16.isValid()) {
562 qWarning() <<
"QPrinSupport: Cups uses unsupported encoding" << ppd->lang_encoding;
563 toUtf16 = QStringDecoder(QStringDecoder::Utf8);
565 for (
int i = 0; i < m_pageSizePpdOption->num_choices; ++i) {
566 const ppd_choice_t *choice = &m_pageSizePpdOption->choices[i];
567 if (toUtf16(choice->text) == m_ui.pageSizeCombo->currentText()) {
568 const auto values = QStringList{} << QString::fromLatin1(m_pageSizePpdOption->keyword)
569 << QString::fromLatin1(choice->choice);
570 m_printDevice->setProperty(PDPK_PpdOption, values);
571 emit ppdOptionChanged();
580 if (m_pageLayout.orientation() == QPageLayout::Landscape)
581 customSize = QSizeF(m_ui.pageHeight->value(), m_ui.pageWidth->value());
583 customSize = QSizeF(m_ui.pageWidth->value(), m_ui.pageHeight->value());
584 pageSize = QPageSize(customSize, QPageSize::Unit(m_units));
587 if (m_pageSizePpdOption) {
588 const auto values = QStringList{} << QString::fromLatin1(m_pageSizePpdOption->keyword)
589 << QStringLiteral(
"Custom");
590 m_printDevice->setProperty(PDPK_PpdOption, values);
591 emit ppdOptionChanged();
601 const QMarginsF printable = m_printDevice ? m_printDevice->printableMargins(pageSize, m_pageLayout.orientation(), m_printer->resolution())
603 m_pageLayout.setPageSize(pageSize, qt_convertMargins(printable, QPageLayout::Point, m_pageLayout.units()));
604 m_pagePreview->setPageLayout(m_pageLayout);
613 m_pageLayout.setOrientation(m_ui.portrait->isChecked() ? QPageLayout::Portrait : QPageLayout::Landscape);
614 m_pagePreview->setPageLayout(m_pageLayout);
621 switch (m_ui.pagesPerSheetCombo->currentData().toInt()) {
622 case QCUPSSupport::OnePagePerSheet:
623 m_pagePreview->setPagePreviewLayout(1, 1);
625 case QCUPSSupport::TwoPagesPerSheet:
626 m_pagePreview->setPagePreviewLayout(1, 2);
628 case QCUPSSupport::FourPagesPerSheet:
629 m_pagePreview->setPagePreviewLayout(2, 2);
631 case QCUPSSupport::SixPagesPerSheet:
632 m_pagePreview->setPagePreviewLayout(3, 2);
634 case QCUPSSupport::NinePagesPerSheet:
635 m_pagePreview->setPagePreviewLayout(3, 3);
637 case QCUPSSupport::SixteenPagesPerSheet:
638 m_pagePreview->setPagePreviewLayout(4, 4);
648 m_units = qvariant_cast<QPageLayout::Unit>(m_ui.unitCombo->currentData());
649 m_pageLayout.setUnits(m_units);
657 m_pageLayout.setTopMargin(newValue);
658 m_pagePreview->setPageLayout(m_pageLayout);
665 m_pageLayout.setBottomMargin(newValue);
666 m_pagePreview->setPageLayout(m_pageLayout);
673 m_pageLayout.setLeftMargin(newValue);
674 m_pagePreview->setPageLayout(m_pageLayout);
681 m_pageLayout.setRightMargin(newValue);
682 m_pagePreview->setPageLayout(m_pageLayout);
688QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent)
689 : QDialog(*(
new QUnixPageSetupDialogPrivate(printer)), parent)
691 Q_D(QPageSetupDialog);
692 setWindowTitle(QCoreApplication::translate(
"QPrintPreviewDialog",
"Page Setup"));
693 static_cast<QUnixPageSetupDialogPrivate *>(d)->init();
696QPageSetupDialog::QPageSetupDialog(QWidget *parent)
697 : QDialog(*(
new QUnixPageSetupDialogPrivate(
nullptr)), parent)
699 Q_D(QPageSetupDialog);
700 setWindowTitle(QCoreApplication::translate(
"QPrintPreviewDialog",
"Page Setup"));
701 static_cast<QUnixPageSetupDialogPrivate *>(d)->init();
704int QPageSetupDialog::exec()
706 Q_D(QPageSetupDialog);
708 int ret = QDialog::exec();
709 if (ret == Accepted) {
710 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->setupPrinter();
711 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->updateSavedValues();
713 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->revertToSavedValues();
720#include "moc_qpagesetupdialog_unix_p.cpp"
722#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)