diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-02-01 17:22:03 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-02-03 00:04:37 +0100 |
commit | 3a7cda715a9d409c249f91e320a9e1f8e9276f37 (patch) | |
tree | 34355b0f095791bba6369c56391389ba1f9c8c34 /src/gui/painting | |
parent | e35dcba5bb8cdcf578a514ad6e03ae64002c2c3a (diff) |
QPdfWriter: switch the default color model to Auto
If a user specifies a color in CMYK, save it in CMYK by default
(instead of converting it to RGB).
[ChangeLog][QtGui][QPdfWriter] QPdfWriter by default will now
save CMYK colors in CMYK, instead of converting them to RGB.
You can use the setColorModel() function to restore the previous
behavior.
Change-Id: I2a699f99d44c106d59bf0e32c11f9cf9999d16e8
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpdf.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpdfwriter.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index f44a95ae7c..73117d38fc 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1436,7 +1436,7 @@ int QPdfEngine::metric(QPaintDevice::PaintDeviceMetric metricType) const QPdfEnginePrivate::QPdfEnginePrivate() : clipEnabled(false), allClipped(false), hasPen(true), hasBrush(false), simplePen(false), needsTransform(false), pdfVersion(QPdfEngine::Version_1_4), - colorModel(QPdfEngine::ColorModel::RGB), + colorModel(QPdfEngine::ColorModel::Auto), outDevice(nullptr), ownsDevice(false), embedFonts(true), m_pageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(10, 10, 10, 10)) diff --git a/src/gui/painting/qpdfwriter.cpp b/src/gui/painting/qpdfwriter.cpp index b3b6f3d310..50db7465bd 100644 --- a/src/gui/painting/qpdfwriter.cpp +++ b/src/gui/painting/qpdfwriter.cpp @@ -304,7 +304,7 @@ bool QPdfWriter::newPage() QPen and QBrush). \value RGB All colors are converted to RGB and saved as such in the - PDF. This is the default. + PDF. \value Grayscale All colors are converted to grayscale. For backwards compatibility, they are emitted in the PDF output as RGB colors, with @@ -314,6 +314,7 @@ bool QPdfWriter::newPage() \value Auto RGB colors are emitted as RGB; CMYK colors are emitted as CMYK. Colors of any other color spec are converted to RGB. + This is the default since Qt 6.8. \sa QColor, QGradient */ |