Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6072

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qnetworkproxy.cpp -->
  <title>Qt 4.8: QNetworkProxyFactory Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtnetwork.html">QtNetwork</a></li>
<li>QNetworkProxyFactory</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#system-proxies">System Proxies</a></li>
</ul>
</div>
<h1 class="title">QNetworkProxyFactory Class Reference</h1>
<!-- $$$QNetworkProxyFactory-brief -->
<p>The QNetworkProxyFactory class provides fine-grained proxy selection. <a href="#details">More...</a></p>
<!-- @@@QNetworkProxyFactory -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QNetworkProxyFactory&gt;</span></pre><p>This class was introduced in Qt 4.5.</p>
<ul>
<li><a href="qnetworkproxyfactory-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxyfactory.html#QNetworkProxyFactory">QNetworkProxyFactory</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxyfactory.html#dtor.QNetworkProxyFactory">~QNetworkProxyFactory</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QList&lt;QNetworkProxy&gt; </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxyfactory.html#queryProxy">queryProxy</a></b> ( const QNetworkProxyQuery &amp; <i>query</i> = QNetworkProxyQuery() ) = 0</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QNetworkProxy&gt; </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxyfactory.html#proxyForQuery">proxyForQuery</a></b> ( const QNetworkProxyQuery &amp; <i>query</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxyfactory.html#setApplicationProxyFactory">setApplicationProxyFactory</a></b> ( QNetworkProxyFactory * <i>factory</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxyfactory.html#setUseSystemConfiguration">setUseSystemConfiguration</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QNetworkProxy&gt; </td><td class="memItemRight bottomAlign"><b><a href="qnetworkproxyfactory.html#systemProxyForQuery">systemProxyForQuery</a></b> ( const QNetworkProxyQuery &amp; <i>query</i> = QNetworkProxyQuery() )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QNetworkProxyFactory-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QNetworkProxyFactory class provides fine-grained proxy selection.</p>
<p>QNetworkProxyFactory is an extension to <a href="qnetworkproxy.html">QNetworkProxy</a>, allowing applications to have a more fine-grained control over which proxy servers are used, depending on the socket requesting the proxy. This allows an application to apply different settings, according to the protocol or destination hostname, for instance.</p>
<p>QNetworkProxyFactory can be set globally for an application, in which case it will override any global proxies set with <a href="qnetworkproxy.html#setApplicationProxy">QNetworkProxy::setApplicationProxy</a>(). If set globally, any sockets created with Qt will query the factory to determine the proxy to be used.</p>
<p>A factory can also be set in certain frameworks that support multiple connections, such as <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>. When set on such object, the factory will be queried for sockets created by that framework only.</p>
<a name="system-proxies"></a>
<h3>System Proxies</h3>
<p>You can configure a factory to use the system proxy's settings. Call the <a href="qnetworkproxyfactory.html#setUseSystemConfiguration">setUseSystemConfiguration</a>() function with true to enable this behavior, or false to disable it.</p>
<p>Similarly, you can use a factory to make queries directly to the system proxy by calling its <a href="qnetworkproxyfactory.html#systemProxyForQuery">systemProxyForQuery</a>() function.</p>
<p><b>Warning:</b> Depending on the configuration of the user's system, the use of system proxy features on certain platforms may be subject to limitations. The <a href="qnetworkproxyfactory.html#systemProxyForQuery">systemProxyForQuery</a>() documentation contains a list of these limitations for those platforms that are affected.</p>
</div>
<!-- @@@QNetworkProxyFactory -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNetworkProxyFactory[overload1]$$$QNetworkProxyFactory -->
<h3 class="fn"><a name="QNetworkProxyFactory"></a>QNetworkProxyFactory::<span class="name">QNetworkProxyFactory</span> ()</h3>
<p>Creates a <a href="qnetworkproxyfactory.html">QNetworkProxyFactory</a> object.</p>
<p>Since <a href="qnetworkproxyfactory.html">QNetworkProxyFactory</a> is an abstract class, you cannot create objects of type <a href="qnetworkproxyfactory.html">QNetworkProxyFactory</a> directly.</p>
<!-- @@@QNetworkProxyFactory -->
<!-- $$$~QNetworkProxyFactory[overload1]$$$~QNetworkProxyFactory -->
<h3 class="fn"><a name="dtor.QNetworkProxyFactory"></a>QNetworkProxyFactory::<span class="name">~QNetworkProxyFactory</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the <a href="qnetworkproxyfactory.html">QNetworkProxyFactory</a> object.</p>
<!-- @@@~QNetworkProxyFactory -->
<!-- $$$proxyForQuery[overload1]$$$proxyForQueryconstQNetworkProxyQuery& -->
<h3 class="fn"><a name="proxyForQuery"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qnetworkproxy.html">QNetworkProxy</a></span>&gt; QNetworkProxyFactory::<span class="name">proxyForQuery</span> ( const <span class="type"><a href="qnetworkproxyquery.html">QNetworkProxyQuery</a></span> &amp; <i>query</i> )<tt> [static]</tt></h3>
<p>This function takes the query request, <i>query</i>, examines the details of the type of socket or request and returns a list of <a href="qnetworkproxy.html">QNetworkProxy</a> objects that indicate the proxy servers to be used, in order of preference.</p>
<!-- @@@proxyForQuery -->
<!-- $$$queryProxy[overload1]$$$queryProxyconstQNetworkProxyQuery& -->
<h3 class="fn"><a name="queryProxy"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qnetworkproxy.html">QNetworkProxy</a></span>&gt; QNetworkProxyFactory::<span class="name">queryProxy</span> ( const <span class="type"><a href="qnetworkproxyquery.html">QNetworkProxyQuery</a></span> &amp; <i>query</i> = QNetworkProxyQuery() )<tt> [pure virtual]</tt></h3>
<p>This function takes the query request, <i>query</i>, examines the details of the type of socket or request and returns a list of <a href="qnetworkproxy.html">QNetworkProxy</a> objects that indicate the proxy servers to be used, in order of preference.</p>
<p>When reimplementing this class, take care to return at least one element.</p>
<p>If you cannot determine a better proxy alternative, use <a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::DefaultProxy</a>, which tells the code querying for a proxy to use a higher alternative. For example, if this factory is set to a <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> object, DefaultProxy will tell it to query the application-level proxy settings.</p>
<p>If this factory is set as the application proxy factory, DefaultProxy and NoProxy will have the same meaning.</p>
<!-- @@@queryProxy -->
<!-- $$$setApplicationProxyFactory[overload1]$$$setApplicationProxyFactoryQNetworkProxyFactory* -->
<h3 class="fn"><a name="setApplicationProxyFactory"></a><span class="type">void</span> QNetworkProxyFactory::<span class="name">setApplicationProxyFactory</span> ( <span class="type">QNetworkProxyFactory</span> * <i>factory</i> )<tt> [static]</tt></h3>
<p>Sets the application-wide proxy factory to be <i>factory</i>. This function will take ownership of that object and will delete it when necessary.</p>
<p>The application-wide proxy is used as a last-resort when all other proxy selection requests returned <a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::DefaultProxy</a>. For example, <a href="qtcpsocket.html">QTcpSocket</a> objects can have a proxy set with QTcpSocket::setProxy, but if none is set, the proxy factory class set with this function will be queried.</p>
<p>If you set a proxy factory with this function, any application level proxies set with QNetworkProxy::setApplicationProxy will be overridden.</p>
<p><b>See also </b><a href="qnetworkproxy.html#setApplicationProxy">QNetworkProxy::setApplicationProxy</a>(), <a href="qabstractsocket.html#proxy">QAbstractSocket::proxy</a>(), and <a href="qabstractsocket.html#setProxy">QAbstractSocket::setProxy</a>().</p>
<!-- @@@setApplicationProxyFactory -->
<!-- $$$setUseSystemConfiguration[overload1]$$$setUseSystemConfigurationbool -->
<h3 class="fn"><a name="setUseSystemConfiguration"></a><span class="type">void</span> QNetworkProxyFactory::<span class="name">setUseSystemConfiguration</span> ( <span class="type">bool</span> <i>enable</i> )<tt> [static]</tt></h3>
<p>Enables the use of the platform-specific proxy settings, and only those. See <a href="qnetworkproxyfactory.html#systemProxyForQuery">systemProxyForQuery</a>() for more information.</p>
<p>Internally, this method (when called with <i>enable</i> set to true) sets an application-wide proxy factory. For this reason, this method is mutually exclusive with <a href="qnetworkproxyfactory.html#setApplicationProxyFactory">setApplicationProxyFactory</a>(): calling <a href="qnetworkproxyfactory.html#setApplicationProxyFactory">setApplicationProxyFactory</a>() overrides the use of the system-wide proxy, and calling setUseSystemConfiguration() overrides any application proxy or proxy factory that was previously set.</p>
<p><b>Note:</b> See the <a href="qnetworkproxyfactory.html#systemProxyForQuery">systemProxyForQuery</a>() documentation for a list of limitations related to the use of system proxies.</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@setUseSystemConfiguration -->
<!-- $$$systemProxyForQuery[overload1]$$$systemProxyForQueryconstQNetworkProxyQuery& -->
<h3 class="fn"><a name="systemProxyForQuery"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qnetworkproxy.html">QNetworkProxy</a></span>&gt; QNetworkProxyFactory::<span class="name">systemProxyForQuery</span> ( const <span class="type"><a href="qnetworkproxyquery.html">QNetworkProxyQuery</a></span> &amp; <i>query</i> = QNetworkProxyQuery() )<tt> [static]</tt></h3>
<p>This function takes the query request, <i>query</i>, examines the details of the type of socket or request and returns a list of <a href="qnetworkproxy.html">QNetworkProxy</a> objects that indicate the proxy servers to be used, in order of preference.</p>
<p>This function can be used to determine the platform-specific proxy settings. This function will use the libraries provided by the operating system to determine the proxy for a given connection, if such libraries exist. If they don't, this function will just return a <a href="qnetworkproxy.html">QNetworkProxy</a> of type <a href="qnetworkproxy.html#ProxyType-enum">QNetworkProxy::NoProxy</a>.</p>
<p>On Windows, this function will use the WinHTTP DLL functions. Despite its name, Microsoft suggests using it for all applications that require network connections, not just HTTP. This will respect the proxy settings set on the registry with the proxycfg.exe tool. If those settings are not found, this function will attempt to obtain Internet Explorer's settings and use them.</p>
<p>On MacOS X, this function will obtain the proxy settings using the SystemConfiguration framework from Apple. It will apply the FTP, HTTP and HTTPS proxy configurations for queries that contain the protocol tag &quot;ftp&quot;, &quot;http&quot; and &quot;https&quot;, respectively. If the SOCKS proxy is enabled in that configuration, this function will use the SOCKS server for all queries. If SOCKS isn't enabled, it will use the HTTPS proxy for all TcpSocket and UrlRequest queries.</p>
<p>On BlackBerry, this function obtains proxy settings for the default configuration using system configuration. The type will be set based on protocol tag &quot;http&quot;, &quot;https&quot;, &quot;ftp&quot;, respectively. By default, it assumes http type. Proxy username and password are also set during the query using system configuration.</p>
<p>On other systems, this function will pick up proxy settings from the &quot;http_proxy&quot; environment variable. This variable must be a URL using one of the following schemes: &quot;http&quot;, &quot;socks5&quot; or &quot;socks5h&quot;.</p>
<a name="limitations"></a>
<h4>Limitations</h4>
<p>These are the limitations for the current version of this function. Future versions of Qt may lift some of the limitations listed here.</p>
<ul>
<li>On MacOS X, this function will ignore the Proxy Auto Configuration settings, since it cannot execute the associated ECMAScript code.</li>
<li>On Windows platforms, this function may take several seconds to execute depending on the configuration of the user's system.<p><b class="redFont"><code>\li</code></b>On BlackBerry, only UrlRequest and TcpSocket queries are supported. SOCKS is not supported. The proxy credentials are only retrieved for the default configuration.</p>
</li>
</ul>
<!-- @@@systemProxyForQuery -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>