// downloadButton = new QPushButton(tr("Download"));
quitButton->setDefault(true);
connect(http, SIGNAL(requestFinished(int, bool)),
this, SLOT(httpRequestFinished(int, bool)));
connect(http, SIGNAL(dataReadProgress(int, int)),
this, SLOT(updateDataReadProgress(int, int)));
// connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
buttonLayout->addStretch(1);
// buttonLayout->addWidget(downloadButton);
buttonLayout->addWidget(quitButton);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
setWindowTitle(tr("HTTP"));
QString url
= "http://api.smsbox.fr/index.php?login=ahcoeur&pass=aaaaaa&action=credit";
downloadFile(url);
}
void HttpWindow
::downloadFile(QString mUrl
)
quitButton = new QPushButton(tr("Quit"));
// downloadButton = new QPushButton(tr("Download"));
quitButton->setDefault(true);
http = new QHttp(this);
connect(http, SIGNAL(requestFinished(int, bool)),
this, SLOT(httpRequestFinished(int, bool)));
connect(http, SIGNAL(dataReadProgress(int, int)),
this, SLOT(updateDataReadProgress(int, int)));
connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)),
this, SLOT(readResponseHeader(const QHttpResponseHeader &)));
// connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addStretch(1);
// buttonLayout->addWidget(downloadButton);
buttonLayout->addWidget(quitButton);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
setWindowTitle(tr("HTTP"));
QString url = "http://api.smsbox.fr/index.php?login=ahcoeur&pass=aaaaaa&action=credit";
downloadFile(url);
}
void HttpWindow::downloadFile(QString mUrl)
To copy to clipboard, switch view to plain text mode
Bookmarks