It is just a string, you can replace it however and whenever you want.
It is just a string, you can replace it however and whenever you want.
Thanks!Originally Posted by wysota
I'm kinda unfamiliar with that HTML style markup. How can I set the text for the label to be taken from for example QString or QTime with that kind of color color setting? How do I wrap it so that it does not show you the variables name, but what is stored in them instead?
Originally Posted by Yorma
Qt Code:To copy to clipboard, switch view to plain text mode
Don't use template it's a keywordQt Code:
- QString colour; // you can use also QColor
- QString text;
- // ...
- QString template = tr("<font color='%1'>%2</font>");
- somelabel->setText( template.arg( colour, text ) );
Last edited by sunil.thaha; 14th January 2006 at 05:00.
We can't solve problems by using the same kind of thinking we used when we created them
Good point, I didn't notice that.Originally Posted by sunil.thaha
Simply, but elegant!Originally Posted by jacek
It's hints like these that make this forum so valuable.
Jacke, if you are ever in Lincoln, NE then visit the Nebraska State Office Building and ask for me. I'll take you out for a steak dinner!!
Thank you!Originally Posted by GreyGeek
Unfortunately I have no overseas journeys in my plans now, but we'll see what the future holds.
Bookmarks