summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qabstracttextdocumentlayout.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-05-10 20:20:00 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-05-24 15:37:04 +0200
commit2c8fa9700cb1eb5f1587bec46b7060ec93c6b1d2 (patch)
tree9a7743c8818999c65193583d92ed10cd1fc3794d /src/gui/text/qabstracttextdocumentlayout.h
parent12e0c7cbe0be22c288413080a1d1bd3beafb3008 (diff)
Support clicking to toggle checkboxes in QTextEdit
Add QAbstractTextDocumentLayout::markerAt(pos) for hit testing. (Qt Quick TextEdit needs it too.) Finds out whether the position corresponds to a marker on a paragraph. I.e. it finds checkboxes in GitHub-flavored markdown. This enables editor classes to toggle checkboxes by clicking them. Use it in QTextEdit to add the checkbox toggling feature. Also show the "pointing finger" cursor when hovering a toggleable checkbox. Change-Id: I036c967ab45e14c836272eac2cc7c7d652543c89 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/gui/text/qabstracttextdocumentlayout.h')
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qabstracttextdocumentlayout.h b/src/gui/text/qabstracttextdocumentlayout.h
index 3371401420..397dcd37d4 100644
--- a/src/gui/text/qabstracttextdocumentlayout.h
+++ b/src/gui/text/qabstracttextdocumentlayout.h
@@ -87,6 +87,7 @@ public:
QString anchorAt(const QPointF& pos) const;
QString imageAt(const QPointF &pos) const;
QTextFormat formatAt(const QPointF &pos) const;
+ QTextBlock blockWithMarkerAt(const QPointF &pos) const;
virtual int pageCount() const = 0;
virtual QSizeF documentSize() const = 0;