From ab6cc41968ec6eedd16e4305cf38ef937b2a8d56 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 18 Apr 2018 15:41:54 +0300 Subject: QTabWidget: clarify ownership after insertTab() and addTab() Change-Id: I7cd3aa5c092c99bbafd09c4bea7c6824d0b6740a Reviewed-by: Edward Welbourne --- src/widgets/widgets/qtabwidget.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp index 894053ec19..df847e4894 100644 --- a/src/widgets/widgets/qtabwidget.cpp +++ b/src/widgets/widgets/qtabwidget.cpp @@ -376,7 +376,8 @@ QTabWidget::~QTabWidget() \fn int QTabWidget::addTab(QWidget *page, const QString &label) Adds a tab with the given \a page and \a label to the tab widget, - and returns the index of the tab in the tab bar. + and returns the index of the tab in the tab bar. Ownership of \a page + is passed on to the QTabWidget. If the tab's \a label contains an ampersand, the letter following the ampersand is used as a shortcut for the tab, e.g. if the @@ -403,7 +404,8 @@ int QTabWidget::addTab(QWidget *child, const QString &label) \overload Adds a tab with the given \a page, \a icon, and \a label to the tab - widget, and returns the index of the tab in the tab bar. + widget, and returns the index of the tab in the tab bar. Ownership + of \a page is passed on to the QTabWidget. This function is the same as addTab(), but with an additional \a icon. @@ -419,7 +421,8 @@ int QTabWidget::addTab(QWidget *child, const QIcon& icon, const QString &label) Inserts a tab with the given \a label and \a page into the tab widget at the specified \a index, and returns the index of the - inserted tab in the tab bar. + inserted tab in the tab bar. Ownership of \a page is passed on to the + QTabWidget. The label is displayed in the tab and may vary in appearance depending on the configuration of the tab widget. @@ -458,7 +461,8 @@ int QTabWidget::insertTab(int index, QWidget *w, const QString &label) Inserts a tab with the given \a label, \a page, and \a icon into the tab widget at the specified \a index, and returns the index of the - inserted tab in the tab bar. + inserted tab in the tab bar. Ownership of \a page is passed on to the + QTabWidget. This function is the same as insertTab(), but with an additional \a icon. -- cgit v1.2.3