PDA

View Full Version : CharFormat how set backgroud color ??



Pablik
17th July 2012, 14:50
hi i use QTextEdit and i want change background color on single char, i know char color can change with change


QTextChaFormat::setTextOutline(QPen(QColor::Color) )

Underline color can change


QTextChaFormat::setUnderlineColor,

but i can't finde background color.

wysota
17th July 2012, 17:32
How many times do we have to point you to the same solution?

QTextCharFormat has a super class, look there.

Pablik
20th July 2012, 10:25
i dont see your solution , i write before "I CANT FINDE BACKGROUND COLOR" method in QTextCharFormat.
ok i have , QTextCharForm inherits setBackground(); srry

wysota
20th July 2012, 10:27
Look into the super class of that class. You do understand that term (super class), right?

Pablik
20th July 2012, 10:32
no, what is super class, upper class (class from who inherits)

wysota
20th July 2012, 10:33
http://en.wikipedia.org/wiki/Superclass

Now please look what is the superclass of QTextCharFormat and see what methods it offers.

Vidhya
25th July 2012, 07:15
QTextCharFormat line3;
line3.setFontFamily("Times New Roman");
line3.setFontPointSize(12);
line3.setBackground(QBrush(QColor(0,0,0)));
line3.setForeground(QBrush(QColor(255,0,0)));


you can try this


Thank U