<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QAbstractUriResolver Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QAbstractUriResolver Class Reference<br /><sup><sup>[<a href="qtxmlpatterns.html">QtXmlPatterns</a> module]</sup></sup></h1><p>The QAbstractUriResolver class is a callback interface for resolving Uniform Resource Identifiers. <a href="#details">More...</a></p> <p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qabstracturiresolver.html#QAbstractUriResolver">__init__</a></b> (<i>self</i>, QObject <i>parent</i> = None)</li><li><div class="fn" />QUrl <b><a href="qabstracturiresolver.html#resolve">resolve</a></b> (<i>self</i>, QUrl <i>relative</i>, QUrl <i>baseURI</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAbstractUriResolver class is a callback interface for resolving Uniform Resource Identifiers.</p> <p>A Uniform Resource Identifier (URI) is a string that uniquely identifies a resource. URIs are versatile global identifiers. It is often useful to transform a URI that identifies something logical into a URI that locates something physical (a URL), or to simply map a URI to a different URI. <a href="qabstracturiresolver.html#resolve">QAbstractUriResolver.resolve</a>() provides this functionality.</p> <p>For example, one could write a QAbstractUriResolver subclass that rewrites library ISBN number URIs as book title URLs, e.g., <i>urn:isbn:0-345-33973-8</i> would be rewritten as <i>file:///books/returnOfTheKing.doc</i>. Or a QAbstractUriResolver subclass could be written for a web browser to let the web browser protect the user's private files by mapping incoming requests for them to null URIs.</p> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAbstractUriResolver" />QAbstractUriResolver.__init__ (<i>self</i>, <a href="qobject.html">QObject</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qabstracturiresolver.html">QAbstractUriResolver</a> with the specified <i>parent</i>.</p> <h3 class="fn"><a name="resolve" /><a href="qurl.html">QUrl</a> QAbstractUriResolver.resolve (<i>self</i>, <a href="qurl.html">QUrl</a> <i>relative</i>, <a href="qurl.html">QUrl</a> <i>baseURI</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the <i>relative</i> URI resolved using the <i>baseURI</i>.</p> <p>The caller guarantees that both <i>relative</i> and <i>baseURI</i> are valid, and that <i>baseURI</i> is absolute. <i>relative</i> can be relative, absolute, or empty.</p> <p>The returned <a href="qurl.html">QUrl</a> can be a default constructed <a href="qurl.html">QUrl</a>. If it is not a default constructed <a href="qurl.html">QUrl</a>, it will be absolute and valid. If a default constructed <a href="qurl.html">QUrl</a> is returned, it means the <i>relative</i> URI was not accepted to be resolved.</p> <p>If the reimplemented resolve() function decides it has nothing to do about resolving the <i>relative</i> URI, it should simply return the <i>relative</i> URI resolved against the <i>baseURI</i>, i.e.:</p> <pre class="cpp"> <span class="keyword">return</span> baseURI<span class="operator">.</span>resolved(relative); </pre> <p><b>See also</b> <a href="qurl.html#isRelative">QUrl.isRelative</a>() and <a href="qurl.html#isValid">QUrl.isValid</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>