QLayout: unify the constructors
Drive-by, make QLayout constructor explicit, as it should have always been. [ChangeLog][QtWidgets][QLayout] The QLayout constructor taking a QWidget pointer is now explicit. Change-Id: If6accfb2e7e810fa08adacea9e674c99121f6bc6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
3b8d37b1f0
commit
d76b9d86e8
@ -1077,6 +1077,10 @@ QRect QGridLayoutPrivate::cellRect(int row, int col) const
|
|||||||
There can be only one top-level layout for a widget. It is returned
|
There can be only one top-level layout for a widget. It is returned
|
||||||
by QWidget::layout().
|
by QWidget::layout().
|
||||||
|
|
||||||
|
If \a parent is \nullptr, then you must insert this grid layout
|
||||||
|
into another layout, or set it as a widget's layout using
|
||||||
|
QWidget::setLayout().
|
||||||
|
|
||||||
\sa QWidget::setLayout()
|
\sa QWidget::setLayout()
|
||||||
*/
|
*/
|
||||||
QGridLayout::QGridLayout(QWidget *parent)
|
QGridLayout::QGridLayout(QWidget *parent)
|
||||||
@ -1086,23 +1090,6 @@ QGridLayout::QGridLayout(QWidget *parent)
|
|||||||
d->expand(1, 1);
|
d->expand(1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
Constructs a new grid layout.
|
|
||||||
|
|
||||||
You must insert this grid into another layout. You can insert
|
|
||||||
widgets and layouts into this layout at any time, but laying out
|
|
||||||
will not be performed before this is inserted into another layout.
|
|
||||||
*/
|
|
||||||
QGridLayout::QGridLayout()
|
|
||||||
: QLayout(*new QGridLayoutPrivate, nullptr, nullptr)
|
|
||||||
{
|
|
||||||
Q_D(QGridLayout);
|
|
||||||
d->expand(1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal (mostly)
|
\internal (mostly)
|
||||||
|
|
||||||
|
@ -61,9 +61,7 @@ class Q_WIDGETS_EXPORT QGridLayout : public QLayout
|
|||||||
QDOC_PROPERTY(int verticalSpacing READ verticalSpacing WRITE setVerticalSpacing)
|
QDOC_PROPERTY(int verticalSpacing READ verticalSpacing WRITE setVerticalSpacing)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QGridLayout(QWidget *parent);
|
explicit QGridLayout(QWidget *parent = nullptr);
|
||||||
QGridLayout();
|
|
||||||
|
|
||||||
~QGridLayout();
|
~QGridLayout();
|
||||||
|
|
||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
@ -106,11 +106,16 @@ static int menuBarHeightForWidth(QWidget *menubar, int w)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Constructs a new top-level QLayout, with parent \a parent.
|
Constructs a new top-level QLayout, with parent \a parent.
|
||||||
\a parent may not be \nullptr.
|
|
||||||
|
|
||||||
The layout is set directly as the top-level layout for
|
The layout is set directly as the top-level layout for
|
||||||
\a parent. There can be only one top-level layout for a
|
\a parent. There can be only one top-level layout for a
|
||||||
widget. It is returned by QWidget::layout().
|
widget. It is returned by QWidget::layout().
|
||||||
|
|
||||||
|
If \a parent is \nullptr, then you must insert this layout
|
||||||
|
into another layout, or set it as a widget's layout using
|
||||||
|
QWidget::setLayout().
|
||||||
|
|
||||||
|
\sa QWidget::setLayout()
|
||||||
*/
|
*/
|
||||||
QLayout::QLayout(QWidget *parent)
|
QLayout::QLayout(QWidget *parent)
|
||||||
: QObject(*new QLayoutPrivate, parent)
|
: QObject(*new QLayoutPrivate, parent)
|
||||||
@ -120,18 +125,6 @@ QLayout::QLayout(QWidget *parent)
|
|||||||
parent->setLayout(this);
|
parent->setLayout(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
Constructs a new child QLayout.
|
|
||||||
|
|
||||||
This layout has to be inserted into another layout before geometry
|
|
||||||
management will work.
|
|
||||||
*/
|
|
||||||
QLayout::QLayout()
|
|
||||||
: QObject(*new QLayoutPrivate, nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*! \internal
|
/*! \internal
|
||||||
*/
|
*/
|
||||||
QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w)
|
QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w)
|
||||||
|
@ -77,8 +77,7 @@ public:
|
|||||||
};
|
};
|
||||||
Q_ENUM(SizeConstraint)
|
Q_ENUM(SizeConstraint)
|
||||||
|
|
||||||
QLayout(QWidget *parent);
|
explicit QLayout(QWidget *parent = nullptr);
|
||||||
QLayout();
|
|
||||||
~QLayout();
|
~QLayout();
|
||||||
|
|
||||||
virtual int spacing() const;
|
virtual int spacing() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user