PDA

View Full Version : How to set the alignment in a TableView?



vratojr
9th March 2006, 13:18
Hello,I'm using the model/view architecture to render some data (strings).
I created my model and gave it to the view and it works fine. Now a question arises:"How can i set the alignment of the displayed items?". I suppose I have to modify the QStyleOptionViewItem structure of my view but I don't know how to do. Must I create a new Style and rewrite a drawSomething function and the call setStyle?
Thanks.

Simone

wysota
9th March 2006, 13:21
Set appropriate Qt::TextAlignmentRole in the model for items you want to have changed alignment.