title: C++ Qt base class virtual destructor
body: <p>Do we need a virtual destructor for a classes which are gonna be used in Qt-way: set <code>QObject</code>-parent which will call in QObject's destructor <code>deleteLater()</code> or something like that for any object for which it was set as parent?</p>
  
  <p>For example:</p>
  
  <pre><code>class MyWidget : public QWidget {
  public:
      MyWidget() {
          w = new QWidget(this);
          // "w" will be deleted automatically by parent MyWidget::QWidget::QObject's destructor afaik
      }
  private:
      QWidget *w;
  }
  </code></pre>
  
  <p>Do we need a virtual destructor for <code>MyWidget</code> class if it is gonna be inherited? I see no reason for this because it does not delete anything and each property of the class which is derived from <code>QObject</code> will be deleted from <strong>MyWidget::QWidget::QObject</strong>'s destructor.</p>