Hi Koen, I used both Layout and CSS for the case I mentionned earlier and it works just fine, however, I have an extension to the question : __________________________________ hlayout = new WHBoxLayout(); #ifdef CASE1 mainContainer->setLayout(d->hlayout, AlignTop); #endif
#ifdef CASE2 mainContainer->setLayout(d->hlayout); #endif hlayout->addWidget(container); hlayout->addWidget(container2); ____________________________________ In CASE1 : My container "generate" a fixed height in the layout, and no matter how I modify (add or remove element) container, mainContainer wont update its size (it keep the size it has at the beginning) In CASE2 : mainContainer has a dynamic height, but the width of mainContainer is now 1/3 of the page (instead of full width). ----- I've been modifying my code and my CSS for hours without understanding the good way to do this correctly (having dynamic height, and maximized width). Any idea of what I'm doing wrong ? Regards, Bastien. Koen Deforche a écrit : > Hey Bamiel, > > 2011/8/5 Bamiel <[email protected]>: > >> I solved this using the float property indeed, my problem was that I was >> using WLayout inside my widget, >> and using WLayout seems to be the best way to loose control on the CSS >> (I thought using layouts will make >> the behaviour control easier, guess I was wrong). >> > > You could have done this use a WHBoxLayout however, using: > hbox->addWidget(logo); > hbox->addStretch(); > hbox->addWidget(btn1); > hbox->addWidget(btn2); > > You would need to set this boxlayout in a container, which defaults to > expanding in width to available width. > > There is however a subtle difference between the CSS solution and a > WHBoxLayout: when the width of the container becomes less wide than > the total width of your three widget, then using CSS floats will start > the stack the floats vertically. This is usually a more web-friendly > solution since it allows the user to reduce window size without > getting a horizontal scroll bar. > > Wt's layout managers are not really there to displace CSS, but rather > to complement it with functionality not available or possible using > CSS only, and that is certain things related to vertical layout, and > also the possibility to provide resize bars. > > Regards, > koen > > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA > The must-attend event for mobile developers. Connect with experts. > Get tools for creating Super Apps. See the latest technologies. > Sessions, hands-on labs, demos & much more. Register early & save! > http://p.sf.net/sfu/rim-blackberry-1 > _______________________________________________ > witty-interest mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/witty-interest > > ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
