Connect for "proxyAuthenticationRequired" requires for registration of the QNetworkProxy

  • I need handle the signal proxyAuthenticationRequired of QNetworkAccessManager and show dialog. I wrote

    @ QObject::connect(nam, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
    mainWin, SLOT(onProxyAuthenticationRequired(QNetworkProxy, QAuthenticator*)));@

    where mainWin is a class for main window. But in console i see follow messages

    @QObject::connect: Cannot queue arguments of type 'QNetworkProxy'
    (Make sure 'QNetworkProxy' is registered using qRegisterMetaType().)@

    I knew about typedef and qRegisterMetaType, but I thought that QNetworkProxy should already be registered.

  • And instead it's not. :-)
    What's the problem in doing that?

  • I would bet a penny that

    #include <QNetworkProxy>
    // or
    #include <QNetworkAccessManager>

    in the source file that establishes the connection will cure the error.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.