hi friends,
I want to know how i can get the boundingRect of the multi line text from the QFontMetrics.
im having a qgraphicsItem where i have to draw text .
while drawing im using the fontmetrics bounding rect to define the rect of the text to draw .
m_bounds = fontMtic.boundingRect(theCurrentText);
p
->drawText
(QRectF(theTextItemPos, m_bounds.
size()),Qt
::TextWordWrap, theCurrentText
);
QFontMetrics fontMtic(segoeFont);
m_bounds = fontMtic.boundingRect(theCurrentText);
p->drawText(QRectF(theTextItemPos, m_bounds.size()),Qt::TextWordWrap, theCurrentText);
To copy to clipboard, switch view to plain text mode
but when the theCurrentText is coming with multi line or having new line in it , the bounding rect value of the fontmetric return me the height of the first line only .
I want to get the complete boundary height for the text.
can any one please help me to solve this problem .
Bookmarks