[PyQt] Feature request: support for flashing characters in QTextEdit

Edward K. Ream edreamleo at gmail.com
Tue Feb 3 17:54:02 GMT 2009

On Tue, Feb 3, 2009 at 11:23 AM, Henning Schröder <
henning.schroeder at gmail.com> wrote:

> I do something like that:
> tc = my_textedit.textCursor()
> tc.setPosition(start_pos)
> tc.setPosition(end_pos, QTextCursor.KeepAnchor)
> sel = QTextEdit.ExtraSelection()
> sel.cursor = tc
> se.format.setForeground(QColor.red)
> sel_list.append(sel) # keep the references
> my_textedit.setExtraSelections(sel_list)
> You can connect cursorPositionChanged() to a method which checks if
> the current char is a bracket. Then you create an extra selection.
> Either you remove the extra selection from your extra selection list
> if the position changed again or you use QTimer.singleShot
> The above code is not tested. If it does not work I can upload my
> editor widget code.

Please do that.  I am not having an luck yet.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090203/92ea2c20/attachment.html

More information about the PyQt mailing list