[Panel-devel] [PATCH] Layout Code Update

Percy Leonhardt mailings at eris23.de
Thu Aug 16 19:40:36 CEST 2007


On Wednesday 15 August 2007, Leo Franchi wrote:
> i'm achieving a gridlayout-like thing by combining a HBoxLayout with
> multiplel VBoxLayout children. it works pretty well overall :)

This seems to be a copy&paste bug:

Index: hboxlayout.cpp
===================================================================
--- hboxlayout.cpp      (revision 700011)
+++ hboxlayout.cpp      (working copy)
@@ -81,7 +81,7 @@

     qreal expandWidth = 0;
     if (expandingChildren.count() > 0) {
-        expandWidth = (available.height() - ((expandingChildren.count()
- 1) * spacing())) / e
xpandingChildren.count();
+        expandWidth = (available.width() - ((expandingChildren.count()
- 1) * spacing())) / ex
pandingChildren.count();
     }

     foreach (LayoutItem *l, expandingChildren) {

Without this change HBoxLayout won't work for me. Ok to commit?

And still I cannot get the layout working for a grid of labels. If I do not 
set the text of the labels directly when creating the layout there is not 
enough room allocated for the labels afterwards.

Could you show me some example (or real) code with a working gridlayout?

Thanks and bye,

	Percy


More information about the Panel-devel mailing list