Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0
-
None
-
RHEL 5.5
-
3f6d48ad326fd261153cec1b9eab1da00a144066
Description
The documentation of QStackedWidget::removeWidget is quite confusing:
"Note: The ownership of widget remains the same. The widget is not deleted, but simply removed from the widget's stacked layout, causing it to be hidden."
But, QStackedWidget::addWidget says:
"Appends the given widget to the QStackedWidget and returns the index position. Ownership of widget is passed on to the QStackedWidget."
This suggests that ownership of the widget remains with the QStackedWidget after removal - and that it's impossible to free the memory, since the widget is just hidden. Actually, ownership transfers back to the application and it's up to it to 'delete' the widget to free the memory.
The documentation should make it clear ownership transfers back to the application.
Attachments
Issue Links
- resulted in
-
QTBUG-44891 QStackedWidget continues to retain ownership of widget even after removeWidget() is called.
- Closed