[Qt-interest] text is exceeding the listview bounds in Qt
Ramesh
ramesh.bs at robosoftin.com
Tue Mar 16 05:56:32 CET 2010
Thanks andre.. ill use elidetext itself...
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Andre Somers
Sent: Monday, March 15, 2010 8:21 PM
To: Qt-interest
Subject: Re: [Qt-interest] text is exceeding the listview bounds in Qt
ramesh.bs at robosoftin.com wrote:
> Hi.. Abhi thanks for the reply.
>
> i know how to set the delegate and all.. in the paint event i need to draw
> the string over a gradient rectangle.. but the problem is if the string is
> big i don't no what to do.. either i need to trim or any other else option
> there?.. i don't no tat trimming logic too so.. i am asking any body know
> how to tackle this problem.
>
>
You could clip the painting area when drawing the text, or, if you draw
only one line of text and it is appropriate for your application, you
could use eliding from QFontMetrics::elidedText. Unfortunately, that
method does not support rich text. A third option is to make sure that
your cell is big enough to fit the whole text.
André
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
-----------------------------------------------
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.
More information about the Qt-interest-old
mailing list