PDA

View Full Version : Qt 4.3.5 Linux QLabel with wordWrap=true causes layout failure



will49
30th June 2008, 22:33
I have a weird problem that I am only seeing on Qt Linux. It doesn't happen on Windows or Mac.

Problem: If I add a QLabel to a layout in a dialog, and set the "wordWrap" to true, then the layout for the whole dialog seems to fail and it is possible to resize the entire dialog's width and height to 0.

i.e. it appears like the layout has suddenly lost it's layout manager even though the QLabel is in a Grid. The minimum size is no longer restricted to the minimum size of the widgets.

If I set the "wordWrap" to false, then the dialog behaves as expected and the minimum size of the dialog is restricted by the widgets it contains.

Steps to reproduce:
1. Use Qt Designer to create a dialog with default buttons.
2. Add a QLabel and set the plain text to a long string of text
3. Layout everything in a grid.
4. Preview the dialog and confirm the minimum size of the dialog is restricted
5. Change the "wordWrap" of the QLabel to true.
6. Preview the dialog and confirm the minimum size of the dialog is now not restricted and can be sized to 0x0.

Anyone else have this problem or know of a solution?

Thanks

jacek
9th July 2008, 01:00
It seems that there are some issues with word wrapping in QLabel (#189948 and #164108). Could you prepare a minimal compilable example that reproduces the problem?

will49
9th July 2008, 23:28
I got a reply from Trolltech on this:

This problem has been reported before, and while it could be fixed on
Windows and Mac, it is still unsolved on X11 as X does not support a
height-for-width protocol:


http://trolltech.com/customer/task-tracker/index_html?method=entry&id=148038
http://trolltech.com/customer/task-tracker/index_html?method=entry&id=94203