Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 6959

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qurl.cpp -->
  <title>Qt 4.8: QUrl Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QUrl</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#character-conversions">Character Conversions</a></li>
</ul>
</div>
<h1 class="title">QUrl Class Reference</h1>
<!-- $$$QUrl-brief -->
<p>The QUrl class provides a convenient interface for working with URLs. <a href="#details">More...</a></p>
<!-- @@@QUrl -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QUrl&gt;</span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qurl-members.html">List of all members, including inherited members</a></li>
<li><a href="qurl-obsolete.html">Obsolete members</a></li>
<li><a href="qurl-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#FormattingOption-enum">FormattingOption</a></b> { None, RemoveScheme, RemovePassword, RemoveUserInfo, ..., StripTrailingSlash }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#FormattingOption-enum">FormattingOptions</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#ParsingMode-enum">ParsingMode</a></b> { TolerantMode, StrictMode }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#QUrl">QUrl</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#QUrl-2">QUrl</a></b> ( const QString &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#QUrl-3">QUrl</a></b> ( const QUrl &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#QUrl-4">QUrl</a></b> ( const QString &amp; <i>url</i>, ParsingMode <i>parsingMode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#dtor.QUrl">~QUrl</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#addEncodedQueryItem">addEncodedQueryItem</a></b> ( const QByteArray &amp; <i>key</i>, const QByteArray &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#addQueryItem">addQueryItem</a></b> ( const QString &amp; <i>key</i>, const QString &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QByteArray&gt; </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#allEncodedQueryItemValues">allEncodedQueryItemValues</a></b> ( const QByteArray &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#allQueryItemValues">allQueryItemValues</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#authority">authority</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedFragment">encodedFragment</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedHost">encodedHost</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedPassword">encodedPassword</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedPath">encodedPath</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedQuery">encodedQuery</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedQueryItemValue">encodedQueryItemValue</a></b> ( const QByteArray &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QPair&lt;QByteArray, QByteArray&gt; &gt; </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedQueryItems">encodedQueryItems</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#encodedUserName">encodedUserName</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#errorString">errorString</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#fragment">fragment</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#hasEncodedQueryItem">hasEncodedQueryItem</a></b> ( const QByteArray &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#hasFragment">hasFragment</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#hasQuery">hasQuery</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#hasQueryItem">hasQueryItem</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#host">host</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#isLocalFile">isLocalFile</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#isParentOf">isParentOf</a></b> ( const QUrl &amp; <i>childUrl</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#isRelative">isRelative</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#password">password</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#pathx">path</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#port">port</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#port-2">port</a></b> ( int <i>defaultPort</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#queryItemValue">queryItemValue</a></b> ( const QString &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QPair&lt;QString, QString&gt; &gt; </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#queryItems">queryItems</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#queryPairDelimiter">queryPairDelimiter</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#queryValueDelimiter">queryValueDelimiter</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#removeAllEncodedQueryItems">removeAllEncodedQueryItems</a></b> ( const QByteArray &amp; <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#removeAllQueryItems">removeAllQueryItems</a></b> ( const QString &amp; <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#removeEncodedQueryItem">removeEncodedQueryItem</a></b> ( const QByteArray &amp; <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#removeQueryItem">removeQueryItem</a></b> ( const QString &amp; <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#resolved">resolved</a></b> ( const QUrl &amp; <i>relative</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#scheme">scheme</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setAuthority">setAuthority</a></b> ( const QString &amp; <i>authority</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedFragment">setEncodedFragment</a></b> ( const QByteArray &amp; <i>fragment</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedHost">setEncodedHost</a></b> ( const QByteArray &amp; <i>host</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedPassword">setEncodedPassword</a></b> ( const QByteArray &amp; <i>password</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedPath">setEncodedPath</a></b> ( const QByteArray &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedQuery">setEncodedQuery</a></b> ( const QByteArray &amp; <i>query</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedQueryItems">setEncodedQueryItems</a></b> ( const QList&lt;QPair&lt;QByteArray, QByteArray&gt; &gt; &amp; <i>query</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedUrl">setEncodedUrl</a></b> ( const QByteArray &amp; <i>encodedUrl</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedUrl-2">setEncodedUrl</a></b> ( const QByteArray &amp; <i>encodedUrl</i>, ParsingMode <i>parsingMode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setEncodedUserName">setEncodedUserName</a></b> ( const QByteArray &amp; <i>userName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setFragment">setFragment</a></b> ( const QString &amp; <i>fragment</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setHost">setHost</a></b> ( const QString &amp; <i>host</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setPassword">setPassword</a></b> ( const QString &amp; <i>password</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setPath">setPath</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setPort">setPort</a></b> ( int <i>port</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setQueryDelimiters">setQueryDelimiters</a></b> ( char <i>valueDelimiter</i>, char <i>pairDelimiter</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setQueryItems">setQueryItems</a></b> ( const QList&lt;QPair&lt;QString, QString&gt; &gt; &amp; <i>query</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setScheme">setScheme</a></b> ( const QString &amp; <i>scheme</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setUrl">setUrl</a></b> ( const QString &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setUrl-2">setUrl</a></b> ( const QString &amp; <i>url</i>, ParsingMode <i>parsingMode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setUserInfo">setUserInfo</a></b> ( const QString &amp; <i>userInfo</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setUserName">setUserName</a></b> ( const QString &amp; <i>userName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#swap">swap</a></b> ( QUrl &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#toEncoded">toEncoded</a></b> ( FormattingOptions <i>options</i> = None ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#toLocalFile">toLocalFile</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#toString">toString</a></b> ( FormattingOptions <i>options</i> = None ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#topLevelDomain">topLevelDomain</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#userInfo">userInfo</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#userName">userName</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#operator-not-eq">operator!=</a></b> ( const QUrl &amp; <i>url</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl &amp; </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#operator-eq">operator=</a></b> ( const QUrl &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl &amp; </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#operator-eq-2">operator=</a></b> ( const QString &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#operator-eq-eq">operator==</a></b> ( const QUrl &amp; <i>url</i> ) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#fromAce">fromAce</a></b> ( const QByteArray &amp; <i>domain</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#fromEncoded">fromEncoded</a></b> ( const QByteArray &amp; <i>input</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#fromEncoded-2">fromEncoded</a></b> ( const QByteArray &amp; <i>input</i>, ParsingMode <i>parsingMode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#fromLocalFile">fromLocalFile</a></b> ( const QString &amp; <i>localFile</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#fromPercentEncoding">fromPercentEncoding</a></b> ( const QByteArray &amp; <i>input</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#fromUserInput">fromUserInput</a></b> ( const QString &amp; <i>userInput</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#idnWhitelist">idnWhitelist</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#setIdnWhitelist">setIdnWhitelist</a></b> ( const QStringList &amp; <i>list</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#toAce">toAce</a></b> ( const QString &amp; <i>domain</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#toPercentEncoding">toPercentEncoding</a></b> ( const QString &amp; <i>input</i>, const QByteArray &amp; <i>exclude</i> = QByteArray(), const QByteArray &amp; <i>include</i> = QByteArray() )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#qHash-10">qHash</a></b> ( const QUrl &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#operator-lt-lt-32">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>out</i>, const QUrl &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#operator-gt-gt-22">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>in</i>, QUrl &amp; <i>url</i> )</td></tr>
</table>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qurl.html#QT_NO_URL_CAST_FROM_STRING">QT_NO_URL_CAST_FROM_STRING</a></b></td></tr>
</table>
<a name="details"></a>
<!-- $$$QUrl-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QUrl class provides a convenient interface for working with URLs.</p>
<p>It can parse and construct URLs in both encoded and unencoded form. QUrl also has support for internationalized domain names (IDNs).</p>
<p>The most common way to use QUrl is to initialize it via the constructor by passing a <a href="qstring.html">QString</a>. Otherwise, <a href="qurl.html#setUrl">setUrl</a>() and <a href="qurl.html#setEncodedUrl">setEncodedUrl</a>() can also be used.</p>
<p>URLs can be represented in two forms: encoded or unencoded. The unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL &quot;http://b&uuml;<tt></tt>hler.example.com/List of applicants.xml&quot; would be sent to the server as &quot;http://xn--bhler-kva.example.com/List%20of%20applicants.xml&quot;, and this can be verified by calling the <a href="qurl.html#toEncoded">toEncoded</a>() function.</p>
<p>A URL can also be constructed piece by piece by calling <a href="qurl.html#setScheme">setScheme</a>(), <a href="qurl.html#setUserName">setUserName</a>(), <a href="qurl.html#setPassword">setPassword</a>(), <a href="qurl.html#setHost">setHost</a>(), <a href="qurl.html#setPort">setPort</a>(), <a href="qurl.html#setPath">setPath</a>(), <a href="qurl.html#setEncodedQuery">setEncodedQuery</a>() and <a href="qurl.html#setFragment">setFragment</a>(). Some convenience functions are also available: <a href="qurl.html#setAuthority">setAuthority</a>() sets the user name, password, host and port. <a href="qurl.html#setUserInfo">setUserInfo</a>() sets the user name and password at once.</p>
<p>Call <a href="qurl.html#isValid">isValid</a>() to check if the URL is valid. This can be done at any point during the constructing of a URL.</p>
<p>Constructing a query is particularly convenient through the use of <a href="qurl.html#setQueryItems">setQueryItems</a>(), <a href="qurl.html#addQueryItem">addQueryItem</a>() and <a href="qurl.html#removeQueryItem">removeQueryItem</a>(). Use <a href="qurl.html#setQueryDelimiters">setQueryDelimiters</a>() to customize the delimiters used for generating the query string.</p>
<p>For the convenience of generating encoded URL strings or query strings, there are two static functions called <a href="qurl.html#fromPercentEncoding">fromPercentEncoding</a>() and <a href="qurl.html#toPercentEncoding">toPercentEncoding</a>() which deal with percent encoding and decoding of QStrings.</p>
<p>Calling <a href="qurl.html#isRelative">isRelative</a>() will tell whether or not the URL is relative. A relative URL can be resolved by passing it as argument to <a href="qurl.html#resolved">resolved</a>(), which returns an absolute URL. <a href="qurl.html#isParentOf">isParentOf</a>() is used for determining whether one URL is a parent of another.</p>
<p><a href="qurl.html#fromLocalFile">fromLocalFile</a>() constructs a QUrl by parsing a local file path. <a href="qurl.html#toLocalFile">toLocalFile</a>() converts a URL to a local file path.</p>
<p>The human readable representation of the URL is fetched with <a href="qurl.html#toString">toString</a>(). This representation is appropriate for displaying a URL to a user in unencoded form. The encoded form however, as returned by <a href="qurl.html#toEncoded">toEncoded</a>(), is for internal use, passing to web servers, mail clients and so on.</p>
<p>QUrl conforms to the URI specification from <a href="http://www.rfc-editor.org/rfc/rfc3986.txt">RFC 3986</a> (Uniform Resource Identifier: Generic Syntax), and includes scheme extensions from <a href="http://www.rfc-editor.org/rfc/rfc1738.txt">RFC 1738</a> (Uniform Resource Locators). Case folding rules in QUrl conform to <a href="http://www.rfc-editor.org/rfc/rfc3491.txt">RFC 3491</a> (Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)).</p>
<a name="character-conversions"></a>
<h4>Character Conversions</h4>
<p>Follow these rules to avoid erroneous character conversion when dealing with URLs and strings:</p>
<ul>
<li>When creating an <a href="qstring.html">QString</a> to contain a URL from a <a href="qbytearray.html">QByteArray</a> or a char*, always use <a href="qstring.html#fromUtf8">QString::fromUtf8</a>().</li>
<li>Favor the use of <a href="qurl.html#fromEncoded">QUrl::fromEncoded</a>() and <a href="qurl.html#toEncoded">QUrl::toEncoded</a>() instead of QUrl(string) and <a href="qurl.html#toString">QUrl::toString</a>() when converting a QUrl to or from a string.</li>
</ul>
</div>
<p><b>See also </b><a href="qurlinfo.html">QUrlInfo</a>.</p>
<!-- @@@QUrl -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$FormattingOption$$$None$$$RemoveScheme$$$RemovePassword$$$RemoveUserInfo$$$RemovePort$$$RemoveAuthority$$$RemovePath$$$RemoveQuery$$$RemoveFragment$$$StripTrailingSlash -->
<h3 class="flags"><a name="FormattingOption-enum"></a>enum QUrl::<span class="name">FormattingOption</span><br/>flags QUrl::<span class="name">FormattingOptions</span></h3>
<p>The formatting options define how the URL is formatted when written out as text.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QUrl::None</tt></td><td class="topAlign"><tt>0x0</tt></td><td class="topAlign">The format of the URL is unchanged.</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemoveScheme</tt></td><td class="topAlign"><tt>0x1</tt></td><td class="topAlign">The scheme is removed from the URL.</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemovePassword</tt></td><td class="topAlign"><tt>0x2</tt></td><td class="topAlign">Any password in the URL is removed.</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemoveUserInfo</tt></td><td class="topAlign"><tt>RemovePassword | 0x4</tt></td><td class="topAlign">Any user information in the URL is removed.</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemovePort</tt></td><td class="topAlign"><tt>0x8</tt></td><td class="topAlign">Any specified port is removed from the URL.</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemoveAuthority</tt></td><td class="topAlign"><tt>RemoveUserInfo | RemovePort | 0x10</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemovePath</tt></td><td class="topAlign"><tt>0x20</tt></td><td class="topAlign">The URL's path is removed, leaving only the scheme, host address, and port (if present).</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemoveQuery</tt></td><td class="topAlign"><tt>0x40</tt></td><td class="topAlign">The query part of the URL (following a '?' character) is removed.</td></tr>
<tr><td class="topAlign"><tt>QUrl::RemoveFragment</tt></td><td class="topAlign"><tt>0x80</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QUrl::StripTrailingSlash</tt></td><td class="topAlign"><tt>0x10000</tt></td><td class="topAlign">The trailing slash is removed if one is present.</td></tr>
</table>
<p>Note that the case folding rules in <a href="http://www.rfc-editor.org/rfc/rfc3491.txt">Nameprep</a>, which <a href="qurl.html">QUrl</a> conforms to, require host names to always be converted to lower case, regardless of the Qt::FormattingOptions used.</p>
<p>The FormattingOptions type is a typedef for <a href="qflags.html">QFlags</a>&lt;FormattingOption&gt;. It stores an OR combination of FormattingOption values.</p>
<!-- @@@FormattingOption -->
<!-- $$$ParsingMode$$$TolerantMode$$$StrictMode -->
<h3 class="fn"><a name="ParsingMode-enum"></a>enum QUrl::<span class="name">ParsingMode</span></h3>
<p>The parsing mode controls the way <a href="qurl.html">QUrl</a> parses strings.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QUrl::TolerantMode</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign"><a href="qurl.html">QUrl</a> will try to correct some common errors in URLs. This mode is useful when processing URLs entered by users.</td></tr>
<tr><td class="topAlign"><tt>QUrl::StrictMode</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">Only valid URLs are accepted. This mode is useful for general URL validation.</td></tr>
</table>
<p>In TolerantMode, the parser corrects the following invalid input:</p>
<ul>
<li>Spaces and &quot;%20&quot;: If an encoded URL contains a space, this will be replaced with &quot;%20&quot;. If a decoded URL contains &quot;%20&quot;, this will be replaced with a single space before the URL is parsed.</li>
<li>Single &quot;%&quot; characters: Any occurrences of a percent character &quot;%&quot; not followed by exactly two hexadecimal characters (e.g&#x2e;, &quot;13% coverage.html&quot;) will be replaced by &quot;%25&quot;.</li>
<li>Reserved and unreserved characters: An encoded URL should only contain a few characters as literals; all other characters should be percent-encoded. In TolerantMode, these characters will be automatically percent-encoded where they are not allowed: space / double-quote / &quot;&lt;&quot; / &quot;&gt;&quot; / &quot;[&quot; / &quot;&quot; / &quot;]&quot; / &quot;^&quot; / &quot;`&quot; / &quot;{&quot; / &quot;|&quot; / &quot;}&quot;</li>
</ul>
<!-- @@@ParsingMode -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QUrl[overload1]$$$QUrl -->
<h3 class="fn"><a name="QUrl"></a>QUrl::<span class="name">QUrl</span> ()</h3>
<p>Constructs an empty <a href="qurl.html">QUrl</a> object.</p>
<!-- @@@QUrl -->
<!-- $$$QUrl$$$QUrlconstQString& -->
<h3 class="fn"><a name="QUrl-2"></a>QUrl::<span class="name">QUrl</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>url</i> )</h3>
<p>Constructs a URL by parsing <i>url</i>. <i>url</i> is assumed to be in human readable representation, with no percent encoding. <a href="qurl.html">QUrl</a> will automatically percent encode all characters that are not allowed in a URL. The default parsing mode is <a href="qurl.html#ParsingMode-enum">TolerantMode</a>.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qurl.html">QUrl</a></span> url(<span class="string">&quot;http://www.example.com/List of holidays.xml&quot;</span>);
 <span class="comment">// url.toEncoded() == &quot;http://www.example.com/List%20of%20holidays.xml&quot;</span></pre>
<p>To construct a URL from an encoded string, call <a href="qurl.html#fromEncoded">fromEncoded</a>():</p>
<pre class="cpp"> <span class="type"><a href="qurl.html">QUrl</a></span> url <span class="operator">=</span> <span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">::</span><a href="qurl.html#fromEncoded">fromEncoded</a>(<span class="string">&quot;http://qt.nokia.com/List%20of%20holidays.xml&quot;</span>);</pre>
<p><b>See also </b><a href="qurl.html#setUrl">setUrl</a>(), <a href="qurl.html#setEncodedUrl">setEncodedUrl</a>(), <a href="qurl.html#fromEncoded">fromEncoded</a>(), and <a href="qurl.html#ParsingMode-enum">TolerantMode</a>.</p>
<!-- @@@QUrl -->
<!-- $$$QUrl$$$QUrlconstQUrl& -->
<h3 class="fn"><a name="QUrl-3"></a>QUrl::<span class="name">QUrl</span> ( const <span class="type">QUrl</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QUrl -->
<!-- $$$QUrl$$$QUrlconstQString&ParsingMode -->
<h3 class="fn"><a name="QUrl-4"></a>QUrl::<span class="name">QUrl</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>url</i>, <span class="type"><a href="qurl.html#ParsingMode-enum">ParsingMode</a></span> <i>parsingMode</i> )</h3>
<p>This is an overloaded function.</p>
<p>Parses the <i>url</i> using the parser mode <i>parsingMode</i>. The default parsing mode is <a href="qurl.html#ParsingMode-enum">TolerantMode</a>.</p>
<p><b>See also </b><a href="qurl.html#setUrl">setUrl</a>().</p>
<!-- @@@QUrl -->
<!-- $$$~QUrl[overload1]$$$~QUrl -->
<h3 class="fn"><a name="dtor.QUrl"></a>QUrl::<span class="name">~QUrl</span> ()</h3>
<p>Destructor; called immediately before the object is deleted.</p>
<!-- @@@~QUrl -->
<!-- $$$addEncodedQueryItem[overload1]$$$addEncodedQueryItemconstQByteArray&constQByteArray& -->
<h3 class="fn"><a name="addEncodedQueryItem"></a><span class="type">void</span> QUrl::<span class="name">addEncodedQueryItem</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>key</i>, const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>value</i> )</h3>
<p>Inserts the pair <i>key</i> = <i>value</i> into the query string of the URL.</p>
<p>Note: this function does not verify that either <i>key</i> or <i>value</i> are properly encoded. It is the caller's responsibility to ensure that the query delimiters are properly encoded, if any.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#addQueryItem">addQueryItem</a>() and <a href="qurl.html#setQueryDelimiters">setQueryDelimiters</a>().</p>
<!-- @@@addEncodedQueryItem -->
<!-- $$$addQueryItem[overload1]$$$addQueryItemconstQString&constQString& -->
<h3 class="fn"><a name="addQueryItem"></a><span class="type">void</span> QUrl::<span class="name">addQueryItem</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>value</i> )</h3>
<p>Inserts the pair <i>key</i> = <i>value</i> into the query string of the URL.</p>
<p>The key/value pair is encoded before it is added to the query. The pair is converted into separate strings internally. The <i>key</i> and <i>value</i> is first encoded into UTF-8 and then delimited by the character returned by valueDelimiter(). Each key/value pair is delimited by the character returned by pairDelimiter().</p>
<p><b>Note:</b> This method does not encode spaces (ASCII 0x20) as plus (+) signs, like HTML forms do. If you need that kind of encoding, you must encode the value yourself and use QUrl::addEncodedQueryItem.</p>
<p><b>See also </b><a href="qurl.html#addEncodedQueryItem">addEncodedQueryItem</a>().</p>
<!-- @@@addQueryItem -->
<!-- $$$allEncodedQueryItemValues[overload1]$$$allEncodedQueryItemValuesconstQByteArray& -->
<h3 class="fn"><a name="allEncodedQueryItemValues"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qbytearray.html">QByteArray</a></span>&gt; QUrl::<span class="name">allEncodedQueryItemValues</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>key</i> ) const</h3>
<p>Returns the a list of query string values whose key is equal to <i>key</i> from the URL.</p>
<p>Note: if the encoded <i>key</i> does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is &quot;search=Qt%20Rules&quot;, calling this function with <i>key</i> = &quot;%73earch&quot; will return an empty list.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#allQueryItemValues">allQueryItemValues</a>(), <a href="qurl.html#queryItemValue">queryItemValue</a>(), and <a href="qurl.html#encodedQueryItemValue">encodedQueryItemValue</a>().</p>
<!-- @@@allEncodedQueryItemValues -->
<!-- $$$allQueryItemValues[overload1]$$$allQueryItemValuesconstQString& -->
<h3 class="fn"><a name="allQueryItemValues"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QUrl::<span class="name">allQueryItemValues</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const</h3>
<p>Returns the a list of query string values whose key is equal to <i>key</i> from the URL.</p>
<p><b>Note:</b> This method does not decode spaces plus (+) signs as spaces (ASCII 0x20), like HTML forms do. If you need that kind of decoding, you must use QUrl::allEncodedQueryItemValues and decode the data yourself.</p>
<p><b>See also </b><a href="qurl.html#queryItemValue">queryItemValue</a>().</p>
<!-- @@@allQueryItemValues -->
<!-- $$$authority[overload1]$$$authority -->
<h3 class="fn"><a name="authority"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">authority</span> () const</h3>
<p>Returns the authority of the URL if it is defined; otherwise an empty string is returned.</p>
<p><b>See also </b><a href="qurl.html#setAuthority">setAuthority</a>().</p>
<!-- @@@authority -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QUrl::<span class="name">clear</span> ()</h3>
<p>Resets the content of the <a href="qurl.html">QUrl</a>. After calling this function, the <a href="qurl.html">QUrl</a> is equal to one that has been constructed with the default empty constructor.</p>
<!-- @@@clear -->
<!-- $$$encodedFragment[overload1]$$$encodedFragment -->
<h3 class="fn"><a name="encodedFragment"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">encodedFragment</span> () const</h3>
<p>Returns the fragment of the URL if it is defined; otherwise an empty string is returned. The returned value will have its non-ASCII and other control characters percent-encoded, as in <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setEncodedFragment">setEncodedFragment</a>() and <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<!-- @@@encodedFragment -->
<!-- $$$encodedHost[overload1]$$$encodedHost -->
<h3 class="fn"><a name="encodedHost"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">encodedHost</span> () const</h3>
<p>Returns the host part of the URL if it is defined; otherwise an empty string is returned.</p>
<p>Note: encodedHost() does not return percent-encoded hostnames. Instead, the ACE-encoded (bare ASCII in Punycode encoding) form will be returned for any non-ASCII hostname.</p>
<p>This function is equivalent to calling <a href="qurl.html#toAce">QUrl::toAce</a>() on the return value of <a href="qurl.html#host">host</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setEncodedHost">setEncodedHost</a>().</p>
<!-- @@@encodedHost -->
<!-- $$$encodedPassword[overload1]$$$encodedPassword -->
<h3 class="fn"><a name="encodedPassword"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">encodedPassword</span> () const</h3>
<p>Returns the password of the URL if it is defined; otherwise an empty string is returned. The returned value will have its non-ASCII and other control characters percent-encoded, as in <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setEncodedPassword">setEncodedPassword</a>() and <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<!-- @@@encodedPassword -->
<!-- $$$encodedPath[overload1]$$$encodedPath -->
<h3 class="fn"><a name="encodedPath"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">encodedPath</span> () const</h3>
<p>Returns the path of the URL if it is defined; otherwise an empty string is returned. The returned value will have its non-ASCII and other control characters percent-encoded, as in <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setEncodedPath">setEncodedPath</a>() and <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<!-- @@@encodedPath -->
<!-- $$$encodedQuery[overload1]$$$encodedQuery -->
<h3 class="fn"><a name="encodedQuery"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">encodedQuery</span> () const</h3>
<p>Returns the query string of the URL in percent encoded form.</p>
<p><b>See also </b><a href="qurl.html#setEncodedQuery">setEncodedQuery</a>().</p>
<!-- @@@encodedQuery -->
<!-- $$$encodedQueryItemValue[overload1]$$$encodedQueryItemValueconstQByteArray& -->
<h3 class="fn"><a name="encodedQueryItemValue"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">encodedQueryItemValue</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>key</i> ) const</h3>
<p>Returns the first query string value whose key is equal to <i>key</i> from the URL.</p>
<p>Note: if the encoded <i>key</i> does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is &quot;search=Qt%20Rules&quot;, calling this function with <i>key</i> = &quot;%73earch&quot; will return an empty string.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#queryItemValue">queryItemValue</a>() and <a href="qurl.html#allQueryItemValues">allQueryItemValues</a>().</p>
<!-- @@@encodedQueryItemValue -->
<!-- $$$encodedQueryItems[overload1]$$$encodedQueryItems -->
<h3 class="fn"><a name="encodedQueryItems"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qpair.html">QPair</a></span>&lt;<span class="type"><a href="qbytearray.html">QByteArray</a></span>, <span class="type"><a href="qbytearray.html">QByteArray</a></span>&gt; &gt; QUrl::<span class="name">encodedQueryItems</span> () const</h3>
<p>Returns the query string of the URL, as a map of encoded keys and values.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setEncodedQueryItems">setEncodedQueryItems</a>(), <a href="qurl.html#setQueryItems">setQueryItems</a>(), and <a href="qurl.html#setEncodedQuery">setEncodedQuery</a>().</p>
<!-- @@@encodedQueryItems -->
<!-- $$$encodedUserName[overload1]$$$encodedUserName -->
<h3 class="fn"><a name="encodedUserName"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">encodedUserName</span> () const</h3>
<p>Returns the user name of the URL if it is defined; otherwise an empty string is returned. The returned value will have its non-ASCII and other control characters percent-encoded, as in <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setEncodedUserName">setEncodedUserName</a>().</p>
<!-- @@@encodedUserName -->
<!-- $$$errorString[overload1]$$$errorString -->
<h3 class="fn"><a name="errorString"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">errorString</span> () const</h3>
<p>Returns a text string that explains why an URL is invalid in the case being; otherwise returns an empty string.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@errorString -->
<!-- $$$fragment[overload1]$$$fragment -->
<h3 class="fn"><a name="fragment"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">fragment</span> () const</h3>
<p>Returns the fragment of the URL.</p>
<p><b>See also </b><a href="qurl.html#setFragment">setFragment</a>().</p>
<!-- @@@fragment -->
<!-- $$$fromAce[overload1]$$$fromAceconstQByteArray& -->
<h3 class="fn"><a name="fromAce"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">fromAce</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>domain</i> )<tt> [static]</tt></h3>
<p>Returns the Unicode form of the given domain name <i>domain</i>, which is encoded in the ASCII Compatible Encoding (ACE). The result of this function is considered equivalent to <i>domain</i>.</p>
<p>If the value in <i>domain</i> cannot be encoded, it will be converted to <a href="qstring.html">QString</a> and returned.</p>
<p>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 <tt>&quot;example.com&quot;</tt>) to be written using international characters.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@fromAce -->
<!-- $$$fromEncoded[overload1]$$$fromEncodedconstQByteArray& -->
<h3 class="fn"><a name="fromEncoded"></a><span class="type">QUrl</span> QUrl::<span class="name">fromEncoded</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>input</i> )<tt> [static]</tt></h3>
<p>Parses <i>input</i> and returns the corresponding <a href="qurl.html">QUrl</a>. <i>input</i> is assumed to be in encoded form, containing only ASCII characters.</p>
<p>The URL is parsed using <a href="qurl.html#ParsingMode-enum">TolerantMode</a>.</p>
<p><b>See also </b><a href="qurl.html#toEncoded">toEncoded</a>() and <a href="qurl.html#setUrl">setUrl</a>().</p>
<!-- @@@fromEncoded -->
<!-- $$$fromEncoded$$$fromEncodedconstQByteArray&ParsingMode -->
<h3 class="fn"><a name="fromEncoded-2"></a><span class="type">QUrl</span> QUrl::<span class="name">fromEncoded</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>input</i>, <span class="type"><a href="qurl.html#ParsingMode-enum">ParsingMode</a></span> <i>parsingMode</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Parses the URL using <i>parsingMode</i>.</p>
<p><b>See also </b><a href="qurl.html#toEncoded">toEncoded</a>() and <a href="qurl.html#setUrl">setUrl</a>().</p>
<!-- @@@fromEncoded -->
<!-- $$$fromLocalFile[overload1]$$$fromLocalFileconstQString& -->
<h3 class="fn"><a name="fromLocalFile"></a><span class="type">QUrl</span> QUrl::<span class="name">fromLocalFile</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>localFile</i> )<tt> [static]</tt></h3>
<p>Returns a <a href="qurl.html">QUrl</a> representation of <i>localFile</i>, interpreted as a local file. This function accepts paths separated by slashes as well as the native separator for this platform.</p>
<p>This function also accepts paths with a doubled leading slash (or backslash) to indicate a remote file, as in &quot;//servername/path/to/file.txt&quot;. Note that only certain platforms can actually open this file using <a href="qfile.html#open">QFile::open</a>().</p>
<p><b>See also </b><a href="qurl.html#toLocalFile">toLocalFile</a>(), <a href="qurl.html#isLocalFile">isLocalFile</a>(), and <a href="qdir.html#toNativeSeparators">QDir::toNativeSeparators</a>().</p>
<!-- @@@fromLocalFile -->
<!-- $$$fromPercentEncoding[overload1]$$$fromPercentEncodingconstQByteArray& -->
<h3 class="fn"><a name="fromPercentEncoding"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">fromPercentEncoding</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>input</i> )<tt> [static]</tt></h3>
<p>Returns a decoded copy of <i>input</i>. <i>input</i> is first decoded from percent encoding, then converted from UTF-8 to unicode.</p>
<!-- @@@fromPercentEncoding -->
<!-- $$$fromUserInput[overload1]$$$fromUserInputconstQString& -->
<h3 class="fn"><a name="fromUserInput"></a><span class="type">QUrl</span> QUrl::<span class="name">fromUserInput</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>userInput</i> )<tt> [static]</tt></h3>
<p>Returns a valid URL from a user supplied <i>userInput</i> string if one can be deducted. In the case that is not possible, an invalid <a href="qurl.html#QUrl">QUrl</a>() is returned.</p>
<p>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.</p>
<p>When the string is not already a valid URL, a best guess is performed, making various web related assumptions.</p>
<p>In the case the string corresponds to a valid file path on the system, a file:// URL is constructed, using <a href="qurl.html#fromLocalFile">QUrl::fromLocalFile</a>().</p>
<p>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 <a href="qurl.html">QUrl</a>'s tolerant parser, and in the case or success, a valid <a href="qurl.html">QUrl</a> is returned, or else a <a href="qurl.html#QUrl">QUrl</a>().</p>
<a name="examples"></a>
<h4>Examples:</h4>
<ul>
<li>qt.nokia.com becomes http://qt.nokia.com</li>
<li>ftp.qt.nokia.com becomes ftp://ftp.qt.nokia.com</li>
<li>hostname becomes http://hostname</li>
<li>/home/user/test.html becomes file:///home/user/test.html</li>
</ul>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@fromUserInput -->
<!-- $$$hasEncodedQueryItem[overload1]$$$hasEncodedQueryItemconstQByteArray& -->
<h3 class="fn"><a name="hasEncodedQueryItem"></a><span class="type">bool</span> QUrl::<span class="name">hasEncodedQueryItem</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>key</i> ) const</h3>
<p>Returns true if there is a query string pair whose key is equal to <i>key</i> from the URL.</p>
<p>Note: if the encoded <i>key</i> does not match the encoded version of the query, this function will return false. That is, if the encoded query of this URL is &quot;search=Qt%20Rules&quot;, calling this function with <i>key</i> = &quot;%73earch&quot; will return false.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#hasQueryItem">hasQueryItem</a>().</p>
<!-- @@@hasEncodedQueryItem -->
<!-- $$$hasFragment[overload1]$$$hasFragment -->
<h3 class="fn"><a name="hasFragment"></a><span class="type">bool</span> QUrl::<span class="name">hasFragment</span> () const</h3>
<p>Returns true if this URL contains a fragment (i.e&#x2e;, if # was seen on it).</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qurl.html#fragment">fragment</a>() and <a href="qurl.html#setFragment">setFragment</a>().</p>
<!-- @@@hasFragment -->
<!-- $$$hasQuery[overload1]$$$hasQuery -->
<h3 class="fn"><a name="hasQuery"></a><span class="type">bool</span> QUrl::<span class="name">hasQuery</span> () const</h3>
<p>Returns true if this URL contains a Query (i.e&#x2e;, if ? was seen on it).</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qurl.html#hasQueryItem">hasQueryItem</a>() and <a href="qurl.html#encodedQuery">encodedQuery</a>().</p>
<!-- @@@hasQuery -->
<!-- $$$hasQueryItem[overload1]$$$hasQueryItemconstQString& -->
<h3 class="fn"><a name="hasQueryItem"></a><span class="type">bool</span> QUrl::<span class="name">hasQueryItem</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const</h3>
<p>Returns true if there is a query string pair whose key is equal to <i>key</i> from the URL.</p>
<p><b>See also </b><a href="qurl.html#hasEncodedQueryItem">hasEncodedQueryItem</a>().</p>
<!-- @@@hasQueryItem -->
<!-- $$$host[overload1]$$$host -->
<h3 class="fn"><a name="host"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">host</span> () const</h3>
<p>Returns the host of the URL if it is defined; otherwise an empty string is returned.</p>
<p><b>See also </b><a href="qurl.html#setHost">setHost</a>().</p>
<!-- @@@host -->
<!-- $$$idnWhitelist[overload1]$$$idnWhitelist -->
<h3 class="fn"><a name="idnWhitelist"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QUrl::<span class="name">idnWhitelist</span> ()<tt> [static]</tt></h3>
<p>Returns the current whitelist of top-level domains that are allowed to have non-ASCII characters in their compositions.</p>
<p>See <a href="qurl.html#setIdnWhitelist">setIdnWhitelist</a>() for the rationale of this list.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qurl.html#setIdnWhitelist">setIdnWhitelist</a>().</p>
<!-- @@@idnWhitelist -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QUrl::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if the URL has no data; otherwise returns false.</p>
<!-- @@@isEmpty -->
<!-- $$$isLocalFile[overload1]$$$isLocalFile -->
<h3 class="fn"><a name="isLocalFile"></a><span class="type">bool</span> QUrl::<span class="name">isLocalFile</span> () const</h3>
<p>Returns true if this URL is pointing to a local file path. A URL is a local file path if the scheme is &quot;file&quot;.</p>
<p>Note that this function considers URLs with hostnames to be local file paths, even if the eventual file path cannot be opened with <a href="qfile.html#open">QFile::open</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qurl.html#fromLocalFile">fromLocalFile</a>() and <a href="qurl.html#toLocalFile">toLocalFile</a>().</p>
<!-- @@@isLocalFile -->
<!-- $$$isParentOf[overload1]$$$isParentOfconstQUrl& -->
<h3 class="fn"><a name="isParentOf"></a><span class="type">bool</span> QUrl::<span class="name">isParentOf</span> ( const <span class="type">QUrl</span> &amp; <i>childUrl</i> ) const</h3>
<p>Returns true if this URL is a parent of <i>childUrl</i>. <i>childUrl</i> 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 <i>childUrl</i>.</p>
<!-- @@@isParentOf -->
<!-- $$$isRelative[overload1]$$$isRelative -->
<h3 class="fn"><a name="isRelative"></a><span class="type">bool</span> QUrl::<span class="name">isRelative</span> () const</h3>
<p>Returns true if the URL is relative; otherwise returns false. A URL is relative if its scheme is undefined; this function is therefore equivalent to calling <a href="qurl.html#scheme">scheme</a>().<a href="qurl.html#isEmpty">isEmpty</a>().</p>
<!-- @@@isRelative -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QUrl::<span class="name">isValid</span> () const</h3>
<p>Returns true if the URL is valid; otherwise returns false.</p>
<p>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.</p>
<pre class="cpp"> <span class="type">bool</span> checkUrl(<span class="keyword">const</span> <span class="type"><a href="qurl.html">QUrl</a></span> <span class="operator">&amp;</span>url) {
     <span class="keyword">if</span> (<span class="operator">!</span>url<span class="operator">.</span>isValid()) {
         <a href="qtglobal.html#qDebug">qDebug</a>(<span class="type"><a href="qstring.html">QString</a></span>(<span class="string">&quot;Invalid URL: %1&quot;</span>)<span class="operator">.</span>arg(url<span class="operator">.</span>toString()));
         <span class="keyword">return</span> <span class="keyword">false</span>;
     }

     <span class="keyword">return</span> <span class="keyword">true</span>;
 }</pre>
<!-- @@@isValid -->
<!-- $$$password[overload1]$$$password -->
<h3 class="fn"><a name="password"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">password</span> () const</h3>
<p>Returns the password of the URL if it is defined; otherwise an empty string is returned.</p>
<p><b>See also </b><a href="qurl.html#setPassword">setPassword</a>().</p>
<!-- @@@password -->
<!-- $$$path[overload1]$$$path -->
<h3 class="fn"><a name="pathx"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">path</span> () const</h3>
<p>Returns the path of the URL.</p>
<p><b>See also </b><a href="qurl.html#setPath">setPath</a>().</p>
<!-- @@@path -->
<!-- $$$port[overload1]$$$port -->
<h3 class="fn"><a name="port"></a><span class="type">int</span> QUrl::<span class="name">port</span> () const</h3>
<p>Returns the port of the URL, or -1 if the port is unspecified.</p>
<p><b>See also </b><a href="qurl.html#setPort">setPort</a>().</p>
<!-- @@@port -->
<!-- $$$port$$$portint -->
<h3 class="fn"><a name="port-2"></a><span class="type">int</span> QUrl::<span class="name">port</span> ( <span class="type">int</span> <i>defaultPort</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the port of the URL, or <i>defaultPort</i> if the port is unspecified.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qftp.html">QFtp</a></span> ftp;
 ftp<span class="operator">.</span>connectToHost(url<span class="operator">.</span>host()<span class="operator">,</span> url<span class="operator">.</span>port(<span class="number">21</span>));</pre>
<p>This function was introduced in Qt 4.1.</p>
<!-- @@@port -->
<!-- $$$queryItemValue[overload1]$$$queryItemValueconstQString& -->
<h3 class="fn"><a name="queryItemValue"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">queryItemValue</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> ) const</h3>
<p>Returns the first query string value whose key is equal to <i>key</i> from the URL.</p>
<p><b>Note:</b> This method does not decode spaces plus (+) signs as spaces (ASCII 0x20), like HTML forms do. If you need that kind of decoding, you must use QUrl::encodedQueryItemValue and decode the data yourself.</p>
<p><b>See also </b><a href="qurl.html#allQueryItemValues">allQueryItemValues</a>().</p>
<!-- @@@queryItemValue -->
<!-- $$$queryItems[overload1]$$$queryItems -->
<h3 class="fn"><a name="queryItems"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qpair.html">QPair</a></span>&lt;<span class="type"><a href="qstring.html">QString</a></span>, <span class="type"><a href="qstring.html">QString</a></span>&gt; &gt; QUrl::<span class="name">queryItems</span> () const</h3>
<p>Returns the query string of the URL, as a map of keys and values.</p>
<p><b>Note:</b> This method does not decode spaces plus (+) signs as spaces (ASCII 0x20), like HTML forms do. If you need that kind of decoding, you must use QUrl::encodedQueryItems and decode the data yourself.</p>
<p><b>See also </b><a href="qurl.html#setQueryItems">setQueryItems</a>() and <a href="qurl.html#setEncodedQuery">setEncodedQuery</a>().</p>
<!-- @@@queryItems -->
<!-- $$$queryPairDelimiter[overload1]$$$queryPairDelimiter -->
<h3 class="fn"><a name="queryPairDelimiter"></a><span class="type">char</span> QUrl::<span class="name">queryPairDelimiter</span> () const</h3>
<p>Returns the character used to delimit between key-value pairs in the query string of the URL.</p>
<!-- @@@queryPairDelimiter -->
<!-- $$$queryValueDelimiter[overload1]$$$queryValueDelimiter -->
<h3 class="fn"><a name="queryValueDelimiter"></a><span class="type">char</span> QUrl::<span class="name">queryValueDelimiter</span> () const</h3>
<p>Returns the character used to delimit between keys and values in the query string of the URL.</p>
<!-- @@@queryValueDelimiter -->
<!-- $$$removeAllEncodedQueryItems[overload1]$$$removeAllEncodedQueryItemsconstQByteArray& -->
<h3 class="fn"><a name="removeAllEncodedQueryItems"></a><span class="type">void</span> QUrl::<span class="name">removeAllEncodedQueryItems</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>key</i> )</h3>
<p>Removes all the query string pairs whose key is equal to <i>key</i> from the URL.</p>
<p>Note: if the encoded <i>key</i> does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is &quot;search=Qt%20Rules&quot;, calling this function with <i>key</i> = &quot;%73earch&quot; will do nothing.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#removeQueryItem">removeQueryItem</a>().</p>
<!-- @@@removeAllEncodedQueryItems -->
<!-- $$$removeAllQueryItems[overload1]$$$removeAllQueryItemsconstQString& -->
<h3 class="fn"><a name="removeAllQueryItems"></a><span class="type">void</span> QUrl::<span class="name">removeAllQueryItems</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> )</h3>
<p>Removes all the query string pairs whose key is equal to <i>key</i> from the URL.</p>
<p><b>See also </b><a href="qurl.html#removeQueryItem">removeQueryItem</a>().</p>
<!-- @@@removeAllQueryItems -->
<!-- $$$removeEncodedQueryItem[overload1]$$$removeEncodedQueryItemconstQByteArray& -->
<h3 class="fn"><a name="removeEncodedQueryItem"></a><span class="type">void</span> QUrl::<span class="name">removeEncodedQueryItem</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>key</i> )</h3>
<p>Removes the first query string pair whose key is equal to <i>key</i> from the URL.</p>
<p>Note: if the encoded <i>key</i> does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is &quot;search=Qt%20Rules&quot;, calling this function with <i>key</i> = &quot;%73earch&quot; will do nothing.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#removeQueryItem">removeQueryItem</a>() and <a href="qurl.html#removeAllQueryItems">removeAllQueryItems</a>().</p>
<!-- @@@removeEncodedQueryItem -->
<!-- $$$removeQueryItem[overload1]$$$removeQueryItemconstQString& -->
<h3 class="fn"><a name="removeQueryItem"></a><span class="type">void</span> QUrl::<span class="name">removeQueryItem</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>key</i> )</h3>
<p>Removes the first query string pair whose key is equal to <i>key</i> from the URL.</p>
<p><b>See also </b><a href="qurl.html#removeAllQueryItems">removeAllQueryItems</a>().</p>
<!-- @@@removeQueryItem -->
<!-- $$$resolved[overload1]$$$resolvedconstQUrl& -->
<h3 class="fn"><a name="resolved"></a><span class="type">QUrl</span> QUrl::<span class="name">resolved</span> ( const <span class="type">QUrl</span> &amp; <i>relative</i> ) const</h3>
<p>Returns the result of the merge of this URL with <i>relative</i>. This URL is used as a base to convert <i>relative</i> to an absolute URL.</p>
<p>If <i>relative</i> is not a relative URL, this function will return <i>relative</i> 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:</p>
<pre class="cpp"> <span class="type"><a href="qurl.html">QUrl</a></span> baseUrl(<span class="string">&quot;http://qt.nokia.com/support&quot;</span>);
 <span class="type"><a href="qurl.html">QUrl</a></span> relativeUrl(<span class="string">&quot;../products/solutions&quot;</span>);
 <a href="qtglobal.html#qDebug">qDebug</a>(baseUrl<span class="operator">.</span>resolved(relativeUrl)<span class="operator">.</span>toString());
 <span class="comment">// prints &quot;http://qt.nokia.com/products/solutions&quot;</span></pre>
<p>Calling resolved() with &quot;..&quot; returns a <a href="qurl.html">QUrl</a> whose directory is one level higher than the original. Similarly, calling resolved() with &quot;../&#x2e;.&quot; removes two levels from the path. If <i>relative</i> is &quot;/&quot;, the path becomes &quot;/&quot;.</p>
<p><b>See also </b><a href="qurl.html#isRelative">isRelative</a>().</p>
<!-- @@@resolved -->
<!-- $$$scheme[overload1]$$$scheme -->
<h3 class="fn"><a name="scheme"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">scheme</span> () const</h3>
<p>Returns the scheme of the URL. If an empty string is returned, this means the scheme is undefined and the URL is then relative.</p>
<p><b>See also </b><a href="qurl.html#setScheme">setScheme</a>() and <a href="qurl.html#isRelative">isRelative</a>().</p>
<!-- @@@scheme -->
<!-- $$$setAuthority[overload1]$$$setAuthorityconstQString& -->
<h3 class="fn"><a name="setAuthority"></a><span class="type">void</span> QUrl::<span class="name">setAuthority</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>authority</i> )</h3>
<p>Sets the authority of the URL to <i>authority</i>.</p>
<p>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.</p>
<p>The user info and host are separated by a '<a href="index.html">@</a>', and the host and port are separated by a ':'. If the user info is empty, the '<a href="index.html">@</a>' must be omitted; although a stray ':' is permitted if the port is empty.</p>
<p>The following example shows a valid authority string:</p>
<p class="centerAlign"><img src="images/qurl-authority.png" alt="" /></p><p><b>See also </b><a href="qurl.html#authority">authority</a>().</p>
<!-- @@@setAuthority -->
<!-- $$$setEncodedFragment[overload1]$$$setEncodedFragmentconstQByteArray& -->
<h3 class="fn"><a name="setEncodedFragment"></a><span class="type">void</span> QUrl::<span class="name">setEncodedFragment</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>fragment</i> )</h3>
<p>Sets the URL's fragment to the percent-encoded <i>fragment</i>. 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:</p>
<p class="centerAlign"><img src="images/qurl-fragment.png" alt="" /></p><p>The fragment is sometimes also referred to as the URL &quot;reference&quot;.</p>
<p>Passing an argument of QByteArray() (a null <a href="qbytearray.html">QByteArray</a>) will unset the fragment. Passing an argument of <a href="qbytearray.html">QByteArray</a>(&quot;&quot;) (an empty but not null <a href="qbytearray.html">QByteArray</a>) will set the fragment to an empty string (as if the original URL had a lone &quot;#&quot;).</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setFragment">setFragment</a>() and <a href="qurl.html#encodedFragment">encodedFragment</a>().</p>
<!-- @@@setEncodedFragment -->
<!-- $$$setEncodedHost[overload1]$$$setEncodedHostconstQByteArray& -->
<h3 class="fn"><a name="setEncodedHost"></a><span class="type">void</span> QUrl::<span class="name">setEncodedHost</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>host</i> )</h3>
<p>Sets the URL's host to the ACE- or percent-encoded <i>host</i>. The <i>host</i> is part of the user info element in the authority of the URL, as described in <a href="qurl.html#setAuthority">setAuthority</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setHost">setHost</a>(), <a href="qurl.html#encodedHost">encodedHost</a>(), <a href="qurl.html#setAuthority">setAuthority</a>(), and <a href="qurl.html#fromAce">fromAce</a>().</p>
<!-- @@@setEncodedHost -->
<!-- $$$setEncodedPassword[overload1]$$$setEncodedPasswordconstQByteArray& -->
<h3 class="fn"><a name="setEncodedPassword"></a><span class="type">void</span> QUrl::<span class="name">setEncodedPassword</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>password</i> )</h3>
<p>Sets the URL's password to the percent-encoded <i>password</i>. The <i>password</i> is part of the user info element in the authority of the URL, as described in <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<p>Note: this function does not verify that <i>password</i> is properly encoded. It is the caller's responsibility to ensure that the any delimiters (such as colons or slashes) are properly encoded.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setPassword">setPassword</a>(), <a href="qurl.html#encodedPassword">encodedPassword</a>(), and <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<!-- @@@setEncodedPassword -->
<!-- $$$setEncodedPath[overload1]$$$setEncodedPathconstQByteArray& -->
<h3 class="fn"><a name="setEncodedPath"></a><span class="type">void</span> QUrl::<span class="name">setEncodedPath</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>path</i> )</h3>
<p>Sets the URL's path to the percent-encoded <i>path</i>. The path is the part of the URL that comes after the authority but before the query string.</p>
<p class="centerAlign"><img src="images/qurl-ftppath.png" alt="" /></p><p>For non-hierarchical schemes, the path will be everything following the scheme declaration, as in the following example:</p>
<p class="centerAlign"><img src="images/qurl-mailtopath.png" alt="" /></p><p>Note: this function does not verify that <i>path</i> is properly encoded. It is the caller's responsibility to ensure that the any delimiters (such as '?' and '#') are properly encoded.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setPath">setPath</a>(), <a href="qurl.html#encodedPath">encodedPath</a>(), and <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<!-- @@@setEncodedPath -->
<!-- $$$setEncodedQuery[overload1]$$$setEncodedQueryconstQByteArray& -->
<h3 class="fn"><a name="setEncodedQuery"></a><span class="type">void</span> QUrl::<span class="name">setEncodedQuery</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>query</i> )</h3>
<p>Sets the query string of the URL to <i>query</i>. The string is inserted as-is, and no further encoding is performed when calling <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<p>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 <a href="qurl.html">QUrl</a>.</p>
<p>Passing a value of QByteArray() to <i>query</i> (a null <a href="qbytearray.html">QByteArray</a>) unsets the query completely. However, passing a value of <a href="qbytearray.html">QByteArray</a>(&quot;&quot;) will set the query to an empty value, as if the original URL had a lone &quot;?&quot;.</p>
<p><b>See also </b><a href="qurl.html#encodedQuery">encodedQuery</a>() and <a href="qurl.html#hasQuery">hasQuery</a>().</p>
<!-- @@@setEncodedQuery -->
<!-- $$$setEncodedQueryItems[overload1]$$$setEncodedQueryItemsconstQList<QPair<QByteArray,QByteArray>>& -->
<h3 class="fn"><a name="setEncodedQueryItems"></a><span class="type">void</span> QUrl::<span class="name">setEncodedQueryItems</span> ( const <span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qpair.html">QPair</a></span>&lt;<span class="type"><a href="qbytearray.html">QByteArray</a></span>, <span class="type"><a href="qbytearray.html">QByteArray</a></span>&gt; &gt; &amp; <i>query</i> )</h3>
<p>Sets the query string of the URL to the encoded version of <i>query</i>. The contents of <i>query</i> are converted to a string internally, each pair delimited by the character returned by pairDelimiter(), and the key and value are delimited by valueDelimiter().</p>
<p>Note: this function does not verify that the key-value pairs are properly encoded. It is the caller's responsibility to ensure that the query delimiters are properly encoded, if any.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setQueryDelimiters">setQueryDelimiters</a>(), <a href="qurl.html#encodedQueryItems">encodedQueryItems</a>(), and <a href="qurl.html#setQueryItems">setQueryItems</a>().</p>
<!-- @@@setEncodedQueryItems -->
<!-- $$$setEncodedUrl[overload1]$$$setEncodedUrlconstQByteArray& -->
<h3 class="fn"><a name="setEncodedUrl"></a><span class="type">void</span> QUrl::<span class="name">setEncodedUrl</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>encodedUrl</i> )</h3>
<p>Constructs a URL by parsing the contents of <i>encodedUrl</i>.</p>
<p><i>encodedUrl</i> is assumed to be a URL string in percent encoded form, containing only ASCII characters.</p>
<p>Use <a href="qurl.html#isValid">isValid</a>() to determine if a valid URL was constructed.</p>
<p><b>See also </b><a href="qurl.html#setUrl">setUrl</a>().</p>
<!-- @@@setEncodedUrl -->
<!-- $$$setEncodedUrl$$$setEncodedUrlconstQByteArray&ParsingMode -->
<h3 class="fn"><a name="setEncodedUrl-2"></a><span class="type">void</span> QUrl::<span class="name">setEncodedUrl</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>encodedUrl</i>, <span class="type"><a href="qurl.html#ParsingMode-enum">ParsingMode</a></span> <i>parsingMode</i> )</h3>
<p>Constructs a URL by parsing the contents of <i>encodedUrl</i> using the given <i>parsingMode</i>.</p>
<!-- @@@setEncodedUrl -->
<!-- $$$setEncodedUserName[overload1]$$$setEncodedUserNameconstQByteArray& -->
<h3 class="fn"><a name="setEncodedUserName"></a><span class="type">void</span> QUrl::<span class="name">setEncodedUserName</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>userName</i> )</h3>
<p>Sets the URL's user name to the percent-encoded <i>userName</i>. The <i>userName</i> is part of the user info element in the authority of the URL, as described in <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<p>Note: this function does not verify that <i>userName</i> is properly encoded. It is the caller's responsibility to ensure that the any delimiters (such as colons or slashes) are properly encoded.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qurl.html#setUserName">setUserName</a>(), <a href="qurl.html#encodedUserName">encodedUserName</a>(), and <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<!-- @@@setEncodedUserName -->
<!-- $$$setFragment[overload1]$$$setFragmentconstQString& -->
<h3 class="fn"><a name="setFragment"></a><span class="type">void</span> QUrl::<span class="name">setFragment</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fragment</i> )</h3>
<p>Sets the fragment of the URL to <i>fragment</i>. 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:</p>
<p class="centerAlign"><img src="images/qurl-fragment.png" alt="" /></p><p>The fragment is sometimes also referred to as the URL &quot;reference&quot;.</p>
<p>Passing an argument of QString() (a null <a href="qstring.html">QString</a>) will unset the fragment. Passing an argument of <a href="qstring.html">QString</a>(&quot;&quot;) (an empty but not null <a href="qstring.html">QString</a>) will set the fragment to an empty string (as if the original URL had a lone &quot;#&quot;).</p>
<p><b>See also </b><a href="qurl.html#fragment">fragment</a>() and <a href="qurl.html#hasFragment">hasFragment</a>().</p>
<!-- @@@setFragment -->
<!-- $$$setHost[overload1]$$$setHostconstQString& -->
<h3 class="fn"><a name="setHost"></a><span class="type">void</span> QUrl::<span class="name">setHost</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>host</i> )</h3>
<p>Sets the host of the URL to <i>host</i>. The host is part of the authority.</p>
<p><b>See also </b><a href="qurl.html#host">host</a>() and <a href="qurl.html#setAuthority">setAuthority</a>().</p>
<!-- @@@setHost -->
<!-- $$$setIdnWhitelist[overload1]$$$setIdnWhitelistconstQStringList& -->
<h3 class="fn"><a name="setIdnWhitelist"></a><span class="type">void</span> QUrl::<span class="name">setIdnWhitelist</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>list</i> )<tt> [static]</tt></h3>
<p>Sets the whitelist of Top-Level Domains (TLDs) that are allowed to have non-ASCII characters in domains to the value of <i>list</i>.</p>
<p>Note that if you call this function, you need to do so <b class="redFont"><code>\em</code></b> before you start any threads that might access <a href="qurl.html#idnWhitelist">idnWhitelist</a>().</p>
<p>Qt has comes 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 <tt>'a'</tt> and the Cyrillic equivalent, which in most fonts are visually identical).</p>
<p>This list is periodically maintained, as registrars publish new rules.</p>
<p>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.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qurl.html#idnWhitelist">idnWhitelist</a>().</p>
<!-- @@@setIdnWhitelist -->
<!-- $$$setPassword[overload1]$$$setPasswordconstQString& -->
<h3 class="fn"><a name="setPassword"></a><span class="type">void</span> QUrl::<span class="name">setPassword</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>password</i> )</h3>
<p>Sets the URL's password to <i>password</i>. The <i>password</i> is part of the user info element in the authority of the URL, as described in <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<p><b>See also </b><a href="qurl.html#password">password</a>() and <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<!-- @@@setPassword -->
<!-- $$$setPath[overload1]$$$setPathconstQString& -->
<h3 class="fn"><a name="setPath"></a><span class="type">void</span> QUrl::<span class="name">setPath</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>path</i> )</h3>
<p>Sets the path of the URL to <i>path</i>. The path is the part of the URL that comes after the authority but before the query string.</p>
<p class="centerAlign"><img src="images/qurl-ftppath.png" alt="" /></p><p>For non-hierarchical schemes, the path will be everything following the scheme declaration, as in the following example:</p>
<p class="centerAlign"><img src="images/qurl-mailtopath.png" alt="" /></p><p><b>See also </b><a href="qurl.html#pathx">path</a>().</p>
<!-- @@@setPath -->
<!-- $$$setPort[overload1]$$$setPortint -->
<h3 class="fn"><a name="setPort"></a><span class="type">void</span> QUrl::<span class="name">setPort</span> ( <span class="type">int</span> <i>port</i> )</h3>
<p>Sets the port of the URL to <i>port</i>. The port is part of the authority of the URL, as described in <a href="qurl.html#setAuthority">setAuthority</a>().</p>
<p><i>port</i> must be between 0 and 65535 inclusive. Setting the port to -1 indicates that the port is unspecified.</p>
<p><b>See also </b><a href="qurl.html#port">port</a>().</p>
<!-- @@@setPort -->
<!-- $$$setQueryDelimiters[overload1]$$$setQueryDelimiterscharchar -->
<h3 class="fn"><a name="setQueryDelimiters"></a><span class="type">void</span> QUrl::<span class="name">setQueryDelimiters</span> ( <span class="type">char</span> <i>valueDelimiter</i>, <span class="type">char</span> <i>pairDelimiter</i> )</h3>
<p>Sets the characters used for delimiting between keys and values, and between key-value pairs in the URL's query string. The default value delimiter is '=' and the default pair delimiter is '&amp;'.</p>
<p class="centerAlign"><img src="images/qurl-querystring.png" alt="" /></p><p><i>valueDelimiter</i> will be used for separating keys from values, and <i>pairDelimiter</i> will be used to separate key-value pairs. Any occurrences of these delimiting characters in the encoded representation of the keys and values of the query string are percent encoded.</p>
<p>If <i>valueDelimiter</i> is set to '-' and <i>pairDelimiter</i> is '/', the above query string would instead be represented like this:</p>
<pre class="cpp"> http:<span class="comment">//www.example.com/cgi-bin/drawgraph.cgi?type-pie/color-green</span></pre>
<p>Calling this function does not change the delimiters of the current query string. It only affects <a href="qurl.html#queryItems">queryItems</a>(), <a href="qurl.html#setQueryItems">setQueryItems</a>() and addQueryItems().</p>
<!-- @@@setQueryDelimiters -->
<!-- $$$setQueryItems[overload1]$$$setQueryItemsconstQList<QPair<QString,QString>>& -->
<h3 class="fn"><a name="setQueryItems"></a><span class="type">void</span> QUrl::<span class="name">setQueryItems</span> ( const <span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qpair.html">QPair</a></span>&lt;<span class="type"><a href="qstring.html">QString</a></span>, <span class="type"><a href="qstring.html">QString</a></span>&gt; &gt; &amp; <i>query</i> )</h3>
<p>Sets the query string of the URL to an encoded version of <i>query</i>. The contents of <i>query</i> are converted to a string internally, each pair delimited by the character returned by pairDelimiter(), and the key and value are delimited by valueDelimiter().</p>
<p><b>Note:</b> This method does not encode spaces (ASCII 0x20) as plus (+) signs, like HTML forms do. If you need that kind of encoding, you must encode the value yourself and use QUrl::setEncodedQueryItems.</p>
<p><b>See also </b><a href="qurl.html#setQueryDelimiters">setQueryDelimiters</a>(), <a href="qurl.html#queryItems">queryItems</a>(), and <a href="qurl.html#setEncodedQueryItems">setEncodedQueryItems</a>().</p>
<!-- @@@setQueryItems -->
<!-- $$$setScheme[overload1]$$$setSchemeconstQString& -->
<h3 class="fn"><a name="setScheme"></a><span class="type">void</span> QUrl::<span class="name">setScheme</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>scheme</i> )</h3>
<p>Sets the scheme of the URL to <i>scheme</i>. As a scheme can only contain ASCII characters, no conversion or encoding is done on the input.</p>
<p>The scheme describes the type (or protocol) of the URL. It's represented by one or more ASCII characters at the start the URL, and is followed by a ':'. The following example shows a URL where the scheme is &quot;ftp&quot;:</p>
<p class="centerAlign"><img src="images/qurl-authority2.png" alt="" /></p><p>The scheme can also be empty, in which case the URL is interpreted as relative.</p>
<p><b>See also </b><a href="qurl.html#scheme">scheme</a>() and <a href="qurl.html#isRelative">isRelative</a>().</p>
<!-- @@@setScheme -->
<!-- $$$setUrl[overload1]$$$setUrlconstQString& -->
<h3 class="fn"><a name="setUrl"></a><span class="type">void</span> QUrl::<span class="name">setUrl</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>url</i> )</h3>
<p>Constructs a URL by parsing the contents of <i>url</i>.</p>
<p><i>url</i> is assumed to be in unicode format, with no percent encoding.</p>
<p>Calling <a href="qurl.html#isValid">isValid</a>() will tell whether or not a valid URL was constructed.</p>
<p><b>See also </b><a href="qurl.html#setEncodedUrl">setEncodedUrl</a>().</p>
<!-- @@@setUrl -->
<!-- $$$setUrl$$$setUrlconstQString&ParsingMode -->
<h3 class="fn"><a name="setUrl-2"></a><span class="type">void</span> QUrl::<span class="name">setUrl</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>url</i>, <span class="type"><a href="qurl.html#ParsingMode-enum">ParsingMode</a></span> <i>parsingMode</i> )</h3>
<p>This is an overloaded function.</p>
<p>Parses <i>url</i> using the parsing mode <i>parsingMode</i>.</p>
<p><b>See also </b><a href="qurl.html#setEncodedUrl">setEncodedUrl</a>().</p>
<!-- @@@setUrl -->
<!-- $$$setUserInfo[overload1]$$$setUserInfoconstQString& -->
<h3 class="fn"><a name="setUserInfo"></a><span class="type">void</span> QUrl::<span class="name">setUserInfo</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>userInfo</i> )</h3>
<p>Sets the user info of the URL to <i>userInfo</i>. The user info is an optional part of the authority of the URL, as described in <a href="qurl.html#setAuthority">setAuthority</a>().</p>
<p>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:</p>
<p class="centerAlign"><img src="images/qurl-authority3.png" alt="" /></p><p><b>See also </b><a href="qurl.html#userInfo">userInfo</a>(), <a href="qurl.html#setUserName">setUserName</a>(), <a href="qurl.html#setPassword">setPassword</a>(), and <a href="qurl.html#setAuthority">setAuthority</a>().</p>
<!-- @@@setUserInfo -->
<!-- $$$setUserName[overload1]$$$setUserNameconstQString& -->
<h3 class="fn"><a name="setUserName"></a><span class="type">void</span> QUrl::<span class="name">setUserName</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>userName</i> )</h3>
<p>Sets the URL's user name to <i>userName</i>. The <i>userName</i> is part of the user info element in the authority of the URL, as described in <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<p><b>See also </b><a href="qurl.html#setEncodedUserName">setEncodedUserName</a>(), <a href="qurl.html#userName">userName</a>(), and <a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<!-- @@@setUserName -->
<!-- $$$swap[overload1]$$$swapQUrl& -->
<h3 class="fn"><a name="swap"></a><span class="type">void</span> QUrl::<span class="name">swap</span> ( <span class="type">QUrl</span> &amp; <i>other</i> )</h3>
<p>Swaps URL <i>other</i> with this URL. This operation is very fast and never fails.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@swap -->
<!-- $$$toAce[overload1]$$$toAceconstQString& -->
<h3 class="fn"><a name="toAce"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">toAce</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>domain</i> )<tt> [static]</tt></h3>
<p>Returns the ASCII Compatible Encoding of the given domain name <i>domain</i>. The result of this function is considered equivalent to <i>domain</i>.</p>
<p>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 <tt>&quot;example.com&quot;</tt>) to be written using international characters.</p>
<p>This function return an empty QByteArra if <i>domain</i> is not a valid hostname. Note, in particular, that IPv6 literals are not valid domain names.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@toAce -->
<!-- $$$toEncoded[overload1]$$$toEncodedFormattingOptions -->
<h3 class="fn"><a name="toEncoded"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">toEncoded</span> ( <span class="type"><a href="qurl.html#FormattingOption-enum">FormattingOptions</a></span> <i>options</i> = None ) const</h3>
<p>Returns the encoded representation of the URL if it's valid; otherwise an empty <a href="qbytearray.html">QByteArray</a> is returned. The output can be customized by passing flags with <i>options</i>.</p>
<p>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.</p>
<!-- @@@toEncoded -->
<!-- $$$toLocalFile[overload1]$$$toLocalFile -->
<h3 class="fn"><a name="toLocalFile"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">toLocalFile</span> () const</h3>
<p>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.</p>
<p>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, &quot;//servername/path/to/file.txt&quot;).</p>
<p>If this is a relative URL, in Qt 4.x this function returns the path to maintain backward compatability. This will change from 5.0 onwards. Then the path is returned only for URLs where the scheme is &quot;file&quot;, and for all other URLs an empty string is returned.</p>
<p><b>See also </b><a href="qurl.html#fromLocalFile">fromLocalFile</a>() and <a href="qurl.html#isLocalFile">isLocalFile</a>().</p>
<!-- @@@toLocalFile -->
<!-- $$$toPercentEncoding[overload1]$$$toPercentEncodingconstQString&constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="toPercentEncoding"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QUrl::<span class="name">toPercentEncoding</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>input</i>, const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>exclude</i> = QByteArray(), const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>include</i> = QByteArray() )<tt> [static]</tt></h3>
<p>Returns an encoded copy of <i>input</i>. <i>input</i> 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 <i>exclude</i>. To force characters to be percent encoded pass them to <i>include</i>.</p>
<p>Unreserved is defined as: ALPHA / DIGIT / &quot;-&quot; / &quot;.&quot; / &quot;<a href="index.html">_</a>&quot; / &quot;~&quot;</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba <span class="operator">=</span> <span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">::</span>toPercentEncoding(<span class="string">&quot;{a fishy string?}&quot;</span><span class="operator">,</span> <span class="string">&quot;{}&quot;</span><span class="operator">,</span> <span class="string">&quot;s&quot;</span>);
 <a href="qtglobal.html#qDebug">qDebug</a>(ba<span class="operator">.</span>constData());
 <span class="comment">// prints &quot;{a fi%73hy %73tring%3F}&quot;</span></pre>
<!-- @@@toPercentEncoding -->
<!-- $$$toString[overload1]$$$toStringFormattingOptions -->
<h3 class="fn"><a name="toString"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">toString</span> ( <span class="type"><a href="qurl.html#FormattingOption-enum">FormattingOptions</a></span> <i>options</i> = None ) const</h3>
<p>Returns the human-displayable string representation of the URL. The output can be customized by passing flags with <i>options</i>.</p>
<p><b>See also </b><a href="qurl.html#FormattingOption-enum">FormattingOptions</a> and <a href="qurl.html#toEncoded">toEncoded</a>().</p>
<!-- @@@toString -->
<!-- $$$topLevelDomain[overload1]$$$topLevelDomain -->
<h3 class="fn"><a name="topLevelDomain"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">topLevelDomain</span> () const</h3>
<p>Returns the TLD (Top-Level Domain) of the URL, (e.g&#x2e; &#x2e;co.uk, .net). Note that the return value is prefixed with a '.' unless the URL does not contain a valid TLD, in which case the function returns an empty string.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@topLevelDomain -->
<!-- $$$userInfo[overload1]$$$userInfo -->
<h3 class="fn"><a name="userInfo"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">userInfo</span> () const</h3>
<p>Returns the user info of the URL, or an empty string if the user info is undefined.</p>
<p><b>See also </b><a href="qurl.html#setUserInfo">setUserInfo</a>().</p>
<!-- @@@userInfo -->
<!-- $$$userName[overload1]$$$userName -->
<h3 class="fn"><a name="userName"></a><span class="type"><a href="qstring.html">QString</a></span> QUrl::<span class="name">userName</span> () const</h3>
<p>Returns the user name of the URL if it is defined; otherwise an empty string is returned.</p>
<p><b>See also </b><a href="qurl.html#setUserName">setUserName</a>() and <a href="qurl.html#encodedUserName">encodedUserName</a>().</p>
<!-- @@@userName -->
<!-- $$$operator!=[overload1]$$$operator!=constQUrl& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QUrl::<span class="name">operator!=</span> ( const <span class="type">QUrl</span> &amp; <i>url</i> ) const</h3>
<p>Returns true if this URL and the given <i>url</i> are not equal; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQUrl& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QUrl</span> &amp; QUrl::<span class="name">operator=</span> ( const <span class="type">QUrl</span> &amp; <i>url</i> )</h3>
<p>Assigns the specified <i>url</i> to this object.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQString& -->
<h3 class="fn"><a name="operator-eq-2"></a><span class="type">QUrl</span> &amp; QUrl::<span class="name">operator=</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>url</i> )</h3>
<p>Assigns the specified <i>url</i> to this object.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQUrl& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QUrl::<span class="name">operator==</span> ( const <span class="type">QUrl</span> &amp; <i>url</i> ) const</h3>
<p>Returns true if this URL and the given <i>url</i> are equal; otherwise returns false.</p>
<!-- @@@operator== -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qHash$$$qHashconstQUrl& -->
<h3 class="fn"><a name="qHash-10"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <span class="name">qHash</span> ( const <span class="type">QUrl</span> &amp; <i>url</i> )</h3>
<p>Computes a hash key from the normalized version of <i>url</i>.</p>
<p>This function was introduced in Qt 4.7.</p>
<!-- @@@qHash -->
<!-- $$$operator<<$$$operator<<QDataStream&constQUrl& -->
<h3 class="fn"><a name="operator-lt-lt-32"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>out</i>, const <span class="type">QUrl</span> &amp; <i>url</i> )</h3>
<p>Writes url <i>url</i> to the stream <i>out</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Format of the QDataStream operators</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>$$$operator>>QDataStream&QUrl& -->
<h3 class="fn"><a name="operator-gt-gt-22"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>in</i>, <span class="type">QUrl</span> &amp; <i>url</i> )</h3>
<p>Reads a url into <i>url</i> from the stream <i>in</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Format of the QDataStream operators</a>.</p>
<!-- @@@operator>> -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$QT_NO_URL_CAST_FROM_STRING[overload1]$$$QT_NO_URL_CAST_FROM_STRING -->
<h3 class="fn"><a name="QT_NO_URL_CAST_FROM_STRING"></a><span class="name">QT_NO_URL_CAST_FROM_STRING</span></h3>
<p>Disables automatic conversions from <a href="qstring.html">QString</a> (or char *) to <a href="qurl.html">QUrl</a>.</p>
<p>Compiling your code with this define is useful when you have a lot of code that uses <a href="qstring.html">QString</a> for file names and you wish to convert it to use <a href="qurl.html">QUrl</a> for network transparency. In any code that uses <a href="qurl.html">QUrl</a>, it can help avoid missing <a href="qurl.html#resolved">QUrl::resolved</a>() calls, and other misuses of <a href="qstring.html">QString</a> to <a href="qurl.html">QUrl</a> conversions.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> url = filename; // probably not what you want</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> url <span class="operator">=</span> <span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">::</span>fromLocalFile(filename);
 url <span class="operator">=</span> baseurl<span class="operator">.</span>resolved(<span class="type"><a href="qurl.html">QUrl</a></span>(filename));</pre>
<p><b>See also </b><a href="qstring.html#QT_NO_CAST_FROM_ASCII">QT_NO_CAST_FROM_ASCII</a>.</p>
<!-- @@@QT_NO_URL_CAST_FROM_STRING -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>