PDA

View Full Version : I want 'Next' button always be close to border



datha_k
15th December 2009, 23:26
Hi,
I have a question on QWidget designed using Qt designer. I want 'Next' button always be close to border but now when i expand window 'Next' button stays wherever it is. I have attached a picture in http://picasaweb.google.com/datha.krishnabhat/QtDoubt#5415589783168772242
Can I set some property in Qt creator to do this?
Thanks,
Datha

dbzhang800
16th December 2009, 01:40
Hi,
I have a question on QWidget designed using Qt designer. I want 'Next' button always be close to border but now when i expand window 'Next' button stays wherever it is. I have attached a picture in http://picasaweb.google.com/datha.krishnabhat/QtDoubt#5415589783168772242
Can I set some property in Qt creator to do this?
Thanks,
Datha

ref. QLayout

datha_k
16th December 2009, 14:46
Hi,
Can you please give more detail please.
I used Qt designer, I have a two buttons and horizontal spacer between them. I initially adjusted the widget size to what I need. But in run time when user expands the widget, it creates vacuum between border of the widget and 'Next' button as shown in http://picasaweb.google.com/datha.krishnabhat/QtDoubt#5415589783168772242

Thanks,
Datha

Lykurg
16th December 2009, 15:03
Can you please give more detail please.
See the documentation for QLayout, QHBoxLayout, QVBoxLayout, QGridLayout. (Or read: http://doc.trolltech.com/4.6/layout.html)
And you might want to use the Newbie section next time, if you can't handle layouts...
AND please attach images at the board. Don't use 3rd-party sites for that. Because only if you use the board your post will stay consistent.

nish
16th December 2009, 15:29
just pust a layout with a stretch on one side :)

datha_k
17th December 2009, 13:00
OK. I found the solution and it is pretty simple.
- Add 2 buttons, add horizontal spacer between them. Add all these 3 items to horizontal layout.
- Add a vertical spacer between above horizontal layout till end of screen.
- Now click on the form so that none the items are selected. (i.e. horizontal layout and vertical spacer)
- Just select vertical layout. This will set whole screen to vertical layout.
Bingo, i did my first screen

I have attached my '3rd party' image and my current layout image.

Thanks,
Datha