Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1993

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qurl.cpp:92 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QUrl Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QUrl Class Reference<br><small>[<a href="network.html">network module</a>]</small></h1>

<p>The QUrl class provides a URL parser and simplifies working with URLs.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qurl-h.html">qurl.h</a>&gt;</tt>
<p>Inherited by <a href="qurloperator.html">QUrlOperator</a>.
<p><a href="qurl-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QUrl"><b>QUrl</b></a> ()</div></li>
<li><div class=fn><a href="#QUrl-2"><b>QUrl</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn><a href="#QUrl-3"><b>QUrl</b></a> ( const&nbsp;QUrl&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn><a href="#QUrl-4"><b>QUrl</b></a> ( const&nbsp;QUrl&nbsp;&amp;&nbsp;url, const&nbsp;QString&nbsp;&amp;&nbsp;relUrl, bool&nbsp;checkSlash = FALSE )</div></li>
<li><div class=fn>virtual <a href="#~QUrl"><b>~QUrl</b></a> ()</div></li>
<li><div class=fn>QString <a href="#protocol"><b>protocol</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setProtocol"><b>setProtocol</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;protocol )</div></li>
<li><div class=fn>QString <a href="#user"><b>user</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setUser"><b>setUser</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;user )</div></li>
<li><div class=fn>bool <a href="#hasUser"><b>hasUser</b></a> () const</div></li>
<li><div class=fn>QString <a href="#password"><b>password</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPassword"><b>setPassword</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;pass )</div></li>
<li><div class=fn>bool <a href="#hasPassword"><b>hasPassword</b></a> () const</div></li>
<li><div class=fn>QString <a href="#host"><b>host</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setHost"><b>setHost</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;host )</div></li>
<li><div class=fn>bool <a href="#hasHost"><b>hasHost</b></a> () const</div></li>
<li><div class=fn>int <a href="#port"><b>port</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPort"><b>setPort</b></a> ( int&nbsp;port )</div></li>
<li><div class=fn>bool <a href="#hasPort"><b>hasPort</b></a> () const</div></li>
<li><div class=fn>QString <a href="#path"><b>path</b></a> ( bool&nbsp;correct = TRUE ) const</div></li>
<li><div class=fn>virtual void <a href="#setPath"><b>setPath</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;path )</div></li>
<li><div class=fn>bool <a href="#hasPath"><b>hasPath</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setEncodedPathAndQuery"><b>setEncodedPathAndQuery</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;pathAndQuery )</div></li>
<li><div class=fn>QString <a href="#encodedPathAndQuery"><b>encodedPathAndQuery</b></a> ()</div></li>
<li><div class=fn>virtual void <a href="#setQuery"><b>setQuery</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;txt )</div></li>
<li><div class=fn>QString <a href="#query"><b>query</b></a> () const</div></li>
<li><div class=fn>QString <a href="#ref"><b>ref</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setRef"><b>setRef</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;txt )</div></li>
<li><div class=fn>bool <a href="#hasRef"><b>hasRef</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isValid"><b>isValid</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isLocalFile"><b>isLocalFile</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#addPath"><b>addPath</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;pa )</div></li>
<li><div class=fn>virtual void <a href="#setFileName"><b>setFileName</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</div></li>
<li><div class=fn>QString <a href="#fileName"><b>fileName</b></a> () const</div></li>
<li><div class=fn>QString <a href="#dirPath"><b>dirPath</b></a> () const</div></li>
<li><div class=fn>QUrl &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QUrl&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn>QUrl &amp; <a href="#operator-eq-2"><b>operator=</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;QUrl&nbsp;&amp;&nbsp;url ) const</div></li>
<li><div class=fn>bool <a href="#operator-eq-eq-2"><b>operator==</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;url ) const</div></li>
<li><div class=fn><a href="#operator-QString"><b>operator QString</b></a> () const</div></li>
<li><div class=fn>virtual QString <a href="#toString"><b>toString</b></a> ( bool&nbsp;encodedPath = FALSE, bool&nbsp;forcePrependProtocol = TRUE ) const</div></li>
<li><div class=fn>virtual bool <a href="#cdUp"><b>cdUp</b></a> ()</div></li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class=fn>void <a href="#decode"><b>decode</b></a> ( QString&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn>void <a href="#encode"><b>encode</b></a> ( QString&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn>bool <a href="#isRelativeUrl"><b>isRelativeUrl</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;url )</div></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class=fn>virtual void <a href="#reset"><b>reset</b></a> ()</div></li>
<li><div class=fn>virtual bool <a href="#parse"><b>parse</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;url )</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


<p> The QUrl class provides a URL parser and simplifies working with URLs.
<p> 


<p> 
<p> The QUrl class is provided for simple work with URLs.
It can parse, decode, encode, etc.
<p> QUrl works with the decoded path and encoded query in turn.
<p> Example:
<p> <tt>http://www.trolltech.com:80/cgi-bin/test%20me.pl?cmd=Hello%20you</tt>
<p> <center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Function
<th valign="top">Returns
<tr bgcolor="#f0f0f0"> <td valign="top">protocol()
<td valign="top">"http"
<tr bgcolor="#d0d0d0"> <td valign="top">host()
<td valign="top">"www.trolltech.com"
<tr bgcolor="#f0f0f0"> <td valign="top">port()
<td valign="top">80
<tr bgcolor="#d0d0d0"> <td valign="top">path()
<td valign="top">"cgi-bin"
<tr bgcolor="#f0f0f0"> <td valign="top">fileName()
<td valign="top">"test&nbsp;me.pl"
<tr bgcolor="#d0d0d0"> <td valign="top">query()
<td valign="top">"cmd=Hello%20you"
</table></center>
<p> Example:
<p> <a href="http://doc.trolltech.com/qdockarea.html#lines">http://doc.trolltech.com/qdockarea.html#lines</a>
<p> <center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Function
<th valign="top">Returns
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#protocol">protocol</a>()
<td valign="top">"http"
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#host">host</a>()
<td valign="top">"doc.trolltech.com"
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#fileName">fileName</a>()
<td valign="top">"qdockarea.html"
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#ref">ref</a>()
<td valign="top">"lines"
</table></center>
<p> The individual parts of a URL can be set with <a href="#setProtocol">setProtocol</a>(),
<a href="#setHost">setHost</a>(), <a href="#setPort">setPort</a>(), <a href="#setPath">setPath</a>(), <a href="#setFileName">setFileName</a>(), <a href="#setRef">setRef</a>() and
<a href="#setQuery">setQuery</a>(). A URL could contain, for example, an ftp address which
requires a user name and password; these can be set with <a href="#setUser">setUser</a>()
and <a href="#setPassword">setPassword</a>().
<p> Because path is always encoded internally you must not use "%00"
in the path, although this is okay (but not recommended) for the
query.
<p> QUrl is normally used like this:
<p> <pre>
  QUrl u( "http://www.trolltech.com" );
  // or
  QUrl u( "file:/home/myself/Mail", "Inbox" );
  </pre>
 
<p> You can then access and manipulate the various parts of the URL.
<p> To make it easy to work with QUrls and QStrings, QUrl implements
the necessary cast and assignment operators so you can do following:
<p> <pre>
  QUrl u( "http://www.trolltech.com" );
  <a href="qstring.html">QString</a> s = u;
  // or
  <a href="qstring.html">QString</a> s( "http://www.trolltech.com" );
  QUrl u( s );
  </pre>
 
<p> Use the static functions, <a href="#encode">encode</a>() and <a href="#decode">decode</a>() to encode or
decode a URL in a string. (They operate on the string in-place.)
The <a href="#isRelativeUrl">isRelativeUrl</a>() static function returns TRUE if the given
string is a relative URL.
<p> If you want to use an URL to work on a hierarchical structure (e.g.
a local or remote filesystem), you might want to use the subclass
<a href="qurloperator.html">QUrlOperator</a>.
<p> <p>See also <a href="qurloperator.html">QUrlOperator</a>, <a href="io.html">Input/Output and Networking</a> and <a href="misc.html">Miscellaneous Classes</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QUrl"></a>QUrl::QUrl ()
</h3>
Constructs an empty URL that is invalid.

<h3 class=fn><a name="QUrl-2"></a>QUrl::QUrl ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url )
</h3>
Constructs a URL by parsing the string <em>url</em>.
<p> If you pass a string like "/home/qt", the "file" protocol is
assumed.

<h3 class=fn><a name="QUrl-3"></a>QUrl::QUrl ( const&nbsp;<a href="qurl.html">QUrl</a>&nbsp;&amp;&nbsp;url )
</h3>
Copy constructor. Copies the data of <em>url</em>.

<h3 class=fn><a name="QUrl-4"></a>QUrl::QUrl ( const&nbsp;<a href="qurl.html">QUrl</a>&nbsp;&amp;&nbsp;url, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;relUrl, bool&nbsp;checkSlash = FALSE )
</h3>
Constructs an URL taking <em>url</em> as the base (context) and
<em>relUrl</em> as a relative URL to <em>url</em>. If <em>relUrl</em> is not relative,
<em>relUrl</em> is taken as the new URL.
<p> For example, the path of
<pre>
  QUrl u( "ftp://ftp.trolltech.com/qt/source", "qt-2.1.0.tar.gz" );
  </pre>
 
will be "/qt/srource/qt-2.1.0.tar.gz".
<p> On the other hand,
<pre>
  QUrl u( "ftp://ftp.trolltech.com/qt/source", "/usr/local" );
  </pre>
 
will result in a new URL, "ftp://ftp.trolltech.com/usr/local",
because "/usr/local" isn't relative.
<p> Similarly,
<pre>
  QUrl u( "ftp://ftp.trolltech.com/qt/source", "file:/usr/local" );
  </pre>
 
will result in a new URL, with "/usr/local" as the path
and "file" as the protocol.
<p> Normally it is expected that the path of <em>url</em> points to
a directory, even if the path has no slash at the end. But
if you want the constructor to handle the last
part of the path as a file name if there is no slash at the end,
and to let it be replaced by the file name of <em>relUrl</em>
(if it contains one), set <em>checkSlash</em> to TRUE.

<h3 class=fn><a name="~QUrl"></a>QUrl::~QUrl ()<tt> [virtual]</tt>
</h3>
Destructor.

<h3 class=fn>void <a name="addPath"></a>QUrl::addPath ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;pa )<tt> [virtual]</tt>
</h3>
Adds the path <em>pa</em> to the path of the URL.
<p> <p>See also <a href="#setPath">setPath</a>() and <a href="#hasPath">hasPath</a>().

<h3 class=fn>bool <a name="cdUp"></a>QUrl::cdUp ()<tt> [virtual]</tt>
</h3>
Changes the directory to one directory up.
<p> <p>See also <a href="#setPath">setPath</a>().

<h3 class=fn>void <a name="decode"></a>QUrl::decode ( <a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url )<tt> [static]</tt>
</h3>
Decodes the string <em>url</em> in-place.
<p> <p>See also <a href="#encode">encode</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="dirPath"></a>QUrl::dirPath () const
</h3>
Returns the directory path of the URL. This is the part
of the path of the URL without the <a href="#fileName">fileName</a>(). See
the documentation of fileName() for a discussion of
what is handled as file name and 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#x960">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> in-place.
<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't have a slash at the end, the part between the last slash
and the end of the path string is considered to be the file name. If
the path 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#x961">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 returns FALSE.
<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;
otherise returns FALSE.
<p> <b>Warning:</b> Passwords passed in URLs are normally <em>insecure</em>; this is
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 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 returns FALSE.
<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 FALSE.

<p>Example: <a href="qdir-example.html#x806">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 URL is 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 be
assumed.

<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. Returns TRUE 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>; this is
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 is
cleaned (deals with too many or too few slashes, cleans things
like "/../..", etc). Otherwise <a href="#path">path</a>() returns exactly the path
that 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#x807">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", or "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
and invalidates 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 has to 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 discussion
of what is handled as file name and what is handled as a directory
path.
<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>; this is
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", or "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 a
local 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-2001
<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; 2001 
<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.2</div>
</table></div></address></body>
</html>