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.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?

Thanks.

Edward
--------------------------------------------------------------------
Edward K. Ream email: [EMAIL PROTECTED]
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------

Hi Edward,

I can confirm this because I had the same problem yesterday, mytextedit.update() does not seems to give any signifiant result; strangely, left-clicking inside the QTextEdit area with my mouse showed everything working again.

I also got a question about QTextEdit : does it have column selection or do we have to implement it (I've read that Qt3 had it)?

Christophe K.

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to