summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextimagehandler.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-09-20 10:19:18 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-21 13:46:08 +0200
commit0992a24653eacf2f32741dce91c54980a7cefe10 (patch)
treec5c0b5527635ff26f87e0828730c29f30750614c /src/gui/text/qtextimagehandler.cpp
parentbc60b6787c791be0168820c42febfdb57b5070e0 (diff)
Export QTextImageHandler and add accessor for image
To allow optimizations in the scene graph, we export the private QTextImageHandler class and add a function which will fetch a given image when required, or return the cached image in the document resources. Task-number: QTBUG-20917 Change-Id: If45e51b0d9a267bc198623165e7a2cc1fb2b961f Reviewed-on: http://codereview.qt-project.org/5227 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/gui/text/qtextimagehandler.cpp')
-rw-r--r--src/gui/text/qtextimagehandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp
index fcc13a58ff..138fb1a168 100644
--- a/src/gui/text/qtextimagehandler.cpp
+++ b/src/gui/text/qtextimagehandler.cpp
@@ -217,6 +217,13 @@ QSizeF QTextImageHandler::intrinsicSize(QTextDocument *doc, int posInDocument, c
return getPixmapSize(doc, imageFormat);
}
+QImage QTextImageHandler::image(QTextDocument *doc, const QTextImageFormat &imageFormat)
+{
+ Q_ASSERT(doc != 0);
+
+ return getImage(doc, imageFormat);
+}
+
void QTextImageHandler::drawObject(QPainter *p, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format)
{
Q_UNUSED(posInDocument)