summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/doc/snippets/layouts/layouts.cpp7
-rw-r--r--src/widgets/kernel/qwidget.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/widgets/doc/snippets/layouts/layouts.cpp b/src/widgets/doc/snippets/layouts/layouts.cpp
index 49c341c048..f6a11ad233 100644
--- a/src/widgets/doc/snippets/layouts/layouts.cpp
+++ b/src/widgets/doc/snippets/layouts/layouts.cpp
@@ -161,5 +161,12 @@ int main(int argc, char *argv[])
//! [23]
}
+ {
+//! [24]
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(formWidget);
+ setLayout(layout);
+//! [24]
+ }
return app.exec();
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 09bbb9563c..9b4a4bdc12 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -9096,7 +9096,7 @@ QLayout *QWidget::layout() const
Example:
- \snippet uitools/textfinder/textfinder.cpp 3b
+ \snippet layouts/layouts.cpp 24
An alternative to calling this function is to pass this widget to
the layout's constructor.