On Tue, Feb 3, 2009 at 11:23 AM, Henning Schröder < [email protected]> 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. Thanks. Edward
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
