PythonQt.QtCore.QUrl · declarations 002
fromStringList
fromStringList(uris: Any, mode: Any) -> tuple
X.fromStringList(uris, mode) -> tuple
Supplemental documentation: Qt 5 reference:
[static] QList\<QUrl> QUrl::fromStringList(const QStringList \&urls, QUrl::ParsingMode mode \= TolerantMode)
Converts a list of strings representing urls into a list of urls, using QUrl(str, mode). Note that this means all strings must be urls, not for instance local paths.
This function was introduced in Qt 5.1.
Upstream PySide2 reference signatures (binding differences may apply):
fromStringList(uris: typing.Sequence[str], mode: PySide2.QtCore.QUrl.ParsingMode=...) -> typing.List[PySide2.QtCore.QUrl]
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#fromStringList
fromUserInput
fromUserInput(userInput: str) -> Any
X.fromUserInput(userInput) -> PythonQt.QtCore.QUrl
Supplemental documentation: Qt 5 reference:
[static] QUrl QUrl::fromUserInput(const QString \&userInput)
Returns a valid URL from a user supplied userInput string if one can be deducted. In the case that is not possible, an invalid QUrl() is returned.
Most applications that can browse the web, allow the user to input a URL in the form of a plain string. This string can be manually typed into a location bar, obtained from the clipboard, or passed in via command line arguments.
When the string is not already a valid URL, a best guess is performed, making various web related assumptions.
In the case the string corresponds to a valid file path on the system, a file:// URL is constructed, using QUrl::fromLocalFile().
If that is not the case, an attempt is made to turn the string into a http:// or ftp:// URL. The latter in the case the string starts with 'ftp'. The result is then passed through QUrl's tolerant parser, and in the case or success, a valid QUrl is returned, or else a QUrl().
Examples:
- qt-project.org becomes http://qt-project.org
- ftp.qt-project.org becomes ftp://ftp.qt-project.org
- hostname becomes http://hostname
- /home/user/test.html becomes file:///home/user/test.html
This function was introduced in Qt 4.6.
[static] QUrl QUrl::fromUserInput(const QString \&userInput, const QString \&workingDirectory, QUrl::UserInputResolutionOptions options \= DefaultResolution)
Returns a valid URL from a user supplied userInput string if one can be deduced. In the case that is not possible, an invalid QUrl() is returned.
This overload takes a workingDirectory path, in order to be able to handle relative paths. This is especially useful when handling command line arguments. If workingDirectory is empty, no handling of relative paths will be done, so this method will behave like its one argument overload.
By default, an input string that looks like a relative path will only be treated as such if the file actually exists in the given working directory.
If the application can handle files that don't exist yet, it should pass the flag AssumeLocalFile in options.
This function was introduced in Qt 5.4.
Upstream PySide2 reference signatures (binding differences may apply):
fromUserInput(userInput: str) -> PySide2.QtCore.QUrl
fromUserInput(userInput: str, workingDirectory: str, options: PySide2.QtCore.QUrl.UserInputResolutionOptions=...) -> PySide2.QtCore.QUrl
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#fromUserInput
hasFragment
hasFragment() -> bool
X.hasFragment() -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::hasFragment() const
Returns true if this URL contains a fragment (i.e., if # was seen on it).
This function was introduced in Qt 4.2.
See also fragment() and setFragment().
Upstream PySide2 reference signatures (binding differences may apply):
hasFragment(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#hasFragment
hasQuery
hasQuery() -> bool
X.hasQuery() -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::hasQuery() const
Returns true if this URL contains a Query (i.e., if ? was seen on it).
This function was introduced in Qt 4.2.
See also setQuery(), query(), and hasFragment().
Upstream PySide2 reference signatures (binding differences may apply):
hasQuery(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#hasQuery
host
host(arg__1: Any) -> str
X.host(arg__1) -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::host(QUrl::ComponentFormattingOptions options \= FullyDecoded) const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
The options argument controls how the hostname will be formatted. The QUrl::EncodeUnicode option will cause this function to return the hostname in the ASCII-Compatible Encoding (ACE) form, which is suitable for use in channels that are not 8-bit clean or that require the legacy hostname (such as DNS requests or in HTTP request headers). If that flag is not present, this function returns the International Domain Name (IDN) in Unicode form, according to the list of permissible top-level domains (see idnWhitelist()).
All other flags are ignored. Host names cannot contain control or percent characters, so the returned value can be considered fully decoded.
See also setHost(), idnWhitelist(), setIdnWhitelist(), and authority().
Upstream PySide2 reference signatures (binding differences may apply):
host(self, arg__1: PySide2.QtCore.QUrl.ComponentFormattingOption=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#host
idnWhitelist
idnWhitelist() -> tuple
X.idnWhitelist() -> tuple
Supplemental documentation: Qt 5 reference:
[static] QStringList QUrl::idnWhitelist()
Returns the current whitelist of top-level domains that are allowed to have non-ASCII characters in their compositions.
See setIdnWhitelist() for the rationale of this list.
This function was introduced in Qt 4.2.
See also setIdnWhitelist().
Upstream PySide2 reference signatures (binding differences may apply):
idnWhitelist() -> typing.List[str]
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#idnWhitelist
isEmpty
isEmpty() -> bool
X.isEmpty() -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::isEmpty() const
Returns true if the URL has no data; otherwise returns false.
See also clear().
Upstream PySide2 reference signatures (binding differences may apply):
isEmpty(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#isEmpty
isLocalFile
isLocalFile() -> bool
X.isLocalFile() -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::isLocalFile() const
Returns true if this URL is pointing to a local file path. A URL is a local file path
if the scheme is "file".
Note that this function considers URLs with hostnames to be local file paths, even if the eventual file path cannot be opened with QFile::open().
This function was introduced in Qt 4.8.
See also fromLocalFile() and toLocalFile().
Upstream PySide2 reference signatures (binding differences may apply):
isLocalFile(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#isLocalFile
isParentOf
isParentOf(url: Any) -> bool
X.isParentOf(url) -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::isParentOf(const QUrl \&childUrl) const
Returns true if this URL is a parent of childUrl. childUrl is a child of this URL
if the two URLs share the same scheme and authority, and this URL's path is a parent of
the path of childUrl.
Upstream PySide2 reference signatures (binding differences may apply):
isParentOf(self, url: PySide2.QtCore.QUrl) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#isParentOf
isRelative
isRelative() -> bool
X.isRelative() -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::isRelative() const
Returns true if the URL is relative; otherwise returns false. A URL is relative
reference if its scheme is undefined; this function is therefore equivalent to calling
scheme().isEmpty().
Relative references are defined in RFC 3986 section 4.2.
See also Relative URLs vs Relative Paths.
Upstream PySide2 reference signatures (binding differences may apply):
isRelative(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#isRelative
isValid
isValid() -> bool
X.isValid() -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
The URL is run through a conformance test. Every part of the URL must conform to the standard encoding rules of the URI standard for the URL to be reported as valid.
bool checkUrl(const QUrl &url) {
if (!url.isValid()) {
qDebug("Invalid URL: %s", qUtf8Printable(url.toString()));
return false;
}
return true;
}
Upstream PySide2 reference signatures (binding differences may apply):
isValid(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#isValid
matches
matches(url: Any, options: Any) -> bool
X.matches(url, options) -> bool
Supplemental documentation: Qt 5 reference:
bool QUrl::matches(const QUrl \&url, QUrl::FormattingOptions options) const
Returns true if this URL and the given url are equal after applying options to
both; otherwise returns false.
This is equivalent to calling adjusted(options) on both URLs and comparing the resulting urls, but faster.
This function was introduced in Qt 5.2.
Upstream PySide2 reference signatures (binding differences may apply):
matches(self, url: PySide2.QtCore.QUrl, options: PySide2.QtCore.QUrl.FormattingOptions) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#matches
password
password(arg__1: Any) -> str
X.password(arg__1) -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::password(QUrl::ComponentFormattingOptions options \= FullyDecoded) const
Returns the password of the URL if it is defined; otherwise an empty string is returned.
The options argument controls how to format the user name component. All values produce an unambiguous result. With QUrl::FullyDecoded, all percent-encoded sequences are decoded; otherwise, the returned value may contain some percent-encoded sequences for some control sequences not representable in decoded form in QString.
Note that QUrl::FullyDecoded may cause data loss if those non-representable sequences are present. It is recommended to use that value when the result will be used in a non-URL context, such as setting in QAuthenticator or negotiating a login.
See also setPassword().
Upstream PySide2 reference signatures (binding differences may apply):
password(self, arg__1: PySide2.QtCore.QUrl.ComponentFormattingOption=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#password
path
path(options: Any) -> str
X.path(options) -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::path(QUrl::ComponentFormattingOptions options \= FullyDecoded) const
Returns the path of the URL.
qDebug() << QUrl("file:file.txt").path(); // "file.txt"
qDebug() << QUrl("/home/user/file.txt").path(); // "/home/user/file.txt"
qDebug() << QUrl("http://www.example.com/test/123").path(); // "/test/123"
The options argument controls how to format the path component. All values produce an unambiguous result. With QUrl::FullyDecoded, all percent-encoded sequences are decoded; otherwise, the returned value may contain some percent-encoded sequences for some control sequences not representable in decoded form in QString.
Note that QUrl::FullyDecoded may cause data loss if those non-representable sequences are present. It is recommended to use that value when the result will be used in a non-URL context, such as sending to an FTP server.
An example of data loss is when you have non-Unicode percent-encoded sequences and use FullyDecoded (the default):
qDebug() << QUrl("/foo%FFbar").path();
In this example, there will be some level of data loss because the %FF cannot be
converted.
Data loss can also occur when the path contains sub-delimiters (such as +):
qDebug() << QUrl("/foo+bar%2B").path(); // "/foo+bar+"
Other decoding examples:
const QUrl url("/temporary/Mambo %235%3F.mp3");
qDebug() << url.path(QUrl::FullyDecoded); // "/temporary/Mambo #5?.mp3"
qDebug() << url.path(QUrl::PrettyDecoded); // "/temporary/Mambo #5?.mp3"
qDebug() << url.path(QUrl::FullyEncoded); // "/temporary/Mambo%20%235%3F.mp3"
See also setPath().
Upstream PySide2 reference signatures (binding differences may apply):
path(self, options: PySide2.QtCore.QUrl.ComponentFormattingOption=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#path
port
port(defaultPort: int) -> int
X.port(defaultPort) -> int
Supplemental documentation: Qt 5 reference:
int QUrl::port(int defaultPort \= -1) const
Returns the port of the URL, or defaultPort if the port is unspecified.
Example:
QTcpSocket sock;
sock.connectToHost(url.host(), url.port(80));
This function was introduced in Qt 4.1.
See also setPort().
Upstream PySide2 reference signatures (binding differences may apply):
port(self, defaultPort: int=...) -> int
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#port
query
query(arg__1: Any) -> str
X.query(arg__1) -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::query(QUrl::ComponentFormattingOptions options \= PrettyDecoded) const
Returns the query string of the URL if there's a query string, or an empty result if not. To determine if the parsed URL contained a query string, use hasQuery().
The options argument controls how to format the query component. All values produce an unambiguous result. With QUrl::FullyDecoded, all percent-encoded sequences are decoded; otherwise, the returned value may contain some percent-encoded sequences for some control sequences not representable in decoded form in QString.
Note that use of QUrl::FullyDecoded in queries is discouraged, as queries often contain data that is supposed to remain percent-encoded, including the use of the "%2B" sequence to represent a plus character ('+').
See also setQuery() and hasQuery().
Upstream PySide2 reference signatures (binding differences may apply):
query(self, arg__1: PySide2.QtCore.QUrl.ComponentFormattingOption=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#query
resolved
resolved(relative: Any) -> Any
X.resolved(relative) -> PythonQt.QtCore.QUrl
Supplemental documentation: Qt 5 reference:
QUrl QUrl::resolved(const QUrl \&relative) const
Returns the result of the merge of this URL with relative. This URL is used as a base to convert relative to an absolute URL.
If relative is not a relative URL, this function will return relative directly. Otherwise, the paths of the two URLs are merged, and the new URL returned has the scheme and authority of the base URL, but with the merged path, as in the following example:
QUrl baseUrl("http://qt.digia.com/Support/");
QUrl relativeUrl("../Product/Library/");
qDebug(baseUrl.resolved(relativeUrl).toString());
// prints "http://qt.digia.com/Product/Library/"
Calling resolved() with ".." returns a QUrl whose directory is one level higher than the original. Similarly, calling resolved() with "../.." removes two levels from the path. If relative is "/", the path becomes "/".
See also isRelative().
Upstream PySide2 reference signatures (binding differences may apply):
resolved(self, relative: PySide2.QtCore.QUrl) -> PySide2.QtCore.QUrl
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#resolved
scheme
scheme() -> str
X.scheme() -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::scheme() const
Returns the scheme of the URL. If an empty string is returned, this means the scheme is undefined and the URL is then relative.
The scheme can only contain US-ASCII letters or digits, which means it cannot contain any character that would otherwise require encoding. Additionally, schemes are always returned in lowercase form.
See also setScheme() and isRelative().
Upstream PySide2 reference signatures (binding differences may apply):
scheme(self) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#scheme
setAuthority
setAuthority(authority: str, mode: Any) -> None
X.setAuthority(authority, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setAuthority(const QString \&authority, QUrl::ParsingMode mode \= TolerantMode)
Sets the authority of the URL to authority.
The authority of a URL is the combination of user info, a host name and a port. All of these elements are optional; an empty authority is therefore valid.
The user info and host are separated by a '@', and the host and port are separated by a ':'. If the user info is empty, the '@' must be omitted; although a stray ':' is permitted if the port is empty.
The following example shows a valid authority string:

The authority data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode (the default), all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters.
This function does not allow mode to be QUrl::DecodedMode. To set fully decoded data, call setUserName(), setPassword(), setHost() and setPort() individually.
See also authority(), setUserInfo(), setHost(), and setPort().
Upstream PySide2 reference signatures (binding differences may apply):
setAuthority(self, authority: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setAuthority
setFragment
setFragment(fragment: str, mode: Any) -> None
X.setFragment(fragment, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setFragment(const QString \&fragment, QUrl::ParsingMode mode \= TolerantMode)
Sets the fragment of the URL to fragment. The fragment is the last part of the URL, represented by a '#' followed by a string of characters. It is typically used in HTTP for referring to a certain link or point on a page:

The fragment is sometimes also referred to as the URL "reference".
Passing an argument of QString() (a null QString) will unset the fragment. Passing an argument of QString("") (an empty but not null QString) will set the fragment to an empty string (as if the original URL had a lone "#").
The fragment data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode, all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters. In DecodedMode, '%' stand for themselves and encoded characters are not possible.
QUrl::DecodedMode should be used when setting the fragment from a data source which is not a URL or with a fragment obtained by calling fragment() with the QUrl::FullyDecoded formatting option.
See also fragment() and hasFragment().
Upstream PySide2 reference signatures (binding differences may apply):
setFragment(self, fragment: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setFragment
setHost
setHost(host: str, mode: Any) -> None
X.setHost(host, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setHost(const QString \&host, QUrl::ParsingMode mode \= DecodedMode)
Sets the host of the URL to host. The host is part of the authority.
The host data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode, all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters. In DecodedMode, '%' stand for themselves and encoded characters are not possible.
Note that, in all cases, the result of the parsing must be a valid hostname according to STD 3 rules, as modified by the Internationalized Resource Identifiers specification (RFC 3987). Invalid hostnames are not permitted and will cause isValid() to become false.
See also host() and setAuthority().
Upstream PySide2 reference signatures (binding differences may apply):
setHost(self, host: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setHost
setIdnWhitelist
setIdnWhitelist(arg__1: Any) -> None
X.setIdnWhitelist(arg__1)
Supplemental documentation: Qt 5 reference:
[static] void QUrl::setIdnWhitelist(const QStringList \&list)
Sets the whitelist of Top-Level Domains (TLDs) that are allowed to have non-ASCII characters in domains to the value of list.
Note that if you call this function, you need to do so before you start any threads that might access idnWhitelist().
Qt comes with a default list that contains the Internet top-level domains that have
published support for Internationalized Domain Names (IDNs) and rules to guarantee that
no deception can happen between similarly-looking characters (such as the Latin
lowercase letter 'a' and the Cyrillic equivalent, which in most fonts are visually
identical).
This list is periodically maintained, as registrars publish new rules.
This function is provided for those who need to manipulate the list, in order to add or remove a TLD. It is not recommended to change its value for purposes other than testing, as it may expose users to security risks.
This function was introduced in Qt 4.2.
See also idnWhitelist().
Upstream PySide2 reference signatures (binding differences may apply):
setIdnWhitelist(arg__1: typing.Sequence[str]) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setIdnWhitelist
setPassword
setPassword(password: str, mode: Any) -> None
X.setPassword(password, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setPassword(const QString \&password, QUrl::ParsingMode mode \= DecodedMode)
Sets the URL's password to password. The password is part of the user info element in the authority of the URL, as described in setUserInfo().
The password data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode, all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters. In DecodedMode, '%' stand for themselves and encoded characters are not possible.
QUrl::DecodedMode should be used when setting the password from a data source which is not a URL, such as a password dialog shown to the user or with a password obtained by calling password() with the QUrl::FullyDecoded formatting option.
See also password() and setUserInfo().
Upstream PySide2 reference signatures (binding differences may apply):
setPassword(self, password: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setPassword
setPath
setPath(path: str, mode: Any) -> None
X.setPath(path, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setPath(const QString \&path, QUrl::ParsingMode mode \= DecodedMode)
Sets the path of the URL to path. The path is the part of the URL that comes after the authority but before the query string.

For non-hierarchical schemes, the path will be everything following the scheme declaration, as in the following example:

The path data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode, all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters. In DecodedMode, '%' stand for themselves and encoded characters are not possible.
QUrl::DecodedMode should be used when setting the path from a data source which is not a URL, such as a dialog shown to the user or with a path obtained by calling path() with the QUrl::FullyDecoded formatting option.
See also path().
Upstream PySide2 reference signatures (binding differences may apply):
setPath(self, path: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setPath
setPort
setPort(port: int) -> None
X.setPort(port)
Supplemental documentation: Qt 5 reference:
void QUrl::setPort(int port)
Sets the port of the URL to port. The port is part of the authority of the URL, as described in setAuthority().
port must be between 0 and 65535 inclusive. Setting the port to -1 indicates that the port is unspecified.
See also port().
Upstream PySide2 reference signatures (binding differences may apply):
setPort(self, port: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setPort
setQuery
setQuery(query: Any, mode: Any) -> None
X.setQuery(query, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setQuery(const QString \&query, QUrl::ParsingMode mode \= TolerantMode)
Sets the query string of the URL to query.
This function is useful if you need to pass a query string that does not fit into the key-value pattern, or that uses a different scheme for encoding special characters than what is suggested by QUrl.
Passing a value of QString() to query (a null QString) unsets the query completely. However, passing a value of QString("") will set the query to an empty value, as if the original URL had a lone "?".
The query data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode, all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters. In DecodedMode, '%' stand for themselves and encoded characters are not possible.
Query strings often contain percent-encoded sequences, so use of DecodedMode is discouraged. One special sequence to be aware of is that of the plus character ('+'). QUrl does not convert spaces to plus characters, even though HTML forms posted by web browsers do. In order to represent an actual plus character in a query, the sequence "%2B" is usually used. This function will leave "%2B" sequences untouched in TolerantMode or StrictMode.
See also query() and hasQuery().
void QUrl::setQuery(const QUrlQuery \&query)
This is an overloaded function.
Sets the query string of the URL to query.
This function reconstructs the query string from the QUrlQuery object and sets on this QUrl object. This function does not have parsing parameters because the QUrlQuery contains data that is already parsed.
This function was introduced in Qt 5.0.
See also query() and hasQuery().
Upstream PySide2 reference signatures (binding differences may apply):
setQuery(self, query: PySide2.QtCore.QUrlQuery) -> None
setQuery(self, query: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setQuery
setScheme
setScheme(scheme: str) -> None
X.setScheme(scheme)
Supplemental documentation: Qt 5 reference:
void QUrl::setScheme(const QString \&scheme)
Sets the scheme of the URL to scheme. As a scheme can only contain ASCII characters, no conversion or decoding is done on the input. It must also start with an ASCII letter.
The scheme describes the type (or protocol) of the URL. It's represented by one or more ASCII characters at the start the URL.
A scheme is strictly RFC 3986-compliant: scheme
= ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
The following example shows a URL where the scheme is "ftp":

To set the scheme, the following call is used:
QUrl url;
url.setScheme("ftp");
The scheme can also be empty, in which case the URL is interpreted as relative.
See also scheme() and isRelative().
Upstream PySide2 reference signatures (binding differences may apply):
setScheme(self, scheme: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setScheme
setUrl
setUrl(url: str, mode: Any) -> None
X.setUrl(url, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setUrl(const QString \&url, QUrl::ParsingMode parsingMode \= TolerantMode)
Parses url and sets this object to that value. QUrl will automatically percent encode all characters that are not allowed in a URL and decode the percent-encoded sequences that represent an unreserved character (letters, digits, hyphens, undercores, dots and tildes). All other characters are left in their original forms.
Parses the url using the parser mode parsingMode. In TolerantMode (the default), QUrl will correct certain mistakes, notably the presence of a percent character ('%') not followed by two hexadecimal digits, and it will accept any character in any position. In StrictMode, encoding mistakes will not be tolerated and QUrl will also check that certain forbidden characters are not present in unencoded form. If an error is detected in StrictMode, isValid() will return false. The parsing mode DecodedMode is not permitted in this context and will produce a run-time warning.
See also url() and toString().
Upstream PySide2 reference signatures (binding differences may apply):
setUrl(self, url: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setUrl
setUserInfo
setUserInfo(userInfo: str, mode: Any) -> None
X.setUserInfo(userInfo, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setUserInfo(const QString \&userInfo, QUrl::ParsingMode mode \= TolerantMode)
Sets the user info of the URL to userInfo. The user info is an optional part of the authority of the URL, as described in setAuthority().
The user info consists of a user name and optionally a password, separated by a ':'. If the password is empty, the colon must be omitted. The following example shows a valid user info string:

The userInfo data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode (the default), all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters.
This function does not allow mode to be QUrl::DecodedMode. To set fully decoded data, call setUserName() and setPassword() individually.
See also userInfo(), setUserName(), setPassword(), and setAuthority().
Upstream PySide2 reference signatures (binding differences may apply):
setUserInfo(self, userInfo: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setUserInfo
setUserName
setUserName(userName: str, mode: Any) -> None
X.setUserName(userName, mode)
Supplemental documentation: Qt 5 reference:
void QUrl::setUserName(const QString \&userName, QUrl::ParsingMode mode \= DecodedMode)
Sets the URL's user name to userName. The userName is part of the user info element in the authority of the URL, as described in setUserInfo().
The userName data is interpreted according to mode: in StrictMode, any '%' characters must be followed by exactly two hexadecimal characters and some characters (including space) are not allowed in undecoded form. In TolerantMode (the default), all characters are accepted in undecoded form and the tolerant parser will correct stray '%' not followed by two hex characters. In DecodedMode, '%' stand for themselves and encoded characters are not possible.
QUrl::DecodedMode should be used when setting the user name from a data source which is not a URL, such as a password dialog shown to the user or with a user name obtained by calling userName() with the QUrl::FullyDecoded formatting option.
See also userName() and setUserInfo().
Upstream PySide2 reference signatures (binding differences may apply):
setUserName(self, userName: str, mode: PySide2.QtCore.QUrl.ParsingMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#setUserName
swap
swap(other: Any) -> None
X.swap(other)
Supplemental documentation: Qt 5 reference:
void QUrl::swap(QUrl \&other)
Swaps URL other with this URL. This operation is very fast and never fails.
This function was introduced in Qt 4.8.
Upstream PySide2 reference signatures (binding differences may apply):
swap(self, other: PySide2.QtCore.QUrl) -> None
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#swap
toAce
toAce(arg__1: str) -> Any
X.toAce(arg__1) -> PythonQt.QtCore.QByteArray
Supplemental documentation: Qt 5 reference:
[static] QByteArray QUrl::toAce(const QString \&domain)
Returns the ASCII Compatible Encoding of the given domain name domain. The result of this function is considered equivalent to domain.
The ASCII-Compatible Encoding (ACE) is defined by RFC 3490, RFC 3491 and RFC 3492. It
is part of the Internationalizing Domain Names in Applications (IDNA) specification,
which allows for domain names (like "example.com") to be written using international
characters.
This function returns an empty QByteArray if domain is not a valid hostname. Note, in particular, that IPv6 literals are not valid domain names.
This function was introduced in Qt 4.2.
Upstream PySide2 reference signatures (binding differences may apply):
toAce(arg__1: str) -> PySide2.QtCore.QByteArray
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#toAce
toDisplayString
toDisplayString(options: Any) -> str
X.toDisplayString(options) -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::toDisplayString(QUrl::FormattingOptions options \= FormattingOptions(PrettyDecoded)) const
Returns a human-displayable string representation of the URL. The output can be customized by passing flags with options. The option RemovePassword is always enabled, since passwords should never be shown back to users.
With the default options, the resulting QString can be passed back to a QUrl later on, but any password that was present initially will be lost.
This function was introduced in Qt 5.0.
See also FormattingOptions, toEncoded(), and toString().
Upstream PySide2 reference signatures (binding differences may apply):
toDisplayString(self, options: PySide2.QtCore.QUrl.FormattingOptions=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#toDisplayString
toEncoded
toEncoded(options: Any) -> Any
X.toEncoded(options) -> PythonQt.QtCore.QByteArray
Supplemental documentation: Qt 5 reference:
QByteArray QUrl::toEncoded(QUrl::FormattingOptions options \= FullyEncoded) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returned. The output can be customized by passing flags with options.
The user info, path and fragment are all converted to UTF-8, and all non-ASCII characters are then percent encoded. The host name is encoded using Punycode.
Upstream PySide2 reference signatures (binding differences may apply):
toEncoded(self, options: PySide2.QtCore.QUrl.FormattingOptions=...) -> PySide2.QtCore.QByteArray
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#toEncoded
toLocalFile
toLocalFile() -> str
X.toLocalFile() -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::toLocalFile() const
Returns the path of this URL formatted as a local file path. The path returned will use forward slashes, even if it was originally created from one with backslashes.
If this URL contains a non-empty hostname, it will be encoded in the returned value in the form found on SMB networks (for example, "//servername/path/to/file.txt").
qDebug() << QUrl("file:file.txt").toLocalFile(); // "file.txt"
qDebug() << QUrl("file:/home/user/file.txt").toLocalFile(); // "/home/user/file.txt"
qDebug() << QUrl("file.txt").toLocalFile(); // ""; wasn't a local file as it had no scheme
Note: if the path component of this URL contains a non-UTF-8 binary sequence (such as %80), the behaviour of this function is undefined.
See also fromLocalFile() and isLocalFile().
Upstream PySide2 reference signatures (binding differences may apply):
toLocalFile(self) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#toLocalFile
toPercentEncoding
toPercentEncoding(arg__1: str, exclude: Any, include: Any) -> Any
X.toPercentEncoding(arg__1, exclude, include) -> PythonQt.QtCore.QByteArray
Supplemental documentation: Qt 5 reference:
[static] QByteArray QUrl::toPercentEncoding(const QString \&input, const QByteArray \&exclude \= QByteArray(), const QByteArray \&include \= QByteArray())
Returns an encoded copy of input. input is first converted to UTF-8, and all ASCII-characters that are not in the unreserved group are percent encoded. To prevent characters from being percent encoded pass them to exclude. To force characters to be percent encoded pass them to include.
Unreserved is defined as: ALPHA / DIGIT / "-" / "." / "_" / "~"
QByteArray ba = QUrl::toPercentEncoding("{a fishy string?}", "{}", "s");
qDebug(ba.constData());
// prints "{a fi%73hy %73tring%3F}"
Upstream PySide2 reference signatures (binding differences may apply):
toPercentEncoding(arg__1: str, exclude: PySide2.QtCore.QByteArray=..., include: PySide2.QtCore.QByteArray=...) -> PySide2.QtCore.QByteArray
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#toPercentEncoding
toString
toString(options: Any) -> str
X.toString(options) -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::toString(QUrl::FormattingOptions options \= FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL. The output can be customized by passing flags with options. The option QUrl::FullyDecoded is not permitted in this function since it would generate ambiguous data.
The default formatting option is PrettyDecoded.
See also FormattingOptions, url(), and setUrl().
Upstream PySide2 reference signatures (binding differences may apply):
toString(self, options: PySide2.QtCore.QUrl.FormattingOptions=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#toString
toStringList
toStringList(uris: Any, options: Any) -> tuple
X.toStringList(uris, options) -> tuple
Supplemental documentation: Qt 5 reference:
[static] QStringList QUrl::toStringList(const QList\<QUrl> \&urls, QUrl::FormattingOptions options \= FormattingOptions(PrettyDecoded))
Converts a list of urls into a list of QString objects, using toString(options).
This function was introduced in Qt 5.1.
Upstream PySide2 reference signatures (binding differences may apply):
toStringList(uris: typing.Sequence[PySide2.QtCore.QUrl], options: PySide2.QtCore.QUrl.FormattingOptions=...) -> typing.List[str]
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#toStringList
topLevelDomain
topLevelDomain(options: Any) -> str
X.topLevelDomain(options) -> str
Upstream PySide2 reference signatures (binding differences may apply):
topLevelDomain(self, options: PySide2.QtCore.QUrl.ComponentFormattingOption=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#topLevelDomain
url
url(options: Any) -> str
X.url(options) -> str
Supplemental documentation: Qt 5 reference:
QString QUrl::url(QUrl::FormattingOptions options \= FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL. The output can be customized by passing flags with options. The option QUrl::FullyDecoded is not permitted in this function since it would generate ambiguous data.
The resulting QString can be passed back to a QUrl later on.
Synonym for toString(options).
See also setUrl(), FormattingOptions, toEncoded(), and toString().
Upstream PySide2 reference signatures (binding differences may apply):
url(self, options: PySide2.QtCore.QUrl.FormattingOptions=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qurl.html#url