Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2061

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QHBoxLayout" doc="/**
&lt;p&gt;The &lt;a href=&quot;QHBoxLayout.html#QHBoxLayout()&quot;&gt;&lt;tt&gt;QHBoxLayout&lt;/tt&gt;&lt;/a&gt; class lines up widgets horizontally.&lt;/p&gt;
&lt;p&gt;This class is used to construct horizontal box layout objects. See &lt;a href=&quot;QBoxLayout.html#QBoxLayout(com.trolltech.qt.gui.QBoxLayout.Direction, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QBoxLayout&lt;/tt&gt;&lt;/a&gt; for details.&lt;/p&gt;
&lt;p&gt;The simplest use of the class is like this:&lt;/p&gt;
&lt;pre&gt;        QWidget *window = new QWidget;
        QPushButton *button1 = new QPushButton(&amp;quot;One&amp;quot;);
        QPushButton *button2 = new QPushButton(&amp;quot;Two&amp;quot;);
        QPushButton *button3 = new QPushButton(&amp;quot;Three&amp;quot;);
        QPushButton *button4 = new QPushButton(&amp;quot;Four&amp;quot;);
        QPushButton *button5 = new QPushButton(&amp;quot;Five&amp;quot;);

        QHBoxLayout *layout = new QHBoxLayout;
        layout-&amp;gt;addWidget(button1);
        layout-&amp;gt;addWidget(button2);
        layout-&amp;gt;addWidget(button3);
        layout-&amp;gt;addWidget(button4);
        layout-&amp;gt;addWidget(button5);

        window-&amp;gt;setLayout(layout);
        window-&amp;gt;show();&lt;/pre&gt;
&lt;p&gt;First, we create the widgets we want in the layout. Then, we create the &lt;a href=&quot;QHBoxLayout.html#QHBoxLayout()&quot;&gt;&lt;tt&gt;QHBoxLayout&lt;/tt&gt;&lt;/a&gt; object and add the widgets into the layout. Finally, we call QWidget::setLayout() to install the &lt;a href=&quot;QHBoxLayout.html#QHBoxLayout()&quot;&gt;&lt;tt&gt;QHBoxLayout&lt;/tt&gt;&lt;/a&gt; object onto the widget. At that point, the widgets in the layout are reparented to have &lt;tt&gt;window&lt;/tt&gt; as their parent.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;%2E%2E/images/qhboxlayout-with-5-children.png&quot; alt=&quot;Horizontal box layout with five child widgets&quot; /&gt;&lt;/p&gt;
@see &lt;a href=&quot;QVBoxLayout.html&quot;&gt;&lt;tt&gt;QVBoxLayout&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QGridLayout.html&quot;&gt;&lt;tt&gt;QGridLayout&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QStackedLayout.html&quot;&gt;&lt;tt&gt;QStackedLayout&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/layout.html&quot;&gt;Layout Classes&lt;/tt&gt;&lt;/a&gt;
@see Basic Layouts Example&lt;/tt&gt; */">
    <method name="public QHBoxLayout(com.trolltech.qt.gui.QWidget parent)" doc="/**
&lt;p&gt;Constructs a new top-level horizontal box with parent &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public QHBoxLayout()" doc="/**
&lt;p&gt;Constructs a new horizontal box. You must add it to another layout.&lt;/p&gt;
 */"/>
</class>