alex chpenst
11th July 2008, 08:06
Hi,
I'm trying to find the easiest way to change font parameters for different text in widgets. Using html code would be fine, but it seems to not work everywhere for me... For example to write a string in italic in the ListWidget I do the following:
QListWidgetItem *item = new QListWidgetItem("Text...");
QFont *font = new QFont;
font->setItalic(true);
item->setFont(*font);
listWidget->insertItem(0,item);
...which is a quite long way. How to do it simpler?
If I write "<i>Text...</i>" instead of "Text..." this doesn't work.
Thanks!!
I'm trying to find the easiest way to change font parameters for different text in widgets. Using html code would be fine, but it seems to not work everywhere for me... For example to write a string in italic in the ListWidget I do the following:
QListWidgetItem *item = new QListWidgetItem("Text...");
QFont *font = new QFont;
font->setItalic(true);
item->setFont(*font);
listWidget->insertItem(0,item);
...which is a quite long way. How to do it simpler?
If I write "<i>Text...</i>" instead of "Text..." this doesn't work.
Thanks!!