diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 5f3596e97cf..0d8236828fa 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -3302,7 +3302,8 @@ bool QAbstractItemView::isPersistentEditorOpen(const QModelIndex &index) const to true, otherwise the widget's background will be transparent, showing both the model data and the item at the given \a index. - If index widget A is replaced with index widget B, index widget A will be + \note The view takes ownership of the \a widget. + This means if index widget A is replaced with index widget B, index widget A will be deleted. For example, in the code snippet below, the QLineEdit object will be deleted. diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index 674028df2bb..66d73befe6f 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -1691,6 +1691,8 @@ QWidget *QListWidget::itemWidget(QListWidgetItem *item) const implement a custom editor widget, use QListView and subclass QStyledItemDelegate instead. + \note The list takes ownership of the \a widget. + \sa itemWidget(), removeItemWidget(), {Delegate Classes} */ void QListWidget::setItemWidget(QListWidgetItem *item, QWidget *widget) diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index a6f6c9f9366..dbc3fb692cf 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -2539,6 +2539,8 @@ void QTreeWidgetPrivate::dataChanged(const QModelIndex &topLeft, \fn void QTreeWidget::removeItemWidget(QTreeWidgetItem *item, int column) Removes the widget set in the given \a item in the given \a column. + + \sa itemWidget(), setItemWidget() */ /*! @@ -2974,6 +2976,7 @@ bool QTreeWidget::isPersistentEditorOpen(QTreeWidgetItem *item, int column) cons /*! Returns the widget displayed in the cell specified by \a item and the given \a column. + \sa setItemWidget(), removeItemWidget() */ QWidget *QTreeWidget::itemWidget(QTreeWidgetItem *item, int column) const { @@ -2998,9 +3001,9 @@ QWidget *QTreeWidget::itemWidget(QTreeWidgetItem *item, int column) const i.e., the QTreeWidgetItem that will hold \a widget must have been added to the view before \a widget is set. - \note The tree takes ownership of the widget. + \note The tree takes ownership of \a widget. - \sa {Delegate Classes} + \sa itemWidget(), removeItemWidget(), {Delegate Classes} */ void QTreeWidget::setItemWidget(QTreeWidgetItem *item, int column, QWidget *widget) {