title: Smart pointers memory managers in Qt
body: <p>I'm trying to develop a Qt Application for mobile phones, so I decided not to use any standard library(as I fear some platform may not yet be supported). So, I had to reimplement the smart pointer wrapper(using the standard draft, of course) without any standard headers. In Qt, there are some Widgets, such as QMenu and QToolBar which when needed to be created -- It is created as such</p>
  
  <pre><code>QMenu *mainMenu = new QMenu;
  QToolBar *toolBar = new QToolBar;
  //To add a new menu bar or ToolBar, we do
  mainMenu = menuBar()-&gt;addMenu("&amp;File");
  //add all the elements to the first menuBar
  mainMenu-&gt;addAction(QAction { });
  mainMenu = menuBar()-&gt;addMenu("&amp;Edit"); //for second Menu
  //same goes for QToolBar
  </code></pre>
  
  <p>The only way I implemented the unique_ptr "observers" is to use the get(), operator* and operator-> member functions to access the underlying members. What's obvious is that MenuBar()->addNew() returns a new pointer to another mainMenu.
  Now to my question(s), what happens to the old pointer(s) that ? What keeps track of them? How can smart pointers be used in replacement of these naked pointers or do I have to stick with the "good old ways" of using strictly the naked pointers?</p>
  
  <p>NOTE: All files can be found <a href="http://github.com/iamOgunyinka/MoCoVA" rel="nofollow">here</a></p>