I have tried so many things but still problem persists.

I can see that server is started and can connect using telnet. But it does not invoke new connection slot. What seems to be wrong?

main.cpp
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. core = new QGCCore(firstStart, argc, argv);
  4. val = core->exec();
  5. }
To copy to clipboard, switch view to plain text mode 

QGCCore.cpp:

Qt Code:
  1. QGCCore::QGCCore(bool firstStart, int &argc, char* argv[]) : QApplication(argc, argv),
  2. restartRequested(false),
  3. welcome(NULL)
  4. {
  5. Server s;
  6. s.listen();
  7. }
To copy to clipboard, switch view to plain text mode 

server.cpp
Qt Code:
  1. #include "server.h"
  2. #include <QTcpServer>
  3. #include <QTcpSocket>
  4. #include <cstdio>
  5. #include <QDebug>
  6.  
  7. Server::Server(QObject *parent) :
  8. QObject(parent)
  9. {
  10. server = new QTcpServer(this);
  11. connect(server, SIGNAL(newConnection()),
  12. this, SLOT(on_newConnection()));
  13. qDebug() << "Server instance created";
  14. }
  15.  
  16. void Server::listen()
  17. {
  18. server->listen(QHostAddress::Any, 1234);
  19. qDebug() << "Server listening to 1234";
  20. }
  21.  
  22. void Server::on_newConnection()
  23. {
  24. qDebug() << "New connection made!";
  25. }
To copy to clipboard, switch view to plain text mode