summaryrefslogtreecommitdiffstats
path: root/doc/src/widgets-and-layouts/layout.qdoc
diff options
context:
space:
mode:
authorJerome Pasion <jerome.pasion@nokia.com>2010-09-13 13:08:00 (GMT)
committerMorten Engvoldsen <morten.engvoldsen@nokia.com>2010-09-16 09:10:25 (GMT)
commitf0868f7fc3dacfa6b5b4bcee90b9b0a79d2ccd2a (patch)
treedc4f1d50af98bbd21ba14482dd8adf3edff77787 /doc/src/widgets-and-layouts/layout.qdoc
parentf9a6a8bc03cefe8ea90f695efd9d1e7c8d96321a (diff)
downloadQt-f0868f7fc3dacfa6b5b4bcee90b9b0a79d2ccd2a.zip
Qt-f0868f7fc3dacfa6b5b4bcee90b9b0a79d2ccd2a.tar.gz
Qt-f0868f7fc3dacfa6b5b4bcee90b9b0a79d2ccd2a.tar.bz2
Added a QFormLayout snippet to the layout.qdoc and layouts.cpp
Reviewed-by: David Boddie Tasks: QTBUG-10077
Diffstat (limited to 'doc/src/widgets-and-layouts/layout.qdoc')
-rw-r--r--doc/src/widgets-and-layouts/layout.qdoc16
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc
index 32dddd7..4db991a 100644
--- a/doc/src/widgets-and-layouts/layout.qdoc
+++ b/doc/src/widgets-and-layouts/layout.qdoc
@@ -116,7 +116,7 @@
\section2 Laying Out Widgets in Code
The following code creates a QHBoxLayout that manages the geometry of five
- \l{QPushButton}s, as shown on the first screenshot above:
+ \l{QPushButton}{QPushButtons}, as shown on the first screenshot above:
\snippet doc/src/snippets/layouts/layouts.cpp 0
\snippet doc/src/snippets/layouts/layouts.cpp 1
@@ -141,7 +141,19 @@
The third QPushButton spans 2 columns. This is possible by specifying 2 as
the fifth argument to QGridLayout::addWidget().
- Finally, the code for QFormLayout is ..
+ QFormLayout will add two widgets on a row, commonly a QLabel and a QLineEdit
+ to create forms. Adding a QLabel and a QLineEdit on the same row will set
+ the QLineEdit as the QLabel's buddy. The following code will use the
+ QFormLayout to place three \l{QPushButton}{QPushButtons} and a corresponding
+ QLineEdit on a row.
+
+ \snippet doc/src/snippets/layouts/layouts.cpp 18
+ \snippet doc/src/snippets/layouts/layouts.cpp 19
+ \snippet doc/src/snippets/layouts/layouts.cpp 20
+ \codeline
+ \snippet doc/src/snippets/layouts/layouts.cpp 21
+ \snippet doc/src/snippets/layouts/layouts.cpp 22
+ \snippet doc/src/snippets/layouts/layouts.cpp 23
\section2 Tips for Using Layouts