int main(int argc, char *argv[]) { QApplication app(argc, argv); FileDownloader w; w.show(); w.download(QUrl("http://smplayer.berlios.de/downloads.php?tr_lang=es")); return w.exec(); }
void BrowserDialog::download(const QUrl& url) { m_ui->webView->stop(); m_ui->webView->hide(); m_ui->progressBar->hide(); m_ui->listWidget->show(); FileDownloader* downloader = new FileDownloader(this); connect(downloader, SIGNAL(message(QMessageBox::Icon,QString)), SLOT(showMessage(QMessageBox::Icon,QString))); connect(downloader, SIGNAL(finished(bool)), SLOT(downloadFinished(bool))); connect(downloader, SIGNAL(finished(bool)), downloader, SLOT(deleteLater())); downloader->download(url); }