title: Does owner of QBoxLayout become the owner of all layout widgets?
body: <p>I was looking at the example <a href="http://doc.trolltech.com/4.5/tools-customtypesending-window-cpp.html" rel="noreferrer">here</a>, and was wondering if there is no memory leaks. I have red the article talking about the subjet <a href="https://stackoverflow.com/questions/1651616/qt-does-new-without-delete-cause-memory-leaks-with-controls">mem leak on delete</a>. However while QWidgets do retain ownership of the of the widget added to the, the layout do not. </p>
  
  <p>It seems from the QT code that the parent with the layout, gets the ownership of all the widgets for this layout. However i could not seen any reference of this in docs. </p>
  
  <pre class="lang-cpp prettyprint-override"><code>Window::Window()
  {
   editor = new QTextEdit();
   QPushButton *sendButton = new QPushButton(tr("&amp;Send message"));
  
   connect(sendButton, SIGNAL(clicked()), this, SLOT(sendMessage()));
  
   QHBoxLayout *buttonLayout = new QHBoxLayout();
   buttonLayout-&gt;addStretch();
   buttonLayout-&gt;addWidget(sendButton);
   buttonLayout-&gt;addStretch();
  
   QVBoxLayout *layout = new QVBoxLayout(this);
   layout-&gt;addWidget(editor);
   layout-&gt;addLayout(buttonLayout);
  
   setWindowTitle(tr("Custom Type Sending"));
  }
  </code></pre>