void ServerDialog::acceptConnection() {
if (!file->open(QIODevice::WriteOnly)) {
cerr << "Unable to write the file" << endl;
delete file;
file = 0;
return;
}
clientConnection = server.nextPendingConnection();
connect(clientConnection, SIGNAL(readyRead()),
this, SLOT(updateProgress()));
connect(clientConnection, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(displayError(QAbstractSocket::SocketError)));
server.close(); //我觉得不应该有这一句。
QApplication::setOverrideCursor(Qt::WaitCursor);
}