Hi All,
I've a hboxlayout. i need to add a pushbutton in the right side border centre of layout. so that if i press that button i can minimize the treewidget. How to added the button. Herewith i've attached the diagram.
Thank you all.
Hi All,
I've a hboxlayout. i need to add a pushbutton in the right side border centre of layout. so that if i press that button i can minimize the treewidget. How to added the button. Herewith i've attached the diagram.
Thank you all.
Just add a pushbutton and dont add pushbutton in layout.
set the parent property and geometry.
ex
0,0 is the x,y posQt Code:
btnOk->setGeometry(0,0,100,50);To copy to clipboard, switch view to plain text mode
100,50 is the width and height
syntax : btn->setGeometry(x,y,w,h);
hope it helps
Bala
if u dont mind, can u pls tell why its not working ?
i hav done a small example for ur need.
i attached it here.
pls refer the attachment,
pls workaround with ur window positions.
hope it helps
Bala
Last edited by BalaQT; 26th February 2010 at 09:22.
Other ways
way 1)
To do it by adding spacer.
way 2)
using layouts also we can achieve the same
let the tabwidget is in a Vertical layout.
then add a child Horizontal layout.
add the tabwidget
then add the pushbutton
then add the Horizontal layout into Vertical layout.
i hav attached the example using layout
pls check
Bala
Bookmarks