summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qgridlayout.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2020-10-26 18:08:57 +0200
committerAhmad Samir <a.samirh78@gmail.com>2020-10-27 13:49:39 +0200
commit1e904ab342c1aaabbef67cbcc25cf3de9e35e755 (patch)
tree32da202a93007aa353352b3e9c376ed5ad75ea42 /src/widgets/kernel/qgridlayout.cpp
parent07ab7c11b5d6a7c81dec96641d92ae1af3c33e16 (diff)
QLayout docs: explain better what the QWidget ctor arg does
Make it clear in the docs that an alternative to calling QWidget::setLayout() is to pass the parent widget to the Q*BoxLayout constructor. This basically just copies the relevant bits from the the docs of QWidget and Q*Layout. Change-Id: Id196dcdf9a876d9141aa145f23a83c45f8cda5f8 Pick-to: 5.15 5.12 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/kernel/qgridlayout.cpp')
-rw-r--r--src/widgets/kernel/qgridlayout.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp
index 339677378f..3a1d89573c 100644
--- a/src/widgets/kernel/qgridlayout.cpp
+++ b/src/widgets/kernel/qgridlayout.cpp
@@ -1072,6 +1072,12 @@ QRect QGridLayoutPrivate::cellRect(int row, int col) const
Constructs a new QGridLayout with parent widget, \a parent. The
layout has one row and one column initially, and will expand when
new items are inserted.
+
+ The layout is set directly as the top-level layout for \a parent.
+ There can be only one top-level layout for a widget. It is returned
+ by QWidget::layout().
+
+ \sa QWidget::setLayout()
*/
QGridLayout::QGridLayout(QWidget *parent)
: QLayout(*new QGridLayoutPrivate, nullptr, parent)