[Qt-interest] QLabel wrap anywhere
Jordan Upham
jupham at zipitwireless.com
Thu Aug 19 15:01:28 CEST 2010
*Ramesh,*
*
*
*Thanks for the tips. It looks like I'm going to just have to do something
custom. I thought that would be the case but I figured I would probe the
list to see if anyone had some ideas.
*
Jordan Upham
Zipit Wireless, Inc.
Tel: (864) 735-8761
Email: jupham at zipitwireless.com
Yahoo: jordanupham
This electronic transmission (and any attached document) contains
information from Zipit Wireless, Inc. (and/or in some cases from the sender
personally), is for the sole use of the individual or entity to whom it is
addressed and may be privileged, proprietary, confidential, subject to an
agreement between the parties regarding use of confidential information or
exempt from disclosure under law. Any unauthorized dissemination,
distribution or copying of this transmission is strictly prohibited. If you
receive this message in error, please notify sender and destroy the attached
message (and all attached documents) immediately.
On Thu, Aug 19, 2010 at 12:13 AM, Ramesh <ramesh.bs at robosoftin.com> wrote:
> There are two possibilities,
>
>
>
> 1) You need to set the wordwrap property of Qlablel to true, but the
> text gets wrapped only if it have spaces present in it else
>
> It will not.
>
>
>
> 2)
> http://stackoverflow.com/questions/3020868/how-to-determine-the-number-of-charecter-will-fit-to-screen-in-qt
>
> using QFontMetrics <http://doc.qt.nokia.com/latest/qfontmetrics.html> get
> the string width in pixels. But its still cumbersome,,
>
>
>
> 3) If you feel none of the above methods are handy, then you hardcode
> it. There are only 3 types of screen resolution you will have,
>
> S60 5th edition phones one resolution, S603rd edition will have another
> resolution and business series phones will have its own unique resolution
> based on that you categorize and perform the operation.
>
>
>
>
>
> *From:* qt-interest-bounces at trolltech.com [mailto:
> qt-interest-bounces at trolltech.com] *On Behalf Of *Jordan Upham
> *Sent:* Wednesday, August 18, 2010 8:23 PM
>
> *To:* qt-interest at trolltech.com
> *Subject:* [Qt-interest] QLabel wrap anywhere
>
>
>
> 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.
>
>
>
> Thank You,
>
>
> Jordan Upham
>
> -----------------------------------------------
>
> Robosoft Technologies - Come home to Technology
>
> Disclaimer: This email may contain confidential material. If you were not
> an intended recipient, please notify the sender and delete all copies.
> Emails to and from our network may be logged and monitored. This email and
> its attachments are scanned for virus by our scanners and are believed to be
> safe. However, no warranty is given that this email is free of malicious
> content or virus.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100819/8c4fbb16/attachment.html
More information about the Qt-interest-old
mailing list