diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-09-27 21:45:18 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-09-29 13:28:25 +0000 |
commit | f1b77574f89ca601cf761717302c2dbf65ba9027 (patch) | |
tree | 30d364899bb47212c0e490d8a6a6609aa535f4ab | |
parent | 462f6029ed7ab34b76afc009b95134d4e51a8e18 (diff) | |
download | qtbase-f1b77574f89ca601cf761717302c2dbf65ba9027.tar.gz |
[doc] Fix docs of QLayoutItem::widget()
QWidget does not inherit QLayoutItem (unlike QLayout and QSpacerItem, which do),
so don't claim that in the docs.
Added a note.
Added cross-references between layout(), widget() and spacerItem().
Change-Id: I518b6842ef76fd1b72226b790dab75f429fae556
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
-rw-r--r-- | src/widgets/kernel/qlayoutitem.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp index 03988aab99..41944d63ac 100644 --- a/src/widgets/kernel/qlayoutitem.cpp +++ b/src/widgets/kernel/qlayoutitem.cpp @@ -300,6 +300,8 @@ void QLayoutItem::invalidate() /*! If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned. This function provides type-safe casting. + + \sa spacerItem(), widget() */ QLayout * QLayoutItem::layout() { @@ -309,6 +311,8 @@ QLayout * QLayoutItem::layout() /*! If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. This function provides type-safe casting. + + \sa layout(), widget() */ QSpacerItem * QLayoutItem::spacerItem() { @@ -339,8 +343,14 @@ QSpacerItem * QSpacerItem::spacerItem() */ /*! - If this item is a QWidget, it is returned as a QWidget; otherwise - 0 is returned. This function provides type-safe casting. + If this item manages a QWidget, returns that widget. Otherwise, + \c nullptr is returned. + + \note While the functions layout() and spacerItem() perform casts, this + function returns another object: QLayout and QSpacerItem inherit QLayoutItem, + while QWidget does not. + + \sa layout(), spacerItem() */ QWidget * QLayoutItem::widget() { |