[Qt-interest] how to use layouts
alexander golks
alex at golks.de
Thu Mar 11 12:44:46 CET 2010
you're possibly searching for the ::addStretch(int) method:
QWidget* w=new QWidget();
QVBoxLayout* vl=new QVBoxLayout();
QToolBar* tb=new QToolBar();
tb->addAction("action1");
tb->addAction("action2");
vl->addWidget(new QPushButton("button1"));
vl->addWidget(new QPushButton("button2"));
vl->addStretch(0); // creates an spacer item, which will expand to maximum available space
// thus letting the toolbar hover at the bottom of the widget
vl->addWidget(tb);
w->setLayout(vl);
in designer search for the spacers.
alex
--
/*
*printk(KERN_ERR "happy meal: Eieee, rx config register gets greasy fries.\n");
* linux-2.6.19/drivers/net/sunhme.c
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100311/6939b350/attachment.bin
More information about the Qt-interest-old
mailing list