Hello, I have a problem with the signal slots. I have a main.cpp file and 2 classes, mainwindow and server.

The main.cpp is the next one:

Qt Code:
  1. w = new MainWindow();
  2. zerbitzaria = new Server();
  3. //Konexioak egiten dira zerbitzariarekin
  4.  
  5. qDebug () << QObject::connect(zerbitzaria, &Server::setSEtxekoPuntuakGora, w, &MainWindow::setMWEtxekoPuntuakGora);
To copy to clipboard, switch view to plain text mode 

I create 2 different objects and the I connect it.

In the server.h file I have this:

Qt Code:
  1. class Server: public QObject
  2. {
  3. Q_OBJECT
  4. signals:
  5. void setSEtxekoPuntuakGora();
To copy to clipboard, switch view to plain text mode 

In server.cpp I call to the signal using emit command:

Qt Code:
  1. switch (comandos)
  2. {
  3. case agindua::EtxekoPuntuakGora:
  4. {
  5. emit setSEtxekoPuntuakGora();
  6. break;
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 

In the mainwindow class, I have defined the slot(mainwindow.h):
Qt Code:
  1. public slots:
  2. void setMWEtxekoPuntuakGora();
To copy to clipboard, switch view to plain text mode 

And then i have implemented (mainwindows.cpp):

Qt Code:
  1. void MainWindow::setMWEtxekoPuntuakGora()
  2. {
  3. int A = ui->LCD_Etxekoak->intValue();
  4. A++;
  5. if (A < 999 && A>=0) ui->LCD_Etxekoak->display(A);
  6. }
To copy to clipboard, switch view to plain text mode 

both classes has the Q_OBJECT. And I have debugged and see that the connect function return true. Finally I put the breakpoint at the emit setSEtxekoPuntuakGora(); point and I see that the debugger stops there. So everything is ok but it never enters in the slot function.

Can anyone help me?
Thank you