Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Using XMLHttpRequest in QML when behind a proxy
Forum Updated to NodeBB v4.3 + New Features

Using XMLHttpRequest in QML when behind a proxy

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 6.1k 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.
  • B Offline
    B Offline
    billbonney
    wrote on last edited by
    #1

    Does anybody know how to set a proxy for use when using Qt Quick/Qt Creator 4.7 Beta II on Windows 7 system?

    Thanks

    1 Reply Last reply
    0
    • B Offline
      B Offline
      billbonney
      wrote on last edited by
      #2

      It seems that the simple way to do this is by hosting your qml file in a C++ app. See C:\Qt\4.7.0-beta2\examples\declarative\cppextensions\networkaccessmanagerfactory as an example.

      You essentially create your own QNetworkAccessManager object and set the proxy on that before creating the QDeclarativeView and calling view.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory);

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbrasser
        wrote on last edited by
        #3

        If you are using qmlviewer to run your QML, you should be able to set a proxy via "Settings->HTTP Proxy"

        Regards,
        Michael

        1 Reply Last reply
        0
        • B Offline
          B Offline
          burkhard.stubert
          Qt Champion 2021
          wrote on last edited by
          #4

          There is a special factory QDeclarativeNetworkAccessManagerFactory to create a network access manager that should be used when accessing the network from QML. The manager created is then made known to the declarative engine by QDeclarativeEngine::setNetworkAccessManagerFactory(), as PixelQ stated already.

          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