Hi,

I looked at the Qt 4.4.0 C++ documentation and it says about QTextEdit

>>>
QTextCursor QTextEdit::textCursor () const

Returns a copy of the QTextCursor that represents the currently
visible cursor. Note that changes on the returned cursor do not affect
QTextEdit's cursor; use setTextCursor() to update the visible cursor.

See also setTextCursor().
<<<

So in C++, your setPosition() just changes a local copy of the text
cursor. Can that be the cause of the problem?

Kind regards,

Pieter.

On Oct 24, 6:06 pm, "Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> I just sent the following to the pyqt list:
>
> QQQ
> Setting the insertion point programmatically does not appear to "take"
> until (approximately) the point at which a textChanged() signal is
> generated.  The relevant code (simplified just a bit) is:
>
> def setInsertPoint(self,i):
>     w = self.widget
>     g.trace(i,w)
>     w.textCursor().setPosition(i)
>
> def getInsertPoint(self):
>     w = self.widget
>     i = w.textCursor().position()
>     g.trace(i,w)
>     return i
>
> 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.
>
> I have confirmed this by stepping with pdb, so I am fairly confident
> that there are no intervening calls to QTextEdit methods.
>
> Is there a way to force QTextEdit to report the present cursor
> position?  I have tried w.update.
>
> Anything else I should know?
> QQQ
>
> The QTextEdit body pane will be unusable until this is resolved.
>
> In the meantime, I'll try to fix the problems translating tk key names
> in various widgets.  Alas, this problem above muddies the water
> considerably...
>
> Edward
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to