A<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FLayout</id>
		<title>C++/Qt/Layout - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FLayout"/>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/Layout&amp;action=history"/>
		<updated>2026-04-18T18:43:33Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B/Qt/Layout&amp;diff=1250&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/Layout&amp;diff=1250&amp;oldid=prev"/>
				<updated>2010-05-25T14:21:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 14:21, 25 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B/Qt/Layout&amp;diff=1251&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/Layout&amp;diff=1251&amp;oldid=prev"/>
				<updated>2010-05-25T10:25:16Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия: Импорт контента...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Basic layout==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the examples of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#ifndef DIALOG_H&lt;br /&gt;
#define DIALOG_H&lt;br /&gt;
#include &amp;lt;QDialog&amp;gt;&lt;br /&gt;
QT_BEGIN_NAMESPACE&lt;br /&gt;
class QAction;&lt;br /&gt;
class QDialogButtonBox;&lt;br /&gt;
class QGroupBox;&lt;br /&gt;
class QLabel;&lt;br /&gt;
class QLineEdit;&lt;br /&gt;
class QMenu;&lt;br /&gt;
class QMenuBar;&lt;br /&gt;
class QPushButton;&lt;br /&gt;
class QTextEdit;&lt;br /&gt;
QT_END_NAMESPACE&lt;br /&gt;
&lt;br /&gt;
class Dialog : public QDialog&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
public:&lt;br /&gt;
    Dialog();&lt;br /&gt;
private:&lt;br /&gt;
    void createMenu();&lt;br /&gt;
    void createHorizontalGroupBox();&lt;br /&gt;
    void createGridGroupBox();&lt;br /&gt;
    void createFormGroupBox();&lt;br /&gt;
    enum { NumGridRows = 3, NumButtons = 4 };&lt;br /&gt;
    QMenuBar *menuBar;&lt;br /&gt;
    QGroupBox *horizontalGroupBox;&lt;br /&gt;
    QGroupBox *gridGroupBox;&lt;br /&gt;
    QGroupBox *formGroupBox;&lt;br /&gt;
    QTextEdit *smallEditor;&lt;br /&gt;
    QTextEdit *bigEditor;&lt;br /&gt;
    QLabel *labels[NumGridRows];&lt;br /&gt;
    QLineEdit *lineEdits[NumGridRows];&lt;br /&gt;
    QPushButton *buttons[NumButtons];&lt;br /&gt;
    QDialogButtonBox *buttonBox;&lt;br /&gt;
    QMenu *fileMenu;&lt;br /&gt;
    QAction *exitAction;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
#include &amp;quot;dialog.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Dialog::Dialog()&lt;br /&gt;
{&lt;br /&gt;
    createMenu();&lt;br /&gt;
    createHorizontalGroupBox();&lt;br /&gt;
    createGridGroupBox();&lt;br /&gt;
    createFormGroupBox();&lt;br /&gt;
&lt;br /&gt;
    bigEditor = new QTextEdit;&lt;br /&gt;
    bigEditor-&amp;gt;setPlainText(tr(&amp;quot;This widget takes up all the remaining space &amp;quot;&lt;br /&gt;
                               &amp;quot;in the top-level layout.&amp;quot;));&lt;br /&gt;
    buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok&lt;br /&gt;
                                     | QDialogButtonBox::Cancel);&lt;br /&gt;
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));&lt;br /&gt;
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));&lt;br /&gt;
&lt;br /&gt;
    QVBoxLayout *mainLayout = new QVBoxLayout;&lt;br /&gt;
 &lt;br /&gt;
    mainLayout-&amp;gt;setMenuBar(menuBar);&lt;br /&gt;
 &lt;br /&gt;
    mainLayout-&amp;gt;addWidget(horizontalGroupBox);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(gridGroupBox);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(formGroupBox);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(bigEditor);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(buttonBox);&lt;br /&gt;
 &lt;br /&gt;
    setLayout(mainLayout);&lt;br /&gt;
    setWindowTitle(tr(&amp;quot;Basic Layouts&amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Dialog::createMenu()&lt;br /&gt;
{&lt;br /&gt;
    menuBar = new QMenuBar;&lt;br /&gt;
    fileMenu = new QMenu(tr(&amp;quot;&amp;amp;File&amp;quot;), this);&lt;br /&gt;
    exitAction = fileMenu-&amp;gt;addAction(tr(&amp;quot;E&amp;amp;xit&amp;quot;));&lt;br /&gt;
    menuBar-&amp;gt;addMenu(fileMenu);&lt;br /&gt;
    connect(exitAction, SIGNAL(triggered()), this, SLOT(accept()));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Dialog::createHorizontalGroupBox()&lt;br /&gt;
{&lt;br /&gt;
    horizontalGroupBox = new QGroupBox(tr(&amp;quot;Horizontal layout&amp;quot;));&lt;br /&gt;
    QHBoxLayout *layout = new QHBoxLayout;&lt;br /&gt;
    for (int i = 0; i &amp;lt; NumButtons; ++i) {&lt;br /&gt;
        buttons[i] = new QPushButton(tr(&amp;quot;Button %1&amp;quot;).arg(i + 1));&lt;br /&gt;
  layout-&amp;gt;addWidget(buttons[i]);&lt;br /&gt;
    }&lt;br /&gt;
    horizontalGroupBox-&amp;gt;setLayout(layout);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Dialog::createGridGroupBox()&lt;br /&gt;
{&lt;br /&gt;
    gridGroupBox = new QGroupBox(tr(&amp;quot;Grid layout&amp;quot;));&lt;br /&gt;
    QGridLayout *layout = new QGridLayout;&lt;br /&gt;
&lt;br /&gt;
    for (int i = 0; i &amp;lt; NumGridRows; ++i) {&lt;br /&gt;
  labels[i] = new QLabel(tr(&amp;quot;Line %1:&amp;quot;).arg(i + 1));&lt;br /&gt;
  lineEdits[i] = new QLineEdit;&lt;br /&gt;
  layout-&amp;gt;addWidget(labels[i], i + 1, 0);&lt;br /&gt;
  layout-&amp;gt;addWidget(lineEdits[i], i + 1, 1);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    smallEditor = new QTextEdit;&lt;br /&gt;
    smallEditor-&amp;gt;setPlainText(tr(&amp;quot;This widget takes up about two thirds of the &amp;quot;&lt;br /&gt;
                                 &amp;quot;grid layout.&amp;quot;));&lt;br /&gt;
    layout-&amp;gt;addWidget(smallEditor, 0, 2, 4, 1);&lt;br /&gt;
&lt;br /&gt;
    layout-&amp;gt;setColumnStretch(1, 10);&lt;br /&gt;
    layout-&amp;gt;setColumnStretch(2, 20);&lt;br /&gt;
    gridGroupBox-&amp;gt;setLayout(layout);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Dialog::createFormGroupBox()&lt;br /&gt;
{&lt;br /&gt;
    formGroupBox = new QGroupBox(tr(&amp;quot;Form layout&amp;quot;));&lt;br /&gt;
    QFormLayout *layout = new QFormLayout;&lt;br /&gt;
    layout-&amp;gt;addRow(new QLabel(tr(&amp;quot;Line 1:&amp;quot;)), new QLineEdit);&lt;br /&gt;
    layout-&amp;gt;addRow(new QLabel(tr(&amp;quot;Line 2, long text:&amp;quot;)), new QComboBox);&lt;br /&gt;
    layout-&amp;gt;addRow(new QLabel(tr(&amp;quot;Line 3:&amp;quot;)), new QSpinBox);&lt;br /&gt;
    formGroupBox-&amp;gt;setLayout(layout);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;quot;dialog.h&amp;quot;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    Dialog dialog;&lt;br /&gt;
    return dialog.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamic layout==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the examples of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#ifndef DIALOG_H&lt;br /&gt;
#define DIALOG_H&lt;br /&gt;
#include &amp;lt;QDialog&amp;gt;&lt;br /&gt;
#include &amp;lt;QQueue&amp;gt;&lt;br /&gt;
QT_BEGIN_NAMESPACE&lt;br /&gt;
class QComboBox;&lt;br /&gt;
class QDialogButtonBox;&lt;br /&gt;
class QGridLayout;&lt;br /&gt;
class QGroupBox;&lt;br /&gt;
class QLabel;&lt;br /&gt;
class QPushButton;&lt;br /&gt;
QT_END_NAMESPACE&lt;br /&gt;
class Dialog : public QDialog&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
public:&lt;br /&gt;
    Dialog(QWidget *parent = 0);&lt;br /&gt;
private slots:&lt;br /&gt;
    void buttonsOrientationChanged(int index);&lt;br /&gt;
    void rotateWidgets();&lt;br /&gt;
    void help();&lt;br /&gt;
private:&lt;br /&gt;
    void createRotableGroupBox();&lt;br /&gt;
    void createOptionsGroupBox();&lt;br /&gt;
    void createButtonBox();&lt;br /&gt;
    QGroupBox *rotableGroupBox;&lt;br /&gt;
    QQueue&amp;lt;QWidget *&amp;gt; rotableWidgets;&lt;br /&gt;
    QGroupBox *optionsGroupBox;&lt;br /&gt;
    QLabel *buttonsOrientationLabel;&lt;br /&gt;
    QComboBox *buttonsOrientationComboBox;&lt;br /&gt;
    QDialogButtonBox *buttonBox;&lt;br /&gt;
    QPushButton *closeButton;&lt;br /&gt;
    QPushButton *helpButton;&lt;br /&gt;
    QPushButton *rotateWidgetsButton;&lt;br /&gt;
    QGridLayout *mainLayout;&lt;br /&gt;
    QGridLayout *rotableLayout;&lt;br /&gt;
    QGridLayout *optionsLayout;&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
#include &amp;quot;dialog.h&amp;quot;&lt;br /&gt;
Dialog::Dialog(QWidget *parent)&lt;br /&gt;
    : QDialog(parent)&lt;br /&gt;
{&lt;br /&gt;
    createRotableGroupBox();&lt;br /&gt;
    createOptionsGroupBox();&lt;br /&gt;
    createButtonBox();&lt;br /&gt;
    mainLayout = new QGridLayout;&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(rotableGroupBox, 0, 0);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(optionsGroupBox, 1, 0);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(buttonBox, 2, 0);&lt;br /&gt;
    setLayout(mainLayout);&lt;br /&gt;
    mainLayout-&amp;gt;setSizeConstraint(QLayout::SetMinimumSize);&lt;br /&gt;
    setWindowTitle(tr(&amp;quot;Dynamic Layouts&amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
void Dialog::buttonsOrientationChanged(int index)&lt;br /&gt;
{&lt;br /&gt;
    mainLayout-&amp;gt;setSizeConstraint(QLayout::SetNoConstraint);&lt;br /&gt;
    setMinimumSize(0, 0);&lt;br /&gt;
    Qt::Orientation orientation = Qt::Orientation(&lt;br /&gt;
            buttonsOrientationComboBox-&amp;gt;itemData(index).toInt());&lt;br /&gt;
    if (orientation == buttonBox-&amp;gt;orientation())&lt;br /&gt;
        return;&lt;br /&gt;
    mainLayout-&amp;gt;removeWidget(buttonBox);&lt;br /&gt;
    int spacing = mainLayout-&amp;gt;spacing();&lt;br /&gt;
    QSize oldSizeHint = buttonBox-&amp;gt;sizeHint() + QSize(spacing, spacing);&lt;br /&gt;
    buttonBox-&amp;gt;setOrientation(orientation);&lt;br /&gt;
    QSize newSizeHint = buttonBox-&amp;gt;sizeHint() + QSize(spacing, spacing);&lt;br /&gt;
    if (orientation == Qt::Horizontal) {&lt;br /&gt;
        mainLayout-&amp;gt;addWidget(buttonBox, 2, 0);&lt;br /&gt;
        resize(size() + QSize(-oldSizeHint.width(), newSizeHint.height()));&lt;br /&gt;
    } else {&lt;br /&gt;
        mainLayout-&amp;gt;addWidget(buttonBox, 0, 3, 2, 1);&lt;br /&gt;
        resize(size() + QSize(newSizeHint.width(), -oldSizeHint.height()));&lt;br /&gt;
    }&lt;br /&gt;
    mainLayout-&amp;gt;setSizeConstraint(QLayout::SetDefaultConstraint);&lt;br /&gt;
}&lt;br /&gt;
void Dialog::rotateWidgets()&lt;br /&gt;
{&lt;br /&gt;
    Q_ASSERT(rotableWidgets.count() % 2 == 0);&lt;br /&gt;
    foreach (QWidget *widget, rotableWidgets)&lt;br /&gt;
        rotableLayout-&amp;gt;removeWidget(widget);&lt;br /&gt;
    rotableWidgets.enqueue(rotableWidgets.dequeue());&lt;br /&gt;
    const int n = rotableWidgets.count();&lt;br /&gt;
    for (int i = 0; i &amp;lt; n / 2; ++i) {&lt;br /&gt;
        rotableLayout-&amp;gt;addWidget(rotableWidgets[n - i - 1], 0, i);&lt;br /&gt;
        rotableLayout-&amp;gt;addWidget(rotableWidgets[i], 1, i);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
void Dialog::help()&lt;br /&gt;
{&lt;br /&gt;
    QMessageBox::information(this, tr(&amp;quot;Dynamic Layouts Help&amp;quot;),&lt;br /&gt;
                               tr(&amp;quot;This example shows how to change layouts &amp;quot;&lt;br /&gt;
                                  &amp;quot;dynamically.&amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
void Dialog::createRotableGroupBox()&lt;br /&gt;
{&lt;br /&gt;
    rotableGroupBox = new QGroupBox(tr(&amp;quot;Rotable Widgets&amp;quot;));&lt;br /&gt;
    rotableWidgets.enqueue(new QSpinBox);&lt;br /&gt;
    rotableWidgets.enqueue(new QSlider);&lt;br /&gt;
    rotableWidgets.enqueue(new QDial);&lt;br /&gt;
    rotableWidgets.enqueue(new QProgressBar);&lt;br /&gt;
    int n = rotableWidgets.count();&lt;br /&gt;
    for (int i = 0; i &amp;lt; n; ++i) {&lt;br /&gt;
        connect(rotableWidgets[i], SIGNAL(valueChanged(int)),&lt;br /&gt;
                rotableWidgets[(i + 1) % n], SLOT(setValue(int)));&lt;br /&gt;
    }&lt;br /&gt;
    rotableLayout = new QGridLayout;&lt;br /&gt;
    rotableGroupBox-&amp;gt;setLayout(rotableLayout);&lt;br /&gt;
    rotateWidgets();&lt;br /&gt;
}&lt;br /&gt;
void Dialog::createOptionsGroupBox()&lt;br /&gt;
{&lt;br /&gt;
    optionsGroupBox = new QGroupBox(tr(&amp;quot;Options&amp;quot;));&lt;br /&gt;
    buttonsOrientationLabel = new QLabel(tr(&amp;quot;Orientation of buttons:&amp;quot;));&lt;br /&gt;
    buttonsOrientationComboBox = new QComboBox;&lt;br /&gt;
    buttonsOrientationComboBox-&amp;gt;addItem(tr(&amp;quot;Horizontal&amp;quot;), Qt::Horizontal);&lt;br /&gt;
    buttonsOrientationComboBox-&amp;gt;addItem(tr(&amp;quot;Vertical&amp;quot;), Qt::Vertical);&lt;br /&gt;
    connect(buttonsOrientationComboBox, SIGNAL(currentIndexChanged(int)),&lt;br /&gt;
            this, SLOT(buttonsOrientationChanged(int)));&lt;br /&gt;
    optionsLayout = new QGridLayout;&lt;br /&gt;
    optionsLayout-&amp;gt;addWidget(buttonsOrientationLabel, 0, 0);&lt;br /&gt;
    optionsLayout-&amp;gt;addWidget(buttonsOrientationComboBox, 0, 1);&lt;br /&gt;
    optionsLayout-&amp;gt;setColumnStretch(2, 1);&lt;br /&gt;
    optionsGroupBox-&amp;gt;setLayout(optionsLayout);&lt;br /&gt;
}&lt;br /&gt;
void Dialog::createButtonBox()&lt;br /&gt;
{&lt;br /&gt;
    buttonBox = new QDialogButtonBox;&lt;br /&gt;
    closeButton = buttonBox-&amp;gt;addButton(QDialogButtonBox::Close);&lt;br /&gt;
    helpButton = buttonBox-&amp;gt;addButton(QDialogButtonBox::Help);&lt;br /&gt;
    rotateWidgetsButton = buttonBox-&amp;gt;addButton(tr(&amp;quot;Rotate &amp;amp;Widgets&amp;quot;),&lt;br /&gt;
                                               QDialogButtonBox::ActionRole);&lt;br /&gt;
    connect(rotateWidgetsButton, SIGNAL(clicked()), this, SLOT(rotateWidgets()));&lt;br /&gt;
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));&lt;br /&gt;
    connect(helpButton, SIGNAL(clicked()), this, SLOT(help()));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;quot;dialog.h&amp;quot;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    Dialog dialog;&lt;br /&gt;
    return dialog.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Grid Layout==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    {&lt;br /&gt;
    QWidget *window = new QWidget;&lt;br /&gt;
    QPushButton *button1 = new QPushButton(&amp;quot;One&amp;quot;);&lt;br /&gt;
    QPushButton *button2 = new QPushButton(&amp;quot;Two&amp;quot;);&lt;br /&gt;
    QPushButton *button3 = new QPushButton(&amp;quot;Three&amp;quot;);&lt;br /&gt;
    QPushButton *button4 = new QPushButton(&amp;quot;Four&amp;quot;);&lt;br /&gt;
    QPushButton *button5 = new QPushButton(&amp;quot;Five&amp;quot;);&lt;br /&gt;
    QGridLayout *layout = new QGridLayout;&lt;br /&gt;
    layout-&amp;gt;addWidget(button1, 0, 0);&lt;br /&gt;
    layout-&amp;gt;addWidget(button2, 0, 1);&lt;br /&gt;
    layout-&amp;gt;addWidget(button3, 1, 0, 1, 2);&lt;br /&gt;
    layout-&amp;gt;addWidget(button4, 2, 0);&lt;br /&gt;
    layout-&amp;gt;addWidget(button5, 2, 1);&lt;br /&gt;
    window-&amp;gt;setLayout(layout);&lt;br /&gt;
    window-&amp;gt;show();&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Horizontal BoxLayout==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    {&lt;br /&gt;
    QWidget *window = new QWidget;&lt;br /&gt;
    QPushButton *button1 = new QPushButton(&amp;quot;One&amp;quot;);&lt;br /&gt;
    QPushButton *button2 = new QPushButton(&amp;quot;Two&amp;quot;);&lt;br /&gt;
    QPushButton *button3 = new QPushButton(&amp;quot;Three&amp;quot;);&lt;br /&gt;
    QPushButton *button4 = new QPushButton(&amp;quot;Four&amp;quot;);&lt;br /&gt;
    QPushButton *button5 = new QPushButton(&amp;quot;Five&amp;quot;);&lt;br /&gt;
    QHBoxLayout *layout = new QHBoxLayout;&lt;br /&gt;
    layout-&amp;gt;addWidget(button1);&lt;br /&gt;
    layout-&amp;gt;addWidget(button2);&lt;br /&gt;
    layout-&amp;gt;addWidget(button3);&lt;br /&gt;
    layout-&amp;gt;addWidget(button4);&lt;br /&gt;
    layout-&amp;gt;addWidget(button5);&lt;br /&gt;
    window-&amp;gt;setLayout(layout);&lt;br /&gt;
    window-&amp;gt;show();&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    return app.exec();&lt;br /&gt;
}     &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Layout two labels==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QVBoxLayout&amp;gt;&lt;br /&gt;
#include &amp;lt;QLabel&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication a(argc, argv);&lt;br /&gt;
    QWidget window;&lt;br /&gt;
    QVBoxLayout* mainLayout = new QVBoxLayout(&amp;amp;window);&lt;br /&gt;
    QLabel* label1 = new QLabel(&amp;quot;One&amp;quot;);&lt;br /&gt;
    QLabel* label2 = new QLabel(&amp;quot;Two&amp;quot;);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(label1);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(label2);&lt;br /&gt;
    window.show();&lt;br /&gt;
    return a.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Nested layout==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    QWidget *window = new QWidget();&lt;br /&gt;
//! [create, lay out widgets and show]&lt;br /&gt;
    QLabel *queryLabel = new QLabel(tr(&amp;quot;Query:&amp;quot;));&lt;br /&gt;
    QLineEdit *queryEdit = new QLineEdit();&lt;br /&gt;
    QTableView *resultView = new QTableView();&lt;br /&gt;
    QHBoxLayout *queryLayout = new QHBoxLayout();&lt;br /&gt;
    queryLayout-&amp;gt;addWidget(queryLabel);&lt;br /&gt;
    queryLayout-&amp;gt;addWidget(queryEdit);&lt;br /&gt;
    QVBoxLayout *mainLayout = new QVBoxLayout();&lt;br /&gt;
    mainLayout-&amp;gt;addLayout(queryLayout);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(resultView);&lt;br /&gt;
    window-&amp;gt;setLayout(mainLayout);&lt;br /&gt;
//! [create, lay out widgets and show]&lt;br /&gt;
    QStandardItemModel model;&lt;br /&gt;
    model.setHorizontalHeaderLabels(QStringList() &amp;lt;&amp;lt; tr(&amp;quot;Name&amp;quot;) &amp;lt;&amp;lt; tr(&amp;quot;Office&amp;quot;));&lt;br /&gt;
    QList&amp;lt;QStringList&amp;gt; rows = QList&amp;lt;QStringList&amp;gt;()&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Verne Nilsen&amp;quot; &amp;lt;&amp;lt; &amp;quot;123&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Carlos Tang&amp;quot; &amp;lt;&amp;lt; &amp;quot;77&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Bronwyn Hawcroft&amp;quot; &amp;lt;&amp;lt; &amp;quot;119&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Alessandro Hanssen&amp;quot; &amp;lt;&amp;lt; &amp;quot;32&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Andrew John Bakken&amp;quot; &amp;lt;&amp;lt; &amp;quot;54&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Vanessa Weatherley&amp;quot; &amp;lt;&amp;lt; &amp;quot;85&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Rebecca Dickens&amp;quot; &amp;lt;&amp;lt; &amp;quot;17&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;David Bradley&amp;quot; &amp;lt;&amp;lt; &amp;quot;42&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Knut Walters&amp;quot; &amp;lt;&amp;lt; &amp;quot;25&amp;quot;)&lt;br /&gt;
        &amp;lt;&amp;lt; (QStringList() &amp;lt;&amp;lt; &amp;quot;Andrea Jones&amp;quot; &amp;lt;&amp;lt; &amp;quot;34&amp;quot;);&lt;br /&gt;
    foreach (QStringList row, rows) {&lt;br /&gt;
        QList&amp;lt;QStandardItem *&amp;gt; items;&lt;br /&gt;
        foreach (QString text, row)&lt;br /&gt;
            items.append(new QStandardItem(text));&lt;br /&gt;
        model.appendRow(items);&lt;br /&gt;
    }&lt;br /&gt;
    resultView-&amp;gt;setModel(&amp;amp;model);&lt;br /&gt;
    resultView-&amp;gt;verticalHeader()-&amp;gt;hide();&lt;br /&gt;
    resultView-&amp;gt;horizontalHeader()-&amp;gt;setStretchLastSection(true);&lt;br /&gt;
    window-&amp;gt;setWindowTitle(tr(&amp;quot;Nested layouts&amp;quot;));&lt;br /&gt;
    window-&amp;gt;show();&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Pass window pointer to a Layout manager==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
Layout two labels &lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QVBoxLayout&amp;gt;&lt;br /&gt;
#include &amp;lt;QLabel&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication a(argc, argv);&lt;br /&gt;
    QWidget window;&lt;br /&gt;
    QVBoxLayout* mainLayout = new QVBoxLayout(&amp;amp;window);&lt;br /&gt;
    QLabel* label1 = new QLabel(&amp;quot;One&amp;quot;);&lt;br /&gt;
    QLabel* label2 = new QLabel(&amp;quot;Two&amp;quot;);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(label1);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(label2);&lt;br /&gt;
    window.show();&lt;br /&gt;
    return a.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Window layout==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    QWidget *window = new QWidget();&lt;br /&gt;
//! [create, lay out widgets and show]&lt;br /&gt;
    QLabel *label = new QLabel(tr(&amp;quot;Name:&amp;quot;));&lt;br /&gt;
    QLineEdit *lineEdit = new QLineEdit();&lt;br /&gt;
    QHBoxLayout *layout = new QHBoxLayout();&lt;br /&gt;
    layout-&amp;gt;addWidget(label);&lt;br /&gt;
    layout-&amp;gt;addWidget(lineEdit);&lt;br /&gt;
    window-&amp;gt;setLayout(layout);&lt;br /&gt;
//! [create, lay out widgets and show]&lt;br /&gt;
    window-&amp;gt;setWindowTitle(tr(&amp;quot;Window layout&amp;quot;));&lt;br /&gt;
    window-&amp;gt;show();&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>