Qt 6.11 is out! See what's new in the release
blog
CharFormat how set backgroud color ??
General and Desktop
4
Posts
3
Posters
2.5k
Views
1
Watching
-
hi i use QTextEdit and i want change background color on single char, i know char color can change with change
[code]
QTextChaFormat::setTextOutline(QPen(QColor::Color))
[/code]
Underline color can change
[code]
QTextChaFormat::setUnderlineColor,
[/code]
but i can't finde background color. -
but i neet set background color to single char, not to all TextEdit.
ok i have , QTextCharForm inherits setBackground(); srry -
Then try the following
@QTextCharFormat format;
format.setForeground(QBrush(QColor(0,0,0)));
format.setFontFamily("Times New Roman"); format.setFontPointSize(12);
format.setFontWeight(QFont::Bold);
format.setBackground(QBrush(QColor(255,0,0)));@