QLayout: Better document QLayout(QWidget *parent) behavior

QLayout(QWidget *parent) directly calls parent->setLayout(this) which
can lead to a runtime warning later on when someone tries to set the
layout on the parent again.

Task-number: QTBUG-69761
Change-Id: I21ef8895fd65f3e23e57527a6d38936e45417b63
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
bb10
Christian Ehrlicher 2018-08-30 20:08:12 +02:00
parent 8b3a6cfbfb
commit cd499b7297
1 changed files with 4 additions and 3 deletions

View File

@ -109,10 +109,11 @@ static int menuBarHeightForWidth(QWidget *menubar, int w)
/*!
Constructs a new top-level QLayout, with parent \a parent.
\a parent may not be 0.
\a parent may not be a \c nullptr.
There can be only one top-level layout for a widget. It is
returned by QWidget::layout().
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().
*/
QLayout::QLayout(QWidget *parent)
: QObject(*new QLayoutPrivate, parent)