title: Invalid use of incomplete type on qt private class
body: <p>I want to use the d-pointer in a derived class with the help of Q_D macro.</p>
  
  <p>Here is my parent class:</p>
  
  <pre><code>class DIGIKAM_EXPORT GraphicsDImgView : public QGraphicsView
  {
      Q_OBJECT
  
  public:
      class GraphicsDImgViewPrivate;
  
  protected:
      GraphicsDImgViewPrivate* const d_ptr;
  
  protected:
      Q_DECLARE_PRIVATE(GraphicsDImgView)
  };
  </code></pre>
  
  <p>and my GraphicsDImgViewPrivate class:</p>
  
  <pre><code>class GraphicsDImgView::GraphicsDImgViewPrivate
  {
  public:
  
      GraphicsDImgViewPrivate()
      {
          scene            = 0;
          item             = 0;
          layout           = 0;
          cornerButton     = 0;
          panIconPopup     = 0;
          movingInProgress = false;
          showText         = true;
      }
  
      QGraphicsScene*           scene;
      GraphicsDImgItem*         item;
      SinglePhotoPreviewLayout* layout;
  
      QToolButton*              cornerButton;
      KPopupFrame*              panIconPopup;
  
      QPoint                    mousePressPos;
      QPoint                    panningScrollPos;
      bool                      movingInProgress;
      bool                      showText;
  };
  
  GraphicsDImgView::GraphicsDImgView(QWidget* const parent)
      : QGraphicsView(parent), d_ptr(new GraphicsDImgViewPrivate)
  {
      Q_D(GraphicsDImgView);
      d-&gt;scene  = new QGraphicsScene(this);
      d-&gt;scene-&gt;setItemIndexMethod(QGraphicsScene::NoIndex);
  
      setScene(d-&gt;scene);
      d-&gt;layout = new SinglePhotoPreviewLayout(this);
      d-&gt;layout-&gt;setGraphicsView(this);
  }
  </code></pre>
  
  <p>and in the <strong>derived</strong> class I write a method in which I want to use the d-pointer of GraphicsDImgView:</p>
  
  <pre><code>bool ImageRegionWidget::movingInProgress()
  {
      Q_D(GraphicsDImgView);
      return d-&gt;movingInProgress;
  }
  </code></pre>
  
  <p>However the build gives me the following error message</p>
  
  <blockquote>
    <p>In member function ‘bool Digikam::ImageRegionWidget::movingInProgress()’:...path....
    error: invalid use of incomplete type ‘class GraphicsDImgView::GraphicsDImgViewPrivate’</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>graphicsdimgview.h:128:11: error: forward declaration of ‘class GraphicsDImgView::GraphicsDImgViewPrivate’</p>
  </blockquote>
  
  <p>I followed exactly the documentation so I don't know where I went wrong. Maybe I'm being careless. Please help me point out my error. Thanks :)</p>