hi friends,

i am having a QGraphicsTextItem and QGraphicsItem where the user can give input text to the text item using setTextInteractionFlags.
now i wanted to draw the same text on the QGraphicsItem paint function .
so i passed the text item "text", "font" and the "boundingRect" to the QGraphicsItem paint event
TEXT = "theCurrentText"
FONT = "theCurrentFontSize"
boundingRect = m_bounds;


and painted as

Qt Code:
  1. QFont segoeFont("Segoe Regular");
  2.  
  3.  
  4. segoeFont.setPointSizeF(theCurrentFontSize );
  5. p->setFont(segoeFont);
  6. p->setPen(actPen);
  7. QFontMetricsF fma( p->font());
  8.  
  9. QRectF bounds = fma.boundingRect(QRectF(0, 0, m_bounds.width() , 0), Qt::TextWordWrap, theCurrentText);
  10. p->fillRect(bounds, Qt::white);
  11. p->drawText(bounds, Qt::TextWordWrap, theCurrentText);
To copy to clipboard, switch view to plain text mode 

but the text is not getting wrapped at any point . even hundreds of word i have given but still the words are getting cropped but showing in a single line.
my graphicstextitem
InitialGraphicsItem.jpg
and my graphicsitem
finalEyGsText(UgObject).jpg

i checked the debug statements of the the graphicstext item and graphicsitem .
The Ey Text item bounding rect value is: QRectF(-2,-2 1909.22x62)
The Ey text item font size value coming is: 8.25

The Ey Text bounding rect value is: QRectF(0,0 1909x86)
The Ey font size value coming is: 8.25


both bounding rect and font size are coming similar and both are child of same graphicsitem ..

please help me ..