PDA

View Full Version : Guide needed for layout management



sikander243
14th March 2013, 10:31
Hi Everyone!

I have some questions regarding the lay out UI that I am about to make and need the path to it.

I want my listwidgets and edit view to grow in all 4 directions or 2, I can imagine that it is only possible using layouts but please suggest me what lay out should I be using as I am lost in layouts.

is it possible using Qt Designer or I have to go write things with code. please guide me to a path not just the documentaion, but the kind of layout that would be used and hints.

and I use
QPalette* palette = new QPalette();

palette->setBrush(QPalette::Background,*(new QBrush(*(new QPixmap("C:\\background.jpg")))));

setPalette(*palette);


the issue is that I want the background to strech and skew according to the size of main window but in both techniques
it actually becomes a repetitive image instead of scaling up.

thanks
Sikander

anda_skoa
14th March 2013, 11:02
If you have two child widgets side by side then the easiest way is to use a horizontal layout on the parent window.

And don't use pointers for QPalette, QBrush or QPixmap, those can all be treated like value types.
Currently you are leaking memory.

Cheers,
_