[PyQt] Re: Help! How to set insert point in QTextEdit

2008-10-24 Thread kib2
Edward K. Ream a écrit : 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.t

[PyQt] re: Help! How to set insert point in QTextEdit

2008-10-24 Thread Edward K. Ream
QQQ As you can see, w does not report the new insertion point immediately: getInsertPoint: 0 setInsertPoint: 48 getInsertPoint: 0 # Oops. QQQ Mystery solved. w.textCursor returns a copy of the cursor, so instead of:: w.textCursor().setPosition(i) the following will work:: cursor