title: Error: expected ')' before 'ID'
body: <p>I'm writing client server program that server is multi thread, I want to use while() for creating loop in my thread , but it get the following error in myhthread.cpp:
  "expected ')' before 'ID'"
  I know my problem is basic but i am really confused about it... how can i create loop for it?Here is my code:</p>
  
  <p>mythread.h </p>
  
  <pre><code>#ifndef MYTHREAD_H
  #define MYTHREAD_H
  #include &lt;QThread&gt;
  #include &lt;QMainWindow&gt;
  #include &lt;QTcpServer&gt;
  #include &lt;QTcpSocket&gt;
  #include "myserver.h"
  #include &lt;QDebug&gt;
  
  class mythread : public QThread
  {
  Q_OBJECT
  
  public:
  
  mythread(qintptr ID, QObject *parent) :
  
      QThread(parent)
  {
      this-&gt;socketDescriptor = ID;
  }
  
      void run()
      {
        qDebug() &lt;&lt; " Thread started";
  
        socket = new QTcpSocket();
  
        if(!socket-&gt;setSocketDescriptor(this-&gt;socketDescriptor))
            {
                emit error(socket-&gt;error());
                return;
            }
  
  //        if (m_client)
  
  
        connect(socket, SIGNAL(readyRead()), this, SLOT(readyRead()), Qt::DirectConnection);
  
        connect(socket, SIGNAL(disconnected()), this, SLOT(disconnected()));
  
  
        qDebug() &lt;&lt; socketDescriptor &lt;&lt; " Client connected";
  
          exec();
      }
  
  signals:
  
  void error(QTcpSocket::SocketError socketerror);
  
  public slots:
  
  void readyRead();
  void disconnected();
  
  private:
  
  QTcpSocket* socket;
  qintptr socketDescriptor;
  
  };
  
  #endif
  </code></pre>
  
  <p>mythread.cpp:</p>
  
  <pre><code>#include "mythread.h"
  #include "myserver.h"
  
  
  mythread(qintptr ID, QObject *parent) :
  {
     while(disconnected)
     {
        mythread::run();
     }
  }
  
  void mythread::readyRead()
  
  {
  
  QByteArray Data = socket-&gt;readAll();
  
  qDebug()&lt;&lt; " Data in: " &lt;&lt; Data;
  
  socket-&gt;write(Data);
  }
  
  
  void mythread::disconnected()
  
  {
  
  qDebug() &lt;&lt; " Disconnected";
  
  socket-&gt;deleteLater();
  
  exit(0);
  
  }
  </code></pre>