QQQ
As you can see, w does not report the new insertion point immediately:
getInsertPoint: 0 <PyQt4.QtGui.QTextEdit object at 0x017706A8>
setInsertPoint: 48 <PyQt4.QtGui.QTextEdit object at 0x017706A8>
getInsertPoint: 0 <PyQt4.QtGui.QTextEdit object at 0x017706A8> # Oops.
QQQ
Mystery solved. w.textCursor returns a copy of the cursor, so instead of::
w.textCursor().setPosition(i)
the following will work::
cursor = w.textCursor()
cursor.setPosition(i)
w.setTextCursor(cursor)
This is clearly explained in the docs. Still,
QTextEdit.setCursorPosition would be a natural convenience method.
Edward
--------------------------------------------------------------------
Edward K. Ream email: [EMAIL PROTECTED]
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt