Hello, I have a problem with my program, I hope you could help me!

I have written this code for download a file from internet. The problem is that it does not get download the file. I think that's code
Qt Code:
  1. reply = qnam.get(QNetworkRequest(url));
To copy to clipboard, switch view to plain text mode 
does not emit the signal ReadyRead, such as say the oficial documentation.

Qt Code:
  1. Posts a request to obtain the contents of the target request and returns a new QNetworkReply object opened for reading which emits the readyRead() signal whenever new data arrives.
To copy to clipboard, switch view to plain text mode 

Which is the problem of the code?

updates.h

Qt Code:
  1. #include <QString>
  2. #include <QFile>
  3. #include <QNetworkReply>
  4. #include <QtNetwork/QtNetwork>
  5. #include <QtNetwork/QNetworkAccessManager>
  6. #include <QWidget>
  7. #include <QObject>
  8. #include <QMainWindow>
  9. #include <QProgressDialog>
  10.  
  11. class updates : public QMainWindow
  12. {
  13. Q_OBJECT
  14.  
  15. public:
  16. updates(QWidget *parent = 0);
  17. void checkUpdates(QString version);
  18. private:
  19. QString fileNameUpdate,versionInstalled,pathDownload;
  20. QFile *file;
  21. QNetworkReply *reply;
  22. QNetworkAccessManager qnam;
  23. bool httpRequestAborted;
  24. int iVersion;
  25.  
  26. void download(QString textUpdate);
  27.  
  28. QProgressDialog *dialog;
  29.  
  30. private slots:
  31. void httpFinished();
  32. void httpFinishedDownload();
  33. void httpReadyRead();
  34. void replyErrorActualizaciones(QNetworkReply::NetworkError code);
  35. void updateDataReadProgress(qint64,qint64);
  36. };
To copy to clipboard, switch view to plain text mode 



updates.cpp

Qt Code:
  1. #include <QUrl>
  2. #include <QFileInfo>
  3. //#include <QObject>
  4. #include <QDebug>
  5. #include <QMessageBox>
  6. #include <QFileDialog>
  7. #include <QProcess>
  8. #include <QStringList>
  9.  
  10. #include "updates.h"
  11.  
  12. updates::updates (QWidget *parent) :
  13. QMainWindow(parent)
  14. {
  15. iVersion =0;
  16. }
  17.  
  18.  
  19. void updates::checkUpdates(QString version)
  20. {
  21. httpRequestAborted=false;
  22.  
  23. //Variables
  24. QUrl url("http://weblink.link/link");
  25. QFileInfo fileInfo(url.path());//url.path() devuelve a partir del .es/ .com/ .org/
  26. fileNameUpdate.append(fileInfo.fileName());//nombre del arvhivo //.fileinfo -Returns the name of the file, excluding the path.
  27.  
  28. file = new QFile(fileNameUpdate);
  29. file->open(QIODevice::WriteOnly);
  30. //Hasta aqui simplemente creo el archivo para poder escribir en el
  31. versionInstalled = version;
  32.  
  33. reply = qnam.get(QNetworkRequest(url));//se supone que esto emite la readyRead(), pero no funciona!!
  34. qDebug() << reply;
  35.  
  36. connect(reply, SIGNAL(finished()),this, SLOT(httpFinished()));
  37. connect(reply, SIGNAL(readyRead()),this, SLOT(httpReadyRead()));
  38. connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(replyErrorActualizaciones(QNetworkReply::NetworkError)));
  39.  
  40. }//checkUpdate
  41.  
  42.  
  43. //Private slots
  44.  
  45. void updates::httpFinished()
  46. {
  47. //Variables
  48. QString text,auxiliar;
  49. bool ok;
  50. double versionServidor;
  51. QFile fileToRead;
  52.  
  53. if (httpRequestAborted)
  54. {
  55. if (file)
  56. {
  57. file->close();
  58. file->remove();
  59. delete file;
  60. file = 0;
  61. }
  62. reply->deleteLater();
  63. return;
  64. }//if
  65.  
  66. file->close();
  67.  
  68. .
  69. .
  70. .
  71. .
  72. .
  73.  
  74. void updates::httpReadyRead()
  75. {
  76. if (file)
  77. file->write(reply->readAll());
  78.  
  79. qDebug() << "Ready";
  80. }//httpReadyRead
  81.  
  82. void updates::replyErrorActualizaciones(QNetworkReply::NetworkError code)
  83. {
  84. qDebug() << "Download error: " << code;
  85. httpRequestAborted = true;
  86. }//replyErrorActualizaciones
  87.  
  88. void updates::httpFinishedDownload()
  89. {
  90. if (httpRequestAborted)
  91. {
  92. if (file)
  93. {
  94. file->close();
  95. file->remove();
  96. delete file;
  97. file = 0;
  98. }
  99. reply->deleteLater();
  100. .
  101. .
  102. .
  103. .
  104. .
To copy to clipboard, switch view to plain text mode 

I use that class from MainWindow.cpp

MainWindow.cpp

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. connect(ui->actionActualizaciones,SIGNAL(triggered()),SLOT(slotCheckUpdates()));
  6. }
  7.  
  8. .
  9. .
  10. .
  11. .
  12.  
  13. void MainWindow::slotCheckUpdates()
  14. {
  15. updates a(this);
  16. a.checkUpdates(version);
  17. }//updates
To copy to clipboard, switch view to plain text mode 

I have thought a long time why it does not work and can not find the reason, I hope you could help me!

Thanks!