[Qt-interest] QLabel wrap anywhere

Andre Haupt andre at bitwigglers.org
Wed Aug 18 17:13:18 CEST 2010


On Wed, Aug 18, 2010 at 10:52:33AM -0400, Jordan Upham wrote:
> Hi,
> 
> I'm looking for a way to wrap a QLabel anywhere and not just on line breaks.
>  I know this is possible with QTextEdits and I have thought about just using
> those instead of QLabels where I need this behavior but I am running on a
> mobile device and I am worried about performance of this.  Is there a way to
> figure out how much text of a given string will fit in a given width?  I'm
> thinking it is probably possible with QFontMetrics but I'm not sure.
> 

QLabel::setWordWrap() comes to mind. Is this what you are looking for?

regards,

Andre



More information about the Qt-interest-old mailing list