Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Set QAuthenticator values in other thread
Qt 6.11 is out! See what's new in the release blog

Set QAuthenticator values in other thread

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TonyR
    wrote on last edited by
    #1

    I need set proxy credentials for QNetworkAccessManager.

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

    Slot is located in the UI thread, because I need show dialog where user can enter user name and password.
    When signal emmited the code in the slot is executed but there is no authorization on proxy. I'm looking on proxy monitor and see error "Proxy authorization required" for my request but signal proxyAuthenticationRequired not emmited again.

    If I put slot realisation in the same thread with QNetworkAccessManger all ok with return athenticator but I can't open dialog.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TonyR
      wrote on last edited by
      #2

      Solved this trouble

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

      Change type connection on [[doc:Qt::BlockingQueuedConnection]]

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved