Validate printer duplex mode
Disable unavailable duplex options Remove redundant option on advanced tab Change-Id: Ie09c9ffd637b521210e3d7d4f15300792f910996 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
This commit is contained in:
parent
ca4a76350a
commit
f6fd3f18d3
@ -520,6 +520,11 @@ void QPrintDialogPrivate::selectPrinter(const QPrinter::OutputFormat outputForma
|
||||
QPrinter *p = q->printer();
|
||||
printerOutputFormat = outputFormat;
|
||||
|
||||
// printer supports duplex mode?
|
||||
const auto supportedDuplexMode = top->d->m_currentPrintDevice.supportedDuplexModes();
|
||||
options.duplexLong->setEnabled(supportedDuplexMode.contains(QPrint::DuplexLongSide));
|
||||
options.duplexShort->setEnabled(supportedDuplexMode.contains(QPrint::DuplexShortSide));
|
||||
|
||||
if (p->colorMode() == QPrinter::Color)
|
||||
options.color->setChecked(true);
|
||||
else
|
||||
@ -1319,7 +1324,8 @@ static bool isBlacklistedOption(const char *keyword) Q_DECL_NOTHROW
|
||||
"Copies",
|
||||
"OutputOrder",
|
||||
"PageRegion",
|
||||
"PageSize"
|
||||
"PageSize",
|
||||
"Duplex" // handled by the main dialog
|
||||
};
|
||||
auto equals = [](const char *keyword) {
|
||||
return [keyword](const char *candidate) {
|
||||
|
Loading…
Reference in New Issue
Block a user