⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qurl.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 2 页
字号:
what is handled as directory path.<p> <p>See also <a href="#setPath">setPath</a>() and <a href="#hasPath">hasPath</a>().<p>Example: <a href="networkprotocol-example.html#x624">network/networkprotocol/nntp.cpp</a>.<h3 class=fn>void <a name="encode"></a>QUrl::encode ( <a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url )<tt> [static]</tt></h3>Encodes the string <em>url</em> <em>in-place</em>.<p> <p>See also <a href="#decode">decode</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="encodedPathAndQuery"></a>QUrl::encodedPathAndQuery ()</h3>Returns the encoded path and query.<p> <p>See also <a href="#decode">decode</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="fileName"></a>QUrl::fileName () const</h3>Returns the file name of the URL. If the path of the URL doesn'thave a slash at the end, the part between the last slash and theend of the path string is considered to be the file name. If thepath has a slash at the end, an empty string is returned here.<p> <p>See also <a href="#setFileName">setFileName</a>().<p>Example: <a href="networkprotocol-example.html#x625">network/networkprotocol/nntp.cpp</a>.<h3 class=fn>bool <a name="hasHost"></a>QUrl::hasHost () const</h3>Returns TRUE if the URL contains a hostname; otherwise returnsFALSE.<p> <p>See also <a href="#setHost">setHost</a>().<h3 class=fn>bool <a name="hasPassword"></a>QUrl::hasPassword () const</h3>Returns TRUE if the URL contains a password; otherwise returnsFALSE.<p> <b>Warning:</b> Passwords passed in URLs are normally <em>insecure</em>; thisis due to the mechanism, not because of Qt.<p> <p>See also <a href="#setPassword">setPassword</a>() and <a href="#setUser">setUser</a>().<h3 class=fn>bool <a name="hasPath"></a>QUrl::hasPath () const</h3>Returns TRUE if the URL contains a path; otherwise returns FALSE.<p> <p>See also <a href="#path">path</a>() and <a href="#setPath">setPath</a>().<h3 class=fn>bool <a name="hasPort"></a>QUrl::hasPort () const</h3>Returns TRUE if the URL contains a port; otherwise returns FALSE.<p> <p>See also <a href="#setPort">setPort</a>().<h3 class=fn>bool <a name="hasRef"></a>QUrl::hasRef () const</h3>Returns TRUE if the URL has a reference; otherwise returns FALSE.<p> <p>See also <a href="#setRef">setRef</a>().<h3 class=fn>bool <a name="hasUser"></a>QUrl::hasUser () const</h3>Returns TRUE if the URL contains a username; otherwise returnsFALSE.<p> <p>See also <a href="#setUser">setUser</a>() and <a href="#setPassword">setPassword</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="host"></a>QUrl::host () const</h3>Returns the hostname of the URL.<p> <p>See also <a href="#setHost">setHost</a>() and <a href="#hasHost">hasHost</a>().<h3 class=fn>bool <a name="isLocalFile"></a>QUrl::isLocalFile () const</h3>Returns TRUE if the URL is a local file; otherwise returns FALSE.<p>Example: <a href="qdir-example.html#x1842">qdir/qdir.cpp</a>.<h3 class=fn>bool <a name="isRelativeUrl"></a>QUrl::isRelativeUrl ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url )<tt> [static]</tt></h3>Returns TRUE if <em>url</em> is relative; otherwise returns FALSE.<h3 class=fn>bool <a name="isValid"></a>QUrl::isValid () const</h3>Returns TRUE if the URL is valid; otherwise returns FALSE. A URLis invalid if it cannot be parsed, for example.<h3 class=fn><a name="operator-QString"></a>QUrl::operator QString () const</h3>Composes a string version of the URL and returns it.<p> <p>See also <a href="#toString">QUrl::toString</a>().<h3 class=fn><a href="qurl.html">QUrl</a>&nbsp;&amp; <a name="operator-eq"></a>QUrl::operator= ( const&nbsp;<a href="qurl.html">QUrl</a>&nbsp;&amp;&nbsp;url )</h3>Assigns the data of <em>url</em> to this class.<h3 class=fn><a href="qurl.html">QUrl</a>&nbsp;&amp; <a name="operator-eq-2"></a>QUrl::operator= ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Parses <em>url</em> and assigns the resulting data to this class.<p> If you pass a string like "/home/qt" the "file" protocol will beassumed.<h3 class=fn>bool <a name="operator-eq-eq"></a>QUrl::operator== ( const&nbsp;<a href="qurl.html">QUrl</a>&nbsp;&amp;&nbsp;url ) const</h3>Compares this URL with <em>url</em> and returns TRUE if they are equal;otherwise returns FALSE.<h3 class=fn>bool <a name="operator-eq-eq-2"></a>QUrl::operator== ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url ) const</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Compares this URL with <em>url</em>. <em>url</em> is parsed first. ReturnsTRUE if <em>url</em> is equal to this url; otherwise returns FALSE.<h3 class=fn>bool <a name="parse"></a>QUrl::parse ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url )<tt> [virtual protected]</tt></h3>Parses the <em>url</em>.<h3 class=fn><a href="qstring.html">QString</a> <a name="password"></a>QUrl::password () const</h3>Returns the password of the URL.<p> <b>Warning:</b> Passwords passed in URLs are normally <em>insecure</em>; thisis due to the mechanism, not because of Qt.<p> <p>See also <a href="#setPassword">setPassword</a>() and <a href="#setUser">setUser</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="path"></a>QUrl::path ( bool&nbsp;correct = TRUE ) const</h3>Returns the path of the URL. If <em>correct</em> is TRUE, the path iscleaned (deals with too many or too few slashes, cleans thingslike "/../..", etc). Otherwise <a href="#path">path</a>() returns exactly the paththat was parsed or set.<p> <p>See also <a href="#setPath">setPath</a>() and <a href="#hasPath">hasPath</a>().<p>Example: <a href="qdir-example.html#x1843">qdir/qdir.cpp</a>.<h3 class=fn>int <a name="port"></a>QUrl::port () const</h3>Returns the port of the URL or -1 if no port has been set.<p> <p>See also <a href="#setPort">setPort</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="protocol"></a>QUrl::protocol () const</h3>Returns the protocol of the URL. Typically, "file", "http", "ftp",etc.<p> <p>See also <a href="#setProtocol">setProtocol</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="query"></a>QUrl::query () const</h3>Returns the (encoded) query of the URL.<p> <p>See also <a href="#setQuery">setQuery</a>() and <a href="#decode">decode</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="ref"></a>QUrl::ref () const</h3>Returns the (encoded) reference of the URL.<p> <p>See also <a href="#setRef">setRef</a>(), <a href="#hasRef">hasRef</a>() and <a href="#decode">decode</a>().<h3 class=fn>void <a name="reset"></a>QUrl::reset ()<tt> [virtual protected]</tt></h3>Resets all parts of the URL to their default values andinvalidates it.<h3 class=fn>void <a name="setEncodedPathAndQuery"></a>QUrl::setEncodedPathAndQuery ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;pathAndQuery )<tt> [virtual]</tt></h3>Parses <em>pathAndQuery</em> for a path and query and sets those values.The whole string must be encoded.<p> <p>See also <a href="#encode">encode</a>().<h3 class=fn>void <a name="setFileName"></a>QUrl::setFileName ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )<tt> [virtual]</tt></h3>Sets the file name of the URL to <em>name</em>. If this URL contains a<a href="#fileName">fileName</a>(), the original file name is replaced by <em>name</em>.<p> See the documentation of fileName() for a more detailed discussionof what is handled as file name and what is handled as a directorypath.<p> <p>See also <a href="#fileName">fileName</a>().<h3 class=fn>void <a name="setHost"></a>QUrl::setHost ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;host )<tt> [virtual]</tt></h3>Sets the hostname of the URL to <em>host</em>.<p> <p>See also <a href="#host">host</a>() and <a href="#hasHost">hasHost</a>().<h3 class=fn>void <a name="setPassword"></a>QUrl::setPassword ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;pass )<tt> [virtual]</tt></h3>Sets the password of the URL to <em>pass</em>.<p> <b>Warning:</b> Passwords passed in URLs are normally <em>insecure</em>; thisis due to the mechanism, not because of Qt.<p> <p>See also <a href="#password">password</a>() and <a href="#setUser">setUser</a>().<h3 class=fn>void <a name="setPath"></a>QUrl::setPath ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;path )<tt> [virtual]</tt></h3>Sets the path of the URL to <em>path</em>.<p> <p>See also <a href="#path">path</a>() and <a href="#hasPath">hasPath</a>().<h3 class=fn>void <a name="setPort"></a>QUrl::setPort ( int&nbsp;port )<tt> [virtual]</tt></h3>Sets the port of the URL to <em>port</em>.<p> <p>See also <a href="#port">port</a>().<h3 class=fn>void <a name="setProtocol"></a>QUrl::setProtocol ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;protocol )<tt> [virtual]</tt></h3>Sets the protocol of the URL to <em>protocol</em>. Typically, "file","http", "ftp", etc.<p> <p>See also <a href="#protocol">protocol</a>().<h3 class=fn>void <a name="setQuery"></a>QUrl::setQuery ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;txt )<tt> [virtual]</tt></h3>Sets the query of the URL to <em>txt</em>. <em>txt</em> must be encoded.<p> <p>See also <a href="#query">query</a>() and <a href="#encode">encode</a>().<h3 class=fn>void <a name="setRef"></a>QUrl::setRef ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;txt )<tt> [virtual]</tt></h3>Sets the reference of the URL to <em>txt</em>. <em>txt</em> must be encoded.<p> <p>See also <a href="#ref">ref</a>(), <a href="#hasRef">hasRef</a>() and <a href="#encode">encode</a>().<h3 class=fn>void <a name="setUser"></a>QUrl::setUser ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;user )<tt> [virtual]</tt></h3>Sets the username of the URL to <em>user</em>.<p> <p>See also <a href="#user">user</a>() and <a href="#setPassword">setPassword</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="toString"></a>QUrl::toString ( bool&nbsp;encodedPath = FALSE, bool&nbsp;forcePrependProtocol = TRUE ) const<tt> [virtual]</tt></h3>Composes a string version of the URL and returns it. If <em>encodedPath</em> is TRUE the path in the returned string is encoded. If<em>forcePrependProtocol</em> is TRUE and <em>encodedPath</em> looks like alocal filename, the "file:/" protocol is also prepended.<p> <p>See also <a href="#encode">encode</a>() and <a href="#decode">decode</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="user"></a>QUrl::user () const</h3>Returns the username of the URL.<p> <p>See also <a href="#setUser">setUser</a>() and <a href="#setPassword">setPassword</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -