Multicolor text
Unsolved
General and Desktop
-
Hi
I have a string constructed this way:
const auto text = QString { "#%1%2%3%4" } .arg(QString::number(n), -15) .arg(someText, -45) .arg(symbol, -2) .arg(QString::number(someNumber), -5);
How can I make the
%3
argument to be another color?The text is set to a label, so if I put
QString { "#%1%2<font color=\"red\">%3</font>%4" }
all the styles of the label are gone.
What can I do?
-
@user4592357 Do you set the labels text for mat to rich text somewhere in you code?
setTextFormat(Qt::TextFormat)
-
@JNBarchan yes, i tried that.
and sorry to confuse you, of course i understood. if i didn't know what he meant, i'd just ask :)