Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates > by-pkgid > 6e2327ca1c896c6d674ae53117299f21 > files > 147

qtdeclarative5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qqmlabstracturlinterceptor.cpp -->
  <title>QQmlAbstractUrlInterceptor Class | Qt QML 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtqml-index.html">Qt QML</a></td><td ><a href="qtqml-module.html">C++ Classes</a></td><td >QQmlAbstractUrlInterceptor</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtqml-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QQmlAbstractUrlInterceptor Class</h1>
<!-- $$$QQmlAbstractUrlInterceptor-brief -->
<p>allows you to control QML file loading. <a href="#details">More...</a></p>
<!-- @@@QQmlAbstractUrlInterceptor -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QQmlAbstractUrlInterceptor&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += qml</td></tr></table></div><ul>
<li><a href="qqmlabstracturlinterceptor-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qqmlabstracturlinterceptor.html#DataType-enum">DataType</a></b> { QmldirFile, JavaScriptFile, QmlFile, UrlString }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qqmlabstracturlinterceptor.html#QQmlAbstractUrlInterceptor">QQmlAbstractUrlInterceptor</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qqmlabstracturlinterceptor.html#dtor.QQmlAbstractUrlInterceptor">~QQmlAbstractUrlInterceptor</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUrl </td><td class="memItemRight bottomAlign"><b><a href="qqmlabstracturlinterceptor.html#intercept">intercept</a></b>(const QUrl &amp;<i>url</i>, QQmlAbstractUrlInterceptor::DataType <i>type</i>) = 0</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QQmlAbstractUrlInterceptor-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>allows you to control QML file loading.</p>
<p><a href="qqmlabstracturlinterceptor.html">QQmlAbstractUrlInterceptor</a> is an interface which can be used to alter URLs before they are used by the QML engine. This is primarily useful for altering file urls into other file urls, such as selecting different graphical assets for the current platform.</p>
<p>Relative URLs are intercepted after being resolved against the file path of the current QML context. URL interception also occurs after setting the base path for a loaded QML file. This means that the content loaded for that QML file uses the intercepted URL, but inside the file the pre-intercepted URL is used for resolving relative paths. This allows for interception of .qml file loading without needing all paths (or local types) inside intercepted content to insert a different relative path.</p>
<p>Compared to setNetworkAccessManagerFactory, <a href="qqmlabstracturlinterceptor.html">QQmlAbstractUrlInterceptor</a> affects all URLs and paths, including local files and embedded resource files. <a href="qqmlabstracturlinterceptor.html">QQmlAbstractUrlInterceptor</a> is synchronous, and for asynchronous files must return a url with an asynchronous scheme (such as http or a custom scheme handled by your own custom QNetworkAccessManager). You can use a <a href="qqmlabstracturlinterceptor.html">QQmlAbstractUrlInterceptor</a> to change file URLs into networked URLs which are handled by your own custom QNetworkAccessManager.</p>
<p>To implement support for a custom networked scheme, see setNetworkAccessManagerFactory.</p>
</div>
<!-- @@@QQmlAbstractUrlInterceptor -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DataType$$$QmlFile$$$JavaScriptFile$$$QmldirFile$$$UrlString -->
<h3 class="fn" id="DataType-enum"><a name="DataType-enum"></a>enum QQmlAbstractUrlInterceptor::<span class="name">DataType</span></h3>
<p>Specifies where URL interception is taking place.</p>
<p>Because QML loads qmldir files for locating types, there are two URLs involved in loading a QML type. The URL of the (possibly implicit) qmldir used for locating the type and the URL of the file which defines the type. Intercepting both leads to either complex URL replacement or double URL replacements for the same file.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QQmlAbstractUrlInterceptor::QmldirFile</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The URL being intercepted is for a Qmldir file. Intercepting this, but not the QmlFile, allows for swapping out entire sub trees.</td></tr>
<tr><td class="topAlign"><code>QQmlAbstractUrlInterceptor::JavaScriptFile</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The URL being intercepted is an import for a Javascript file.</td></tr>
<tr><td class="topAlign"><code>QQmlAbstractUrlInterceptor::QmlFile</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The URL being intercepted is for a Qml file. Intercepting this, but not the Qmldir file, leaves the base dir of a QML file untouched and acts like replacing the file with another file.</td></tr>
<tr><td class="topAlign"><code>QQmlAbstractUrlInterceptor::UrlString</code></td><td class="topAlign tblval"><code>0x1000</code></td><td class="topAlign">The URL being intercepted is a url property in a QML file, and not being used to load a file through the engine.</td></tr>
</table></div>
<!-- @@@DataType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QQmlAbstractUrlInterceptor[overload1]$$$QQmlAbstractUrlInterceptor -->
<h3 class="fn" id="QQmlAbstractUrlInterceptor"><a name="QQmlAbstractUrlInterceptor"></a>QQmlAbstractUrlInterceptor::<span class="name">QQmlAbstractUrlInterceptor</span>()</h3>
<p>Constructor for <a href="qqmlabstracturlinterceptor.html">QQmlAbstractUrlInterceptor</a>.</p>
<!-- @@@QQmlAbstractUrlInterceptor -->
<!-- $$$~QQmlAbstractUrlInterceptor[overload1]$$$~QQmlAbstractUrlInterceptor -->
<h3 class="fn" id="dtor.QQmlAbstractUrlInterceptor"><a name="dtor.QQmlAbstractUrlInterceptor"></a><code>[virtual] </code>QQmlAbstractUrlInterceptor::<span class="name">~QQmlAbstractUrlInterceptor</span>()</h3>
<p>Destructor for <a href="qqmlabstracturlinterceptor.html">QQmlAbstractUrlInterceptor</a>.</p>
<!-- @@@~QQmlAbstractUrlInterceptor -->
<!-- $$$intercept[overload1]$$$interceptconstQUrl&QQmlAbstractUrlInterceptor::DataType -->
<h3 class="fn" id="intercept"><a name="intercept"></a><code>[pure virtual] </code><span class="type">QUrl</span> QQmlAbstractUrlInterceptor::<span class="name">intercept</span>(const <span class="type">QUrl</span> &amp;<i>url</i>, <span class="type"><a href="qqmlabstracturlinterceptor.html#DataType-enum">QQmlAbstractUrlInterceptor::DataType</a></span> <i>type</i>)</h3>
<p>A pure virtual function where you can intercept the <i>url</i>. The returned value is taken as the new value for the url. The type of url being intercepted is given by the <i>type</i> variable.</p>
<p>Your implementation of this function must be thread-safe, as it can be called from multiple threads at the same time.</p>
<!-- @@@intercept -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    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.<br/>    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. </p>
</div>
</body>
</html>