summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcursor.h
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-02-19 17:45:23 (GMT)
committermae <qt-info@nokia.com>2010-02-19 17:56:16 (GMT)
commit402da10939d1d3a5973caaf9deaef0f9f10d834a (patch)
treedc55f2d61e058dfbbe359e6dba92e02765f806ff /src/gui/text/qtextcursor.h
parentc578256dc2b7d124f5fb2ac75a04cd6c17c1d0cc (diff)
downloadQt-402da10939d1d3a5973caaf9deaef0f9f10d834a.zip
Qt-402da10939d1d3a5973caaf9deaef0f9f10d834a.tar.gz
Qt-402da10939d1d3a5973caaf9deaef0f9f10d834a.tar.bz2
Add convenience function QTextCursor::positionInBlock()
We have a missleading function QTextCursor::columnNumber() since 4.2, which almost never returns what you want. The pattern cursor.position() - cursor.block().position() is used frequently in code using QTextCursor. Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/gui/text/qtextcursor.h')
-rw-r--r--src/gui/text/qtextcursor.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h
index 38bc39d..3e968a3 100644
--- a/src/gui/text/qtextcursor.h
+++ b/src/gui/text/qtextcursor.h
@@ -89,6 +89,7 @@ public:
void setPosition(int pos, MoveMode mode = MoveAnchor);
int position() const;
+ int positionInBlock() const;
int anchor() const;