summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qabstracttextdocumentlayout.h
diff options
context:
space:
mode:
authorAlberto Mardegan <info@mardy.it>2015-07-26 19:43:26 +0300
committerKonstantin Ritt <ritt.ks@gmail.com>2016-03-18 19:02:13 +0000
commitfb6000a74f57bd3c096f6a10142477bf2faf0ff2 (patch)
tree393d3013c4adf8fec9df787b0d06e43fc33ef832 /src/gui/text/qabstracttextdocumentlayout.h
parent92f9a7780e381f2b1336d965a9a5b171ae39144c (diff)
Add QAbstractTextDocumentLayout::imageAt(), formatAt()
The new imageAt() method pairs with the existing anchorAt() method, and allows retrieving the source link of the image under the cursor. We also expose the common logic between these two methods as an additional formatAt() method. [ChangeLog][QtGui][QAbstractTextDocumentLayout] Added imageAt() and formatAt() methods, which respectively can be used to retrieve the source link of the image under the cursor, or the QTextFormat of the text under the cursor. Change-Id: If09815dde91de6616edcb19c72c462dbf7abd8ef Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qabstracttextdocumentlayout.h')
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qabstracttextdocumentlayout.h b/src/gui/text/qabstracttextdocumentlayout.h
index e83f4fc0c9..d363188742 100644
--- a/src/gui/text/qabstracttextdocumentlayout.h
+++ b/src/gui/text/qabstracttextdocumentlayout.h
@@ -82,7 +82,10 @@ public:
virtual void draw(QPainter *painter, const PaintContext &context) = 0;
virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const = 0;
+
QString anchorAt(const QPointF& pos) const;
+ QString imageAt(const QPointF &pos) const;
+ QTextFormat formatAt(const QPointF &pos) const;
virtual int pageCount() const = 0;
virtual QSizeF documentSize() const = 0;