The above method was working the whole time the problem was the bytes it was receiving was so small you could not tell it had downloaded at all, once I attempted to download a larger file the bytes being downloaded were adequately displayed :)
Here is the method I ended up with that could receive a request and save it disk.
void MainWindow::unsupportedContent(QNetworkReply *reply) {
QString str = reply->rawHeader("Content-Disposition");
QString end = str.mid(21);
end.chop(1);
QString defaultFileName = QFileInfo(end).fileName();
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), defaultFileName);
if (fileName.isEmpty()) return;
file = new QFile(fileName);
if(!file->open(QIODevice::WriteOnly))
{
QMessageBox::information(this, "Downloader",
tr("Unable to save the file %1: %2.")
.arg(fileName).arg(file->errorString()));
delete file;
file = NULL;
return;
}
downloadRequestAborted = false;
if(!reply->isFinished()){
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), SLOT(downloadProgress(qint64, qint64)));
connect(progressDialog, SIGNAL(canceled()), SLOT(cancelDownload()));
progressDialog->setLabelText(tr("Downloading %1...").arg(fileName));
progressDialog->exec();
//return;
}
if(downloadRequestAborted)
{
if(file)
{
file->close();
file->remove();
delete file;
file = NULL;
}
reply->abort();
reply->deleteLater();
progressDialog->hide();
return;
}
file->write(reply->read(reply->bytesAvailable()));
file->flush();
file->close();
file = NULL;
if(file == NULL){
isDownload = true;
fileURL = fileName;
systray->showMessage("CytoViewer v1.0", "Download finished - Click to open", QSystemTrayIcon::NoIcon, 10000);
}
}