我寫了使用QHTTP得到一個網頁的程序。這在Linux上正常工作,但不能在我的Windows機器上運行(Vista)。看來,qhttp完成信號從來沒有收到。我QHTTP得到()調用不能在Windows工作,但確實在Linux上
相關的代碼是:
Window::Window()
{
http = new QHttp(this);
connect(http, SIGNAL(done(bool)), this, SLOT(httpDone(bool)));
url = new QUrl("http://something.com/status.xml");
http->setHost(url->host(), url->port() != -1 ? url->port() : 80);
if (!url->userName().isEmpty()) http->setUser(url->userName(), url->password());
}
void Window::retrievePage()
{
byteArray = new QByteArray;
result = new QBuffer(byteArray);
result->open(QIODevice::WriteOnly);
httpRequestAborted = false;
httpGetId = http->get(url->path(), result);
}
void Window::httpDone(bool error)
{
//Never gets here!
}
任何幫助將appriecated。
馬特
你能確保這是不是那些UAC問題之一?嘗試關閉UAC並讓我們知道您是否看到任何安全彈出窗口。 – dirkgently 2009-04-29 16:08:31