QLabel kills our KMessageBoxes (and others)

Jaroslaw Staniek js at iidea.pl
Thu Oct 18 10:42:24 BST 2007


Dmitry Suzdalev said the following, On 2007-10-18 18:27:
> On Wednesday 17 October 2007 22:05:40 Michael Pyne wrote:
>> I believe it is caused by multiline rich-text QLabels.  So the solution
>> unfortunately seems to be either not to use them, wait for the trolls to
>> actually fix the bug, or if richtext is required, then to use multiple
>> single-line labels stacked as necessary.  Of course, that makes translation
>> hard to do. :(
> 
> That's surely related to QLabels with word-wrap turned on.
> Some time ago I reported this bug to Qt too and I received a reply that it 
> won't be fixed because it can't be fixed *sigh*
> 
> I found a kind of workaround though. Sometimes it works good, sometimes not 
> (it tends to produce different results on different OSes): I do something 
> like 
> 
> wordWrappedLabel->setMinimumHeight( wordWrappedLabel->heightForWidth( 
> labelsWidth );
> 
> But labelsWidth needs to be calculated too....

Thanks for the hint.
The same problem was on Windows as well already in Qt3. Pretty much time 
wasted here and there, IIRC.

Degrading to combined multiple non-richtext QLabels means we do not use our 
beloved KLocalizedString...

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi.pl/en, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org




More information about the kde-core-devel mailing list