Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10934

QStackedWidget::removeWidget documentation is confusing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.7.0
    • 4.7.0
    • Documentation
    • None
    • RHEL 5.5
    • 3f6d48ad326fd261153cec1b9eab1da00a144066

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            gbk Martin Smith (Qt)
            brucec Bruce Cran
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes