Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void QSyntaxHighlighter::rehighlight (  )  [slot]

Since:
4.2
Redoes the highlighting of the whole document.

Definition at line 405 of file qsyntaxhighlighter.cpp.

References QTextCursor::beginEditBlock(), QObject::connect(), QObject::disconnect(), QTextCursor::endEditBlock(), QTextCursor::movePosition(), and QTextCursor::position().

{
    Q_D(QSyntaxHighlighter);
    if (!d->doc)
        return;

    disconnect(d->doc, SIGNAL(contentsChange(int,int,int)),
               this, SLOT(_q_reformatBlocks(int,int,int)));
    QTextCursor cursor(d->doc);
    cursor.beginEditBlock();
    cursor.movePosition(QTextCursor::End);
    d->_q_reformatBlocks(0, 0, cursor.position());
    cursor.endEditBlock();
    connect(d->doc, SIGNAL(contentsChange(int,int,int)),
            this, SLOT(_q_reformatBlocks(int,int,int)));
}


Generated by  Doxygen 1.6.0   Back to index