QAbstractUriResolver¶
The
QAbstractUriResolverclass is a callback interface for resolving Uniform Resource Identifiers. 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.resolve()provides this functionality. More…

Detailed Description¶
For example, one could write a
QAbstractUriResolversubclass that rewrites library ISBN number URIs as book title URLs, e.g., urn:isbn:0-345-33973-8 would be rewritten as file:///books/returnOfTheKing.doc . Or aQAbstractUriResolversubclass 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.
- class PySide2.QtXmlPatterns.QAbstractUriResolver([parent=None])¶
- param parent:
Constructs a
QAbstractUriResolverwith the specifiedparent.
- PySide2.QtXmlPatterns.QAbstractUriResolver.resolve(relative, baseURI)¶
- Parameters:
relative –
PySide2.QtCore.QUrlbaseURI –
PySide2.QtCore.QUrl
- Return type:
Returns the
relativeURI resolved using thebaseURI.The caller guarantees that both
relativeandbaseURIare valid, and thatbaseURIis absolute.relativecan be relative, absolute, or empty.The returned
QUrlcan be a default constructedQUrl. If it is not a default constructedQUrl, it will be absolute and valid. If a default constructedQUrlis returned, it means therelativeURI was not accepted to be resolved.If the reimplemented function decides it has nothing to do about resolving the
relativeURI, it should simply return therelativeURI resolved against thebaseURI, i.e.:return baseURI.resolved(relative);
See also
isRelative()isValid()
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. 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.