Results 1 to 3 of 3

Thread: Related to Alignment of QGraphicsTextItem

  1. #1
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Related to Alignment of QGraphicsTextItem

    Hi to all,


    i have a problem ....

    i am not getting how to align QGraphicsTextItem.

    pls give ur imp suggestion..

    Thanks
    Ashish Kumar Saryar

  2. #2
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Related to Alignment of QGraphicsTextItem

    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
    Ashish Kumar Saryar

  3. #3
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Related to Alignment of QGraphicsTextItem

    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);

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.