Printing: Expose default and supported color modes
We had this information internally but there was no public API for it Fixes: QTBUG-4071 Change-Id: Ic7f855e32a6870129e7723a47d31a629e0ea1aca Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This commit is contained in:
parent
e8fd992849
commit
b6427ded65
@ -387,6 +387,35 @@ QList<QPrinter::DuplexMode> QPrinterInfo::supportedDuplexModes() const
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the default color mode of this printer.
|
||||||
|
|
||||||
|
\since 5.13
|
||||||
|
*/
|
||||||
|
|
||||||
|
QPrinter::ColorMode QPrinterInfo::defaultColorMode() const
|
||||||
|
{
|
||||||
|
Q_D(const QPrinterInfo);
|
||||||
|
return QPrinter::ColorMode(d->m_printDevice.defaultColorMode());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the supported color modes of this printer.
|
||||||
|
|
||||||
|
\since 5.13
|
||||||
|
*/
|
||||||
|
|
||||||
|
QList<QPrinter::ColorMode> QPrinterInfo::supportedColorModes() const
|
||||||
|
{
|
||||||
|
Q_D(const QPrinterInfo);
|
||||||
|
QList<QPrinter::ColorMode> list;
|
||||||
|
const auto supportedColorModes = d->m_printDevice.supportedColorModes();
|
||||||
|
list.reserve(supportedColorModes.size());
|
||||||
|
for (QPrint::ColorMode mode : supportedColorModes)
|
||||||
|
list << QPrinter::ColorMode(mode);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a list of all the available Printer Names on this system.
|
Returns a list of all the available Printer Names on this system.
|
||||||
|
|
||||||
|
@ -93,6 +93,9 @@ public:
|
|||||||
QPrinter::DuplexMode defaultDuplexMode() const;
|
QPrinter::DuplexMode defaultDuplexMode() const;
|
||||||
QList<QPrinter::DuplexMode> supportedDuplexModes() const;
|
QList<QPrinter::DuplexMode> supportedDuplexModes() const;
|
||||||
|
|
||||||
|
QPrinter::ColorMode defaultColorMode() const;
|
||||||
|
QList<QPrinter::ColorMode> supportedColorModes() const;
|
||||||
|
|
||||||
static QStringList availablePrinterNames();
|
static QStringList availablePrinterNames();
|
||||||
static QList<QPrinterInfo> availablePrinters();
|
static QList<QPrinterInfo> availablePrinters();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user