C++ (Qt)QTextEdit * editor = new QTextEdit();...QTextCharFormat textCharFormat;textCharFormat.setBackground( Qt::red );editor->mergeCurrentCharFormat( textCharFormat );
C++ (Qt)QTextCharFormat textCharFormat;textCharFormat.setBackground( Qt::NoBrush );mergeFormatOnWordOrSelection( textCharFormat );editor->mergeCurrentCharFormat( textCharFormat);