title: Don't understand why I can't call setCentralWidget in QMainWindow subclass
body: <p><code><pre>
  //clposter.h
  class CLPoster : public QMainWindow
  {
      Q_OBJECT</p>
  
  <p>public:
      CLPoster();</p>
  
  <p>private slots:
      QWidget createCentralWidget();
      void createActions();
      void createMenu();
      void createStatusBar();
      void loadSavedPosts();
  };
  </pre></code></p>
  
  <p><code><pre>
  //clposter.cpp
  CLPoster::CLPoster()
  {
      setWindowTitle("Craigslist Poster");</p>
  
  <pre><code>QWidget mainWidget = createCentralWidget();
  setCentralWidget(mainWidget);
  </code></pre>
  
  <p>//    createActions();
  //    createMenu();
  //    createStatusBar();</p>
  
  <p>//    loadSavedPosts();
  //    checkForActionsNeeded();    //May want to break up into more functions
  }
  </pre></code></p>
  
  <p>The error I'm getting is this:</p>
  
  <blockquote>
  /usr/include/qt4/QtGui/qwidget.h:: In constructor ‘CLPoster::CLPoster()’:
  
  /usr/include/qt4/QtGui/qwidget.h:787: error: ‘QWidget::QWidget(const QWidget&)’ is private
  
  /home/brett/projects/CLPoster/CLPoster-build-desktop/../CLPoster/clposter.cpp:9: error: within this context
  
  /home/brett/projects/CLPoster/CLPoster-build-desktop/../CLPoster/clposter.cpp:10: error: no matching function for call to ‘CLPoster::setCentralWidget(QWidget&)’
  
  /usr/include/qt4/QtGui/qmainwindow.h:141: candidates are: void QMainWindow::setCentralWidget(QWidget*)
  </blockquote>
  
  <p>I'm having trouble interpreting the error message. It says there is no matching function call, but it should be inheriting it from QMainWindow. It could just be a lack of understanding C++ more so than QT, first time I've used it, but dunno. Thanks for the help.</p>