PDA

View Full Version : Related to Alignment of QGraphicsTextItem



ashishsaryar
23rd September 2008, 10:08
Hi to all,


i have a problem ....

i am not getting how to align QGraphicsTextItem.

pls give ur imp suggestion..

Thanks

ashishsaryar
24th September 2008, 07:32
Hi,

Is there any one who knows how to align the text of QGraphicsTextItem.

I am using QGraphicsTextItem which allows multiline text. I want to align these text as left justified, center and right justified within its bounding area.

Regards,
Ashish

QbelcorT
24th September 2008, 08:29
I am not an expert, I have used QGraphicsTextItem to display the time/date in a scene that I have made. I am using QGraphicsView. I set the items position on the scene. Without knowing the details of your implementation it's difficult to say. Maybe you can make separate handlers for left, right,centre and use the setPos to change the position.
item = new QGraphicsTextItem(this);
item->setDefaultTextColor(Qt::white);
item->setFont(QFont("Times",32,QFont::Normal));
item->setPos(-378, -225);