title: QT: No such slot/how to create new makefile?
body: <p>Hey I searched nearly the whole evening for an answer and couldn find one.
  I have following error in my QT creator application.
  I will post you my mainwindow.h , my main.cpp and my mainwindow.cpp too,
  i found some answers that i have to regenerate some files because the compiler doas not makes it on his own and found some commands (for example qmake -tp vc projectname.pro)
  in the help but it didn't worked :( so please help me im nearly crying :D
  I just want to change the central widget of the mainwindow per slot ;)</p>
  
  <p><strong>the error</strong></p>
  
  <pre><code>QObject::connect: No such slot MainWindow::scW(mainwindow1)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scW(mainwindow2)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scW(mainwindow3)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scW(mainwindow1)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scW(mainwindow2)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scW(mainwindow3)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scW(mainwindow1)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scw(mainwindow2)
  QObject::connect:  (receiver name: 'MainWindow')
  QObject::connect: No such slot MainWindow::scW(mainwindow3)
  QObject::connect:  (receiver name: 'MainWindow')
  </code></pre>
  
  <p><strong>mainwindow.h</strong></p>
  
  <pre><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  
  namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();
  
  public slots:
      void scW(QWidget *widget);
  
  private:
      Ui::MainWindow *ui;
  };
  
  #endif // MAINWINDOW_H
  </code></pre>
  
  <p><strong>mainwindow.cpp</strong></p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
  }
  
  void MainWindow::scW(QWidget *widget){
     this-&gt;setCentralWidget(widget);
  }
  
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  </code></pre>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include "mainwindow.h"
  #include &lt;QApplication&gt;
  #include &lt;QWidget&gt;
  #include &lt;QPushButton&gt;
  #include &lt;QVBoxLayout&gt;
  #include &lt;QHBoxLayout&gt;
  #include &lt;QGridLayout&gt;
  #include &lt;QLabel&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
  
      MainWindow *w=new MainWindow;
  
          QWidget *mainwindow1=new QWidget;
          QWidget *mainwindow2=new QWidget;
          QWidget *mainwindow3=new QWidget;
          QGridLayout *gridlay1=new QGridLayout;
          QGridLayout *gridlay2=new QGridLayout;
          QGridLayout *gridlay3=new QGridLayout;
          QWidget *window11=new QWidget;
          QWidget *window21=new QWidget;
          QWidget *window31=new QWidget;
          QVBoxLayout *vblay1=new QVBoxLayout;
          QVBoxLayout *vblay2=new QVBoxLayout;
          QVBoxLayout *vblay3=new QVBoxLayout;
          QPushButton *button_eins1=new QPushButton("Menü 1");
          QPushButton *button_zwei1=new QPushButton("Menü 2");
          QPushButton *button_drei1=new QPushButton("Menü 3");
          QPushButton *button_eins2=new QPushButton("Menü 1");
          QPushButton *button_zwei2=new QPushButton("Menü 2");
          QPushButton *button_drei2=new QPushButton("Menü 3");
          QPushButton *button_eins3=new QPushButton("Menü 1");
          QPushButton *button_zwei3=new QPushButton("Menü 2");
          QPushButton *button_drei3=new QPushButton("Menü 3");
  
          vblay1-&gt;addWidget(button_eins1);
          vblay1-&gt;addWidget(button_zwei1);
          vblay1-&gt;addWidget(button_drei1);
          vblay2-&gt;addWidget(button_eins2);
          vblay2-&gt;addWidget(button_zwei2);
          vblay2-&gt;addWidget(button_drei2);
          vblay3-&gt;addWidget(button_eins3);
          vblay3-&gt;addWidget(button_zwei3);
          vblay3-&gt;addWidget(button_drei3);
          window11-&gt;setLayout(vblay1);
          window21-&gt;setLayout(vblay2);
          window31-&gt;setLayout(vblay3);
  
          gridlay1-&gt;addWidget(window11,0,0);
          gridlay2-&gt;addWidget(window21,0,0);
          gridlay3-&gt;addWidget(window31,0,0);
  
          //Untermenü1
          QWidget *window12=new QWidget;
          QVBoxLayout *vblay12=new QVBoxLayout;
          QLabel *label1=new QLabel("willkommen!");
          vblay12-&gt;addWidget(label1);
          window12-&gt;setLayout(vblay12);
  
          gridlay1-&gt;addWidget(window12,0,1);
          //Ende Untermenü1
  
          //Untermenü2
          QWidget *window22=new QWidget;
          QVBoxLayout *vblay22=new QVBoxLayout;
          QLabel *label2=new QLabel("Untermenü 1!");
          vblay22-&gt;addWidget(label2);
          window22-&gt;setLayout(vblay22);
  
          gridlay2-&gt;addWidget(window22,0,1);
          //Ende Untermenü
  
          //Untermenü3
          QWidget *window32=new QWidget;
          QVBoxLayout *vblay32=new QVBoxLayout;
          QLabel *label3=new QLabel("Untermenü 2!");
          vblay32-&gt;addWidget(label3);
          window32-&gt;setLayout(vblay32);
  
          gridlay3-&gt;addWidget(window32,0,1);
          //Ende Untermenü
  
          mainwindow1-&gt;setLayout(gridlay1);
          mainwindow2-&gt;setLayout(gridlay2);
          mainwindow3-&gt;setLayout(gridlay3);
  
          w-&gt;setCentralWidget(mainwindow1);
  
          QObject::connect(button_eins1,SIGNAL(clicked()),w,SLOT(scW(mainwindow1)));
          QObject::connect(button_zwei1,SIGNAL(clicked()),w,SLOT(scW(mainwindow2)));
          QObject::connect(button_drei1,SIGNAL(clicked()),w,SLOT(scW(mainwindow3)));
          QObject::connect(button_eins2,SIGNAL(clicked()),w,SLOT(scW(mainwindow1)));
          QObject::connect(button_zwei2,SIGNAL(clicked()),w,SLOT(scW(mainwindow2)));
          QObject::connect(button_drei2,SIGNAL(clicked()),w,SLOT(scW(mainwindow3)));
          QObject::connect(button_eins3,SIGNAL(clicked()),w,SLOT(scW(mainwindow1)));
          QObject::connect(button_zwei3,SIGNAL(clicked()),w,SLOT(scw(mainwindow2)));
          QObject::connect(button_drei3,SIGNAL(clicked()),w,SLOT(scW(mainwindow3)));
          w-&gt;show();
  
      return a.exec();
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is a new Code i wrote with one creator and 3 Slots of a qwidget class i add to the main window in main.cpp.. I still get a error that the slots mapped(a,b,c dont exist. please help:D
  greez</p>
  
  <pre><code>#include "window1.h"
  #include "window2.h"
  #include "window3.h"
  #include "window4.h"
  #include &lt;QPushButton&gt;
  #include &lt;QSignalMapper&gt;
  #include &lt;QVBoxLayout&gt;
  #include &lt;QGridLayout&gt;
  #include &lt;QWidget&gt;
  #include &lt;QObject&gt;
  #include &lt;QLabel&gt;
  
  window1::window1(QWidget *parent) :
      QWidget(parent)
  {
      int a=1,b=2,c=3;
      QWidget *menu_win=new QWidget;
      window3 *cont_two_win=new window3();
      window4 *cont_three_win=new window4();
      QPushButton *buttone_one=new QPushButton("one");
      QPushButton *buttone_two=new QPushButton("two");
      QPushButton *buttone_three=new QPushButton("three");
      QVBoxLayout *vblay=new QVBoxLayout;
      QGridLayout *gridlay=new QGridLayout;
      QSignalMapper *signalmapper=new QSignalMapper();
  
      vblay-&gt;addWidget(buttone_one);
      vblay-&gt;addWidget(buttone_two);
      vblay-&gt;addWidget(buttone_three);
  
      menu_win-&gt;setLayout(vblay);
      gridlay-&gt;addWidget(menu_win,0,0);
     // gridlay-&gt;addWidget(cont_win,0,1);
      this-&gt;setLayout(gridlay);
  
      QObject::connect(buttone_one,SIGNAL(clicked()),signalmapper,SLOT(map()));
      QObject::connect(buttone_two,SIGNAL(clicked()),signalmapper,SLOT(map()));
      QObject::connect(buttone_three,SIGNAL(clicked()),signalmapper,SLOT(map()));
  
      signalmapper-&gt;setMapping(buttone_one,a);
      signalmapper-&gt;setMapping(buttone_two,b);
      signalmapper-&gt;setMapping(buttone_three,c);
  
      QObject::connect(signalmapper,SIGNAL(mapped(a)),this,SLOT(change_cont_one(&amp;gridlay)));
      QObject::connect(signalmapper,SIGNAL(mapped(b)),this,SLOT(change_cont_two(&amp;gridlay)));
      QObject::connect(signalmapper,SIGNAL(mapped(c)),this,SLOT(change_cont_three(&amp;gridlay)));
  }
  
  void window1::change_cont_one(QGridLayout **gridlay){
      window2 *cont_one_win=new window2();
      QLabel *label=new QLabel("Test1");
      QVBoxLayout *vblay=new QVBoxLayout;
      vblay-&gt;addWidget(label);
      cont_one_win-&gt;setLayout(vblay);
      (*gridlay)-&gt;addWidget(cont_one_win,0,1);
  }
  
  void window1::change_cont_two(QGridLayout **gridlay){
      window2 *cont_one_win=new window2();
      QLabel *label=new QLabel("Test2");
      QVBoxLayout *vblay=new QVBoxLayout;
      vblay-&gt;addWidget(label);
      cont_one_win-&gt;setLayout(vblay);
      (*gridlay)-&gt;addWidget(cont_one_win,0,1);
  }
  
  
  void window1::change_cont_three(QGridLayout **gridlay){
      window2 *cont_one_win=new window2();
      QLabel *label=new QLabel("Test3");
      QVBoxLayout *vblay=new QVBoxLayout;
      vblay-&gt;addWidget(label);
      cont_one_win-&gt;setLayout(vblay);
      (*gridlay)-&gt;addWidget(cont_one_win,0,1);
  }
  </code></pre>