From kde-devel Wed Jan 09 19:37:27 2002 From: Waldo Bastian Date: Wed, 09 Jan 2002 19:37:27 +0000 To: kde-devel Subject: Re: KMessageBox text wrapping X-MARC-Message: https://marc.info/?l=kde-devel&m=101060518805768 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 ur= l. > I can overcome the problem using rich text "Overwrite %1?", > but it breaks current translations :-(( > > Is it a bug or a feature?=20 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dear Waldo, > Qt 3.0.1 reports a too small sizeHint for QLabel when Qt::WordBreak is=3D= 20 > specified and the text contains a very long unbreakable word. >=20 > A testcase is attached (based on qt/examples/layout) =20 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 o= ur=20 minds and try to fix this in 3.1. =20 In the meantime, you can work around the problem by prepending to y= our string, as the bug only shows up in plain-text mode, where QLabel does s= ome fancy heuristics. =20 I'm sorry if I cannot offer you more for the moment. Stay tuned. =20 Jasmin =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=20 >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<