[Qt-interest] how to use layouts

Ramesh ramesh.bs at robosoftin.com
Thu Mar 11 12:52:43 CET 2010


Thank you alex..

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of alexander golks
Sent: Thursday, March 11, 2010 5:15 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] how to use layouts

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
 */

-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.



More information about the Qt-interest-old mailing list