Unsolved QTextBlockFormat.setForeground is useless?
-
QTextBlockFormat.setBackground is good, but QTextBlockFormat.setForeground is useless!
https://github.com/sonichy/Qt_QQMusicQTextCursor cursor1(ui->textBrowser->document()->findBlockByLineNumber(hl)); QTextBlockFormat TBF1 = cursor1.blockFormat(); TBF1.setForeground(QBrush(Qt::green)); TBF1.setBackground(QBrush(Qt::yellow)); cursor1.setBlockFormat(TBF1); ui->textBrowser->setTextCursor(cursor1);