<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qboxlayout.cpp --> <head> <title>Qt 4.6: QVBoxLayout Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QVBoxLayout"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QVBoxLayout Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span> </h1> <p>The QVBoxLayout class lines up widgets vertically. <a href="#details">More...</a></p> <pre> #include <QVBoxLayout></pre><p>Inherits <a href="qboxlayout.html">QBoxLayout</a>.</p> <ul> <li><a href="qvboxlayout-members.html">List of all members, including inherited members</a></li> <li><a href="qvboxlayout-qt3.html">Qt 3 support members</a></li> </ul> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvboxlayout.html#QVBoxLayout">QVBoxLayout</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvboxlayout.html#QVBoxLayout-2">QVBoxLayout</a></b> ( QWidget * <i>parent</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvboxlayout.html#dtor.QVBoxLayout">~QVBoxLayout</a></b> ()</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>32 public functions inherited from <a href="qboxlayout.html#public-functions">QBoxLayout</a></li> <li><div bar="2" class="fn"></div>35 public functions inherited from <a href="qlayout.html#public-functions">QLayout</a></li> <li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> <li><div bar="2" class="fn"></div>17 public functions inherited from <a href="qlayoutitem.html#public-functions">QLayoutItem</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li><div class="fn"></div>2 properties inherited from <a href="qlayout.html#properties">QLayout</a></li> <li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li> <li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> <li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li> <li><div class="fn"></div>1 static public member inherited from <a href="qlayout.html#static-public-members">QLayout</a></li> <li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li><div class="fn"></div>1 protected function inherited from <a href="qboxlayout.html#protected-functions">QBoxLayout</a></li> <li><div class="fn"></div>4 protected functions inherited from <a href="qlayout.html#protected-functions">QLayout</a></li> <li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QVBoxLayout class lines up widgets vertically.</p> <p>This class is used to construct vertical box layout objects. See <a href="qboxlayout.html">QBoxLayout</a> for details.</p> <p>The simplest use of the class is like this:</p> <pre> QWidget *window = new QWidget; QPushButton *button1 = new QPushButton("One"); QPushButton *button2 = new QPushButton("Two"); QPushButton *button3 = new QPushButton("Three"); QPushButton *button4 = new QPushButton("Four"); QPushButton *button5 = new QPushButton("Five"); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(button1); layout->addWidget(button2); layout->addWidget(button3); layout->addWidget(button4); layout->addWidget(button5); window->setLayout(layout); window->show();</pre> <p>First, we create the widgets we want in the layout. Then, we create the QVBoxLayout object and add the widgets into the layout. Finally, we call <a href="qwidget.html#setLayout">QWidget::setLayout</a>() to install the QVBoxLayout object onto the widget. At that point, the widgets in the layout are reparented to have <tt>window</tt> as their parent.</p> <p align="center"><img src="images/qvboxlayout-with-5-children.png" alt="Horizontal box layout with five child widgets" /></p><p>See also <a href="qhboxlayout.html">QHBoxLayout</a>, <a href="qgridlayout.html">QGridLayout</a>, <a href="qstackedlayout.html">QStackedLayout</a>, <a href="layout.html">Layout Management</a>, and <a href="layouts-basiclayouts.html">Basic Layouts Example</a>.</p> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QVBoxLayout/QVBoxLayout"></a> <h3 class="fn"><a name="QVBoxLayout"></a>QVBoxLayout::QVBoxLayout ()</h3> <p>Constructs a new vertical box. You must add it to another layout.</p> <h3 class="fn"><a name="QVBoxLayout-2"></a>QVBoxLayout::QVBoxLayout ( <a href="qwidget.html">QWidget</a> * <i>parent</i> )</h3> <p>Constructs a new top-level vertical box with parent <i>parent</i>.</p> <a name="//apple_ref/cpp/instm/QVBoxLayout/~QVBoxLayout"></a> <h3 class="fn"><a name="dtor.QVBoxLayout"></a>QVBoxLayout::~QVBoxLayout ()</h3> <p>Destroys this box layout.</p> <p>The layout's widgets aren't destroyed.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>