Ejemplo n.º 1
0
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();
}
Ejemplo n.º 2
0
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();
}