summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextformat.cpp
diff options
context:
space:
mode:
authorDaniel Savi <public@gaess.ch>2018-02-28 16:10:32 +0100
committerAndré Hartmann <aha_1980@gmx.de>2018-04-22 12:47:26 +0000
commit84eb9b5e30266e0b81ae5465f2449d371894258f (patch)
tree814c99e34dbf6b292d0f15ad267ce7d85f021a76 /src/gui/text/qtextformat.cpp
parentb3bbba7b871144c5d6f4b1a432f5c2cce02e321f (diff)
Add image quality handling to QTextImageFormat
This patch enhances QTextImageFormat with a property for image quality. Default will be quality of 100. The user may set different values with setQuality(int). QTextODFexport will export images as png if quality is set to 100 and as jpg with the compression quality set to the given value if smaller than 100. [ChangeLog][QtGui][QTextImageFormat] Adds two new functions to the class: setQuality(int=100) and quality(). Is currently used by QTextODFWriter to determine the image type and quality when exporting images to ODT files. Change-Id: Iaa8ec0246aaba004d98c9e8c66609795101519a9 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text/qtextformat.cpp')
-rw-r--r--src/gui/text/qtextformat.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 749a287941..4957da1908 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -3077,7 +3077,8 @@ QTextTableFormat::QTextTableFormat(const QTextFormat &fmt)
REPLACEMENT CHARACTER) which has an associated QTextImageFormat. The
image format specifies a name with setName() that is used to
locate the image. The size of the rectangle that the image will
- occupy is specified using setWidth() and setHeight().
+ occupy is specified in pixels using setWidth() and setHeight().
+ The desired image quality may be set with setQuality().
Images can be supplied in any format for which Qt has an image
reader, so SVG drawings can be included alongside PNG, TIFF and
@@ -3167,6 +3168,28 @@ QTextImageFormat::QTextImageFormat(const QTextFormat &fmt)
*/
/*!
+ \fn void QTextImageFormat::setQuality(int quality = 100)
+ \since 5.12
+
+ Sets the quality that should be used by exporters when exporting the image. QTextDocumentWriter
+ will export jpg images with the \a quality set here when exporting to ODF files if \a quality is
+ set to a value between 0 and 100. Or it will export png images if \a quality is set to 100
+ (default) or greater.
+
+ \sa quality()
+*/
+
+
+/*!
+ \fn qreal QTextImageFormat::quality() const
+ \since 5.12
+
+ Returns the value set by setQuality().
+
+ \sa setQuality()
+*/
+
+/*!
\fn void QTextCharFormat::setFontCapitalization(QFont::Capitalization capitalization)
\since 4.4