[webkit-qt] can't connect authenticationRequired signal

Zhou Peng zhoupeng19 at 126.com
Wed Feb 15 00:41:26 PST 2012


Hi,all!
I'm trying to login automatic with qtwebkit, so I connect 
authenticationRequired signal:

class loader: public QObject
{
    Q_OBJECT
public:
    loader()
    {
        view = new QWebView();
        QObject::connect(view->page()->networkAccessManager(), 
SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, 
SLOT(handleauthenticationRequired(QNetworkReply*,QAuthenticator*)));
    }
    void load(QUrl url)
    {
        view->load(url);
        view->show();
    }
public slots:
    void handleauthenticationRequired(QNetworkReply* reply,QAuthenticator* 
auth)
    {
         ......       //this slot has never be called
    }
private:
    QWebView* view;
};

int main(int argc, char* argv[])
{
    ......
    loader l;
    l.load(QUrl("http://weibo.com/u/2141100877"));
    ......
}

the handleauthenticationRequired slot has never be called, can anybody tell 
me why?









More information about the webkit-qt mailing list