diff options
author | David Boddie <david.boddie@nokia.com> | 2011-02-23 13:20:55 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-02-23 13:20:55 (GMT) |
commit | 7a476ac32f2d21fbffa1bcd09101148e15fbc17e (patch) | |
tree | aee861c1f078b39e17a278612ef4efc72ef2842c /doc/src/tutorials | |
parent | 39ed27f1e382fbc594d2e5b6a23b2bc612b96e64 (diff) | |
parent | 276ae3c231a80b5cf64ae431e9386ac63d48a278 (diff) | |
download | Qt-7a476ac32f2d21fbffa1bcd09101148e15fbc17e.zip Qt-7a476ac32f2d21fbffa1bcd09101148e15fbc17e.tar.gz Qt-7a476ac32f2d21fbffa1bcd09101148e15fbc17e.tar.bz2 |
Merge branch 'mimir' into 4.7
Conflicts:
doc/src/declarative/qdeclarativemodels.qdoc
doc/src/index.qdoc
doc/src/template/style/style.css
tools/qdoc3/atom.h
tools/qdoc3/doc.cpp
tools/qdoc3/doc/qdoc-manual.qdoc
tools/qdoc3/doc/qdoc-manual.qdocconf
Diffstat (limited to 'doc/src/tutorials')
-rw-r--r-- | doc/src/tutorials/widgets-tutorial.qdoc | 82 |
1 files changed, 29 insertions, 53 deletions
diff --git a/doc/src/tutorials/widgets-tutorial.qdoc b/doc/src/tutorials/widgets-tutorial.qdoc index 2125edc..6c5df66 100644 --- a/doc/src/tutorials/widgets-tutorial.qdoc +++ b/doc/src/tutorials/widgets-tutorial.qdoc @@ -133,19 +133,13 @@ In the following example, we use QWidget to create and show a window with a default size: - \raw HTML - <table align="left" width="100%"> - <tr class="qt-code"><td> - \endraw - \snippet tutorials/widgets/toplevel/main.cpp main program - \raw HTML - </td><td align="right"> - \endraw - \inlineimage widgets-tutorial-toplevel.png - \raw HTML - </td></tr> - </table> - \endraw + \div {class="qt-code"} + \table + \row + \o \snippet tutorials/widgets/toplevel/main.cpp main program + \o \inlineimage widgets-tutorial-toplevel.png + \endtable + \enddiv To create a real GUI, we need to place widgets inside the window. To do this, we pass a QWidget instance to a widget's constructor, as we will @@ -161,19 +155,13 @@ passing \c window as the parent to its constructor. In this case, we add a button to the window and place it in a specific location: - \raw HTML - <table align="left" width="100%"> - <tr class="qt-code"><td> - \endraw - \snippet tutorials/widgets/childwidget/main.cpp main program - \raw HTML - </td><td align="right"> - \endraw - \inlineimage widgets-tutorial-childwidget.png - \raw HTML - </td></tr> - </table> - \endraw + \div {class="qt-code"} + \table + \row + \o \snippet tutorials/widgets/childwidget/main.cpp main program + \o \inlineimage widgets-tutorial-childwidget.png + \endtable + \enddiv The button is now a child of the window and will be deleted when the window is destroyed. Note that hiding or closing the window does not @@ -189,19 +177,13 @@ construct a label and line edit widget that we would like to arrange side-by-side. - \raw HTML - <table align="left" width="100%"> - <tr class="qt-code"><td> - \endraw - \snippet tutorials/widgets/windowlayout/main.cpp main program - \raw HTML - </td><td align="right"> - \endraw - \inlineimage widgets-tutorial-windowlayout.png - \raw HTML - </td></tr> - </table> - \endraw + \div {class="qt-code"} + \table + \row + \o \snippet tutorials/widgets/windowlayout/main.cpp main program + \o \inlineimage widgets-tutorial-windowlayout.png + \endtable + \enddiv The \c layout object we construct manages the positions and sizes of widgets supplied to it with the \l{QHBoxLayout::}{addWidget()} function. @@ -233,20 +215,14 @@ \c{mainLayout} is a QVBoxLayout that contains \c{queryLayout} and a QTableView arranged vertically. - \raw HTML - <table align="left" width="100%"> - <tr class="qt-code"><td> - \endraw - \snippet tutorials/widgets/nestedlayouts/main.cpp first part - \snippet tutorials/widgets/nestedlayouts/main.cpp last part - \raw HTML - </td><td align="right"> - \endraw - \inlineimage widgets-tutorial-nestedlayouts.png - \raw HTML - </td></tr> - </table> - \endraw + \div {class="qt-code"} + \table + \row + \o \snippet tutorials/widgets/nestedlayouts/main.cpp first part + \snippet tutorials/widgets/nestedlayouts/main.cpp last part + \o \inlineimage widgets-tutorial-nestedlayouts.png + \endtable + \enddiv Note that we call the \c{mainLayout}'s \l{QBoxLayout::}{addLayout()} function to insert the \c{queryLayout} above the \c{resultView} table. |