diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-05-10 20:20:00 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-05-24 15:37:04 +0200 |
commit | 2c8fa9700cb1eb5f1587bec46b7060ec93c6b1d2 (patch) | |
tree | 9a7743c8818999c65193583d92ed10cd1fc3794d /src/widgets/widgets/qtextedit.h | |
parent | 12e0c7cbe0be22c288413080a1d1bd3beafb3008 (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/widgets/widgets/qtextedit.h')
-rw-r--r-- | src/widgets/widgets/qtextedit.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h index 3b7e610786..09ef44b7b2 100644 --- a/src/widgets/widgets/qtextedit.h +++ b/src/widgets/widgets/qtextedit.h @@ -331,6 +331,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars()) Q_PRIVATE_SLOT(d_func(), void _q_ensureVisible(const QRectF &)) Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_hoveredBlockWithMarkerChanged(const QTextBlock &)) friend class QTextEditControl; friend class QTextDocument; friend class QWidgetTextControl; |