title: copy constructor of derived QT class
body: <p>I have a class which is publicly inherited from <code>QWidget</code>:</p>
  
  <pre><code>class MyWidget : public QWidget
  {
      Q_OBJECT
  public:
      MyWidget(const MyWidget&amp; other)
        :
      obj1(other.obj1),
      obj2(other.obj2)
  
  private:
      some_class obj1;
      some_class obj2;
  };
  </code></pre>
  
  <p>When I built my project, compiler complains:</p>
  
  <blockquote>
    <p>WARNING:: Base class "class QWidget" should be explicitly initialized
    in the copy constructor.</p>
  </blockquote>
  
  <p>I checked out from other questions on stackoverflow, and got my answer.
  But the fact is, when I added that initialization like this:</p>
  
  <pre><code>class MyWidget : public QWidget
  {
      Q_OBJECT
  public:
      MyWidget(const MyWidget&amp; other)
        :
      QWidget(other),   //I added the missing initialization of Base class
      obj1(other.obj1),
      obj2(other.obj2)
  
  private:
      some_class obj1;
      some_class obj2;
  };
  </code></pre>
  
  <p>I got compile error:</p>
  
  <blockquote>
    <p>QWidget::QWidget(const QWidget&amp;) is private within this context</p>
  </blockquote>
  
  <p>So, please explain me what I am doing wrong.</p>