Solved how to get foreground color for string
-
Hi All...Kindly answer this
QineEdit * Layout->setText(txtSensor->text());
QString measure=Layout->text();from the above code...i want to change the string color
-
@karti-gesar
either with this approach.Or by simply setting a stylesheet on the QLinEdit:
lineEdit->setStyleSheet("color: green;");
-
if two string eg: Qstring str1="welcome"; QString str2="hello"; are displayed in single Qlinedit..... output:welcome hello
here i want to change the color of the welcome and hello -
hI
What @raven-worx said:
does color the text? -
u are right ...that came...hello should be in one color and world should be in different color
-
@karti-gesar
hi
you must then format each word.
The link he provided shows a function to do so. -
thanks i will try
-
got output i used Qfontmetrics to solve my problem