diff options
Diffstat (limited to 'src/printsupport/dialogs')
-rw-r--r-- | src/printsupport/dialogs/qpagesetupdialog_unix.cpp | 16 | ||||
-rw-r--r-- | src/printsupport/dialogs/qprintdialog_unix.cpp | 20 | ||||
-rw-r--r-- | src/printsupport/dialogs/qprintsettingsoutput.ui | 8 |
3 files changed, 22 insertions, 22 deletions
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp index 1d8af9dbf0..78e5b8d1ef 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp +++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp @@ -533,10 +533,10 @@ void QPageSetupWidget::setupPrinter() const { m_printer->setPageLayout(m_pageLayout); #if QT_CONFIG(cups) - QCUPSSupport::PagesPerSheet pagesPerSheet = m_ui.pagesPerSheetCombo->currentData() - .value<QCUPSSupport::PagesPerSheet>(); - QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = m_ui.pagesPerSheetLayoutCombo->currentData() - .value<QCUPSSupport::PagesPerSheetLayout>(); + QCUPSSupport::PagesPerSheet pagesPerSheet = qvariant_cast<QCUPSSupport::PagesPerSheet>(m_ui.pagesPerSheetCombo->currentData() +); + QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = qvariant_cast<QCUPSSupport::PagesPerSheetLayout>(m_ui.pagesPerSheetLayoutCombo->currentData() +); QCUPSSupport::setPagesPerSheetLayout(m_printer, pagesPerSheet, pagesPerSheetLayout); #endif #ifdef PSD_ENABLE_PAPERSOURCE @@ -587,11 +587,11 @@ void QPageSetupWidget::pageSizeChanged() { QPageSize pageSize; if (m_ui.pageSizeCombo->currentIndex() != m_realCustomPageSizeIndex) { - pageSize = m_ui.pageSizeCombo->currentData().value<QPageSize>(); + pageSize = qvariant_cast<QPageSize>(m_ui.pageSizeCombo->currentData()); #if QT_CONFIG(cups) if (m_pageSizePpdOption) { - ppd_file_t *ppd = m_printDevice->property(PDPK_PpdFile).value<ppd_file_t*>(); + ppd_file_t *ppd = qvariant_cast<ppd_file_t*>(m_printDevice->property(PDPK_PpdFile)); QTextCodec *cupsCodec = QTextCodec::codecForName(ppd->lang_encoding); for (int i = 0; i < m_pageSizePpdOption->num_choices; ++i) { const ppd_choice_t *choice = &m_pageSizePpdOption->choices[i]; @@ -676,7 +676,7 @@ void QPageSetupWidget::unitChanged() { if (m_blockSignals) return; - m_units = m_ui.unitCombo->currentData().value<QPageLayout::Unit>(); + m_units = qvariant_cast<QPageLayout::Unit>(m_ui.unitCombo->currentData()); m_pageLayout.setUnits(m_units); updateWidget(); } @@ -725,7 +725,7 @@ QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent) } QPageSetupDialog::QPageSetupDialog(QWidget *parent) - : QDialog(*(new QUnixPageSetupDialogPrivate(0)), parent) + : QDialog(*(new QUnixPageSetupDialogPrivate(nullptr)), parent) { Q_D(QPageSetupDialog); setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup")); diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 7bbf137977..bf77666c41 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -426,7 +426,7 @@ bool QPrintPropertiesDialog::createAdvancedOptionsWidget() { bool anyWidgetCreated = false; - ppd_file_t *ppd = m_currentPrintDevice->property(PDPK_PpdFile).value<ppd_file_t*>(); + ppd_file_t *ppd = qvariant_cast<ppd_file_t*>(m_currentPrintDevice->property(PDPK_PpdFile)); if (ppd) { m_cupsCodec = QTextCodec::codecForName(ppd->lang_encoding); @@ -532,7 +532,7 @@ bool QPrintPropertiesDialog::createAdvancedOptionsWidget() void QPrintPropertiesDialog::setPrinterAdvancedCupsOptions() const { for (const QComboBox *choicesCb : m_advancedOptionsCombos) { - const ppd_option_t *option = choicesCb->property(ppdOptionProperty).value<const ppd_option_t *>(); + const ppd_option_t *option = qvariant_cast<const ppd_option_t *>(choicesCb->property(ppdOptionProperty)); // We can't use choicesCb->currentIndex() to know the index of the option in the choices[] array // because some of them may not be present in the list because they conflict with the @@ -551,7 +551,7 @@ void QPrintPropertiesDialog::setPrinterAdvancedCupsOptions() const void QPrintPropertiesDialog::revertAdvancedOptionsToSavedValues() const { for (QComboBox *choicesCb : m_advancedOptionsCombos) { - const int originallySelectedChoice = choicesCb->property(ppdOriginallySelectedChoiceProperty).value<int>(); + const int originallySelectedChoice = qvariant_cast<int>(choicesCb->property(ppdOriginallySelectedChoiceProperty)); const int newComboIndexToSelect = choicesCb->findData(originallySelectedChoice); choicesCb->setCurrentIndex(newComboIndexToSelect); // The currentIndexChanged lambda takes care of resetting the ppd option @@ -580,8 +580,8 @@ bool QPrintPropertiesDialog::anyAdvancedOptionConflict() const bool anyConflicted = false; for (const QComboBox *choicesCb : m_advancedOptionsCombos) { - const ppd_option_t *option = choicesCb->property(ppdOptionProperty).value<const ppd_option_t *>(); - QLabel *warningLabel = choicesCb->property(warningLabelProperty).value<QLabel *>(); + const ppd_option_t *option = qvariant_cast<const ppd_option_t *>(choicesCb->property(ppdOptionProperty)); + QLabel *warningLabel = qvariant_cast<QLabel *>(choicesCb->property(warningLabelProperty)); if (option->conflicted) { anyConflicted = true; const int pixmap_size = choicesCb->sizeHint().height() * .75; @@ -902,7 +902,7 @@ void QPrintDialogPrivate::setupPrinter() // page set if (p->printRange() == QPrinter::AllPages || p->printRange() == QPrinter::PageRange) { //If the application is selecting pages and the first page number is even then need to adjust the odd-even accordingly - QCUPSSupport::PageSet pageSet = options.pageSetCombo->itemData(options.pageSetCombo->currentIndex()).value<QCUPSSupport::PageSet>(); + QCUPSSupport::PageSet pageSet = qvariant_cast<QCUPSSupport::PageSet>(options.pageSetCombo->itemData(options.pageSetCombo->currentIndex())); if (q->isOptionEnabled(QPrintDialog::PrintPageRange) && p->printRange() == QPrinter::PageRange && (q->fromPage() % 2 == 0)) { @@ -1178,7 +1178,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p, QPrinter * void QUnixPrintWidgetPrivate::updateWidget() { - const bool printToFile = q == 0 || q->isOptionEnabled(QPrintDialog::PrintToFile); + const bool printToFile = q == nullptr || q->isOptionEnabled(QPrintDialog::PrintToFile); if (printToFile && !filePrintersAdded) { if (widget.printers->count()) widget.printers->insertSeparator(widget.printers->count()); @@ -1325,10 +1325,10 @@ bool QUnixPrintWidgetPrivate::checkFields() #if QT_CONFIG(cups) if (propertiesDialog) { - QCUPSSupport::PagesPerSheet pagesPerSheet = propertiesDialog->widget.pageSetup->m_ui.pagesPerSheetCombo - ->currentData().value<QCUPSSupport::PagesPerSheet>(); + QCUPSSupport::PagesPerSheet pagesPerSheet = qvariant_cast<QCUPSSupport::PagesPerSheet>(propertiesDialog->widget.pageSetup->m_ui.pagesPerSheetCombo + ->currentData()); - QCUPSSupport::PageSet pageSet = optionsPane->options.pageSetCombo->currentData().value<QCUPSSupport::PageSet>(); + QCUPSSupport::PageSet pageSet = qvariant_cast<QCUPSSupport::PageSet>(optionsPane->options.pageSetCombo->currentData()); if (pagesPerSheet != QCUPSSupport::OnePagePerSheet diff --git a/src/printsupport/dialogs/qprintsettingsoutput.ui b/src/printsupport/dialogs/qprintsettingsoutput.ui index 290111a98c..360634aaa7 100644 --- a/src/printsupport/dialogs/qprintsettingsoutput.ui +++ b/src/printsupport/dialogs/qprintsettingsoutput.ui @@ -351,13 +351,13 @@ <item row="0" column="0"> <widget class="QGroupBox" name="duplex"> <property name="title"> - <string>Duplex Printing</string> + <string>Double Sided Printing</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QRadioButton" name="noDuplex"> <property name="text"> - <string>None</string> + <string>Off</string> </property> <property name="checked"> <bool>true</bool> @@ -367,14 +367,14 @@ <item> <widget class="QRadioButton" name="duplexLong"> <property name="text"> - <string>Long side</string> + <string>Long side binding</string> </property> </widget> </item> <item> <widget class="QRadioButton" name="duplexShort"> <property name="text"> - <string>Short side</string> + <string>Short side binding</string> </property> </widget> </item> |