PDA

View Full Version : Text Alignment in a ListWidget



Krish_ng
20th July 2007, 08:02
I want to align the text items in the listwidget to center of the widget.Is that possible without using QlistWidgetItem/Delegates.I am adding all the items from a QList into the QListWidget using addItems() method.Any other options???

jpn
20th July 2007, 08:47
It's very simple to do with a delegate. I don't know any other sensible way to do this.

darksaga
21st July 2007, 03:19
it's also pretty simple without a delegate:


QListWidgetItem *newItem = new QListWidgetItem(parent);
newItem->setTextAlignment(Qt::AlignCenter);