PDA

View Full Version : Rightjustify text in listwidget



Morea
24th March 2006, 10:06
Hi.
Is there a simple way of rightjustify the QString that I'm about to insert into a QListWidget so that it is right justified to the right margin of the QListWidget. For this I need to know the number of chars that I can write on the line, right?

jpn
24th March 2006, 10:17
void QListWidgetItem::setTextAlignment ( int alignment ) (http://doc.trolltech.com/4.1/qlistwidgetitem.html#setTextAlignment)
Sets the list item's text alignment to alignment (see Qt::AlignmentFlag (http://doc.trolltech.com/4.1/qt.html#AlignmentFlag-enum)).