[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KMessageBox text wrapping
From:       Waldo Bastian <bastian () kde ! org>
Date:       2002-01-09 19:37:27
[Download RAW message or body]

On Wednesday 09 January 2002 04:00 am, Stanislav Visnovsky wrote:
> Hi!
>
> KMessageBox does not show the whole text if the text cannot
> be reasonably wrapped, for example:
>
> KMessageBox::warningContinueCancel( parent, i18n("Very long file name
> /home/user/kde/kde-i18n/sk/messages/kdebase/kappfile.po") );
>
> This makes it unusable for messages like "Overwrite %1?" where %1 is url.
> I can overcome the problem using rich text "<qt>Overwrite %1?</qt>",
> but it breaks current translations :-((
>
> Is it a bug or a feature? 

It's a bug.

>Do I need to use a rich text format?

As a work around, yes. But I will probably add that to KMessageBox.

See the response from TrollTech below.

Cheers,
Waldo

===========================
Dear Waldo,

> Qt 3.0.1 reports a too small sizeHint for QLabel when Qt::WordBreak is=20
 > specified and the text contains a very long unbreakable word.
 > 
 > A testcase is attached (based on qt/examples/layout)
 
Thank you for your very precise report. We cannot fix it easily in the Qt 3.0,
 because it requires a function to compute the "minimum width" of a text,
 something that QFontMetrics doesn't yet provide. (Maybe we should add a
 fifteenth parameter to boundingRect()?) We'll keep this in the back of our 
minds
 and try to fix this in 3.1.
 
In the meantime, you can work around the problem by prepending <qml> to your
 string, as the bug only shows up in plain-text mode, where QLabel does some
 fancy heuristics.
 
I'm sorry if I cannot offer you more for the moment. Stay tuned.
 
Jasmin
============================ 


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic