void QSyntaxHighlighter::setFormat( int start, int count, const QFont &font, const QColor &color ) { if ( !para || count <= 0 ) return; QTextFormat *f = 0; f = para->document()->formatCollection()->format( font, color ); para->setFormat( start, count, f ); f->removeRef(); }
void QSyntaxHighlighter::setFormat( int start, int count, const QFont &font ) { if ( !para || count <= 0 ) return; QTextFormat *f = 0; QColor c = textEdit()->viewport()->paletteForegroundColor(); f = para->document()->formatCollection()->format( font, c ); para->setFormat( start, count, f ); f->removeRef(); }