diff options
Diffstat (limited to 'src/widgets/kernel/qlayout.cpp')
-rw-r--r-- | src/widgets/kernel/qlayout.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index eac5674161..e3f6a56875 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -109,7 +109,7 @@ static int menuBarHeightForWidth(QWidget *menubar, int w) /*! Constructs a new top-level QLayout, with parent \a parent. - \a parent may not be a \c nullptr. + \a parent may not be a \nullptr. The layout is set directly as the top-level layout for \a parent. There can be only one top-level layout for a @@ -282,6 +282,7 @@ bool QLayout::setAlignment(QLayout *l, Qt::Alignment alignment) return false; } +#if QT_DEPRECATED_SINCE(5, 13) /*! \property QLayout::margin \brief the width of the outside border of the layout @@ -307,6 +308,15 @@ int QLayout::margin() const } /*! + \obsolete +*/ +void QLayout::setMargin(int margin) +{ + setContentsMargins(margin, margin, margin, margin); +} + +#endif +/*! \property QLayout::spacing \brief the spacing between widgets inside the layout @@ -344,14 +354,6 @@ int QLayout::spacing() const } } -/*! - \obsolete -*/ -void QLayout::setMargin(int margin) -{ - setContentsMargins(margin, margin, margin, margin); -} - void QLayout::setSpacing(int spacing) { if (QBoxLayout* boxlayout = qobject_cast<QBoxLayout*>(this)) { @@ -474,8 +476,8 @@ QRect QLayout::contentsRect() const /*! - Returns the parent widget of this layout, or 0 if this layout is - not installed on any widget. + Returns the parent widget of this layout, or \nullptr if this + layout is not installed on any widget. If the layout is a sub-layout, this function returns the parent widget of the parent layout. @@ -490,11 +492,11 @@ QWidget *QLayout::parentWidget() const QLayout *parentLayout = qobject_cast<QLayout*>(parent()); if (Q_UNLIKELY(!parentLayout)) { qWarning("QLayout::parentWidget: A layout can only have another layout as a parent."); - return 0; + return nullptr; } return parentLayout->parentWidget(); } else { - return 0; + return nullptr; } } else { Q_ASSERT(parent() && parent()->isWidgetType()); @@ -950,8 +952,8 @@ void QLayout::setMenuBar(QWidget *widget) } /*! - Returns the menu bar set for this layout, or 0 if no menu bar is - set. + Returns the menu bar set for this layout, or \nullptr if no + menu bar is set. */ QWidget *QLayout::menuBar() const @@ -1130,8 +1132,9 @@ bool QLayout::activate() Searches for widget \a from and replaces it with widget \a to if found. Returns the layout item that contains the widget \a from on success. - Otherwise \c 0 is returned. If \a options contains \c Qt::FindChildrenRecursively - (the default), sub-layouts are searched for doing the replacement. + Otherwise \nullptr is returned. + If \a options contains \c Qt::FindChildrenRecursively (the default), + sub-layouts are searched for doing the replacement. Any other flag in \a options is ignored. Notice that the returned item therefore might not belong to this layout, |