[PyQt] Getting length of QTextEdit without calling w.toPlainText

Edward K. Ream edreamleo at gmail.com
Tue Nov 4 16:48:33 GMT 2008


On Mon, Nov 3, 2008 at 11:22 AM, Vicent Mas <uvemas at gmail.com> wrote:
> Hi,
>
> I suppose you can use the QTextCursor, move it to the end of your document and
> then call  its position method (but I haven't tested it).

Thanks.  The following does indeed work

    cursor = w.textCursor()
    cursor.movePosition(QtGui.QTextCursor.End)
    return cursor.position()

Edward


More information about the PyQt mailing list