Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 7214

qt4-doc-4.8.7-26.2.mga7.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" />
<!-- qxmlstream.cpp -->
  <title>Qt 4.8: QXmlStreamWriter 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>QXmlStreamWriter</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="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QXmlStreamWriter Class Reference</h1>
<!-- $$$QXmlStreamWriter-brief -->
<p>The QXmlStreamWriter class provides an XML writer with a simple streaming API. <a href="#details">More...</a></p>
<!-- @@@QXmlStreamWriter -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QXmlStreamWriter&gt;</span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This class was introduced in Qt 4.3.</p>
<ul>
<li><a href="qxmlstreamwriter-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qxmlstreamwriter.html#autoFormatting-prop">autoFormatting</a></b> : bool</li>
<li class="fn"><b><a href="qxmlstreamwriter.html#autoFormattingIndent-prop">autoFormattingIndent</a></b> : int</li>
</ul>
<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="qxmlstreamwriter.html#QXmlStreamWriter">QXmlStreamWriter</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-2">QXmlStreamWriter</a></b> ( QIODevice * <i>device</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-3">QXmlStreamWriter</a></b> ( QByteArray * <i>array</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-4">QXmlStreamWriter</a></b> ( QString * <i>string</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#dtor.QXmlStreamWriter">~QXmlStreamWriter</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#autoFormatting-prop">autoFormatting</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#autoFormattingIndent-prop">autoFormattingIndent</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCodec * </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#codec">codec</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIODevice * </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#device">device</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#hasError">hasError</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#autoFormatting-prop">setAutoFormatting</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#autoFormattingIndent-prop">setAutoFormattingIndent</a></b> ( int <i>spacesOrTabs</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#setCodec">setCodec</a></b> ( QTextCodec * <i>codec</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#setCodec-2">setCodec</a></b> ( const char * <i>codecName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#setDevice">setDevice</a></b> ( QIODevice * <i>device</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a></b> ( const QString &amp; <i>namespaceUri</i>, const QString &amp; <i>name</i>, const QString &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeAttribute-2">writeAttribute</a></b> ( const QString &amp; <i>qualifiedName</i>, const QString &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeAttribute-3">writeAttribute</a></b> ( const QXmlStreamAttribute &amp; <i>attribute</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a></b> ( const QXmlStreamAttributes &amp; <i>attributes</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeCDATA">writeCDATA</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeComment">writeComment</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeCurrentToken">writeCurrentToken</a></b> ( const QXmlStreamReader &amp; <i>reader</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeDTD">writeDTD</a></b> ( const QString &amp; <i>dtd</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeDefaultNamespace">writeDefaultNamespace</a></b> ( const QString &amp; <i>namespaceUri</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a></b> ( const QString &amp; <i>namespaceUri</i>, const QString &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeEmptyElement-2">writeEmptyElement</a></b> ( const QString &amp; <i>qualifiedName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a></b> ( const QString &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a></b> ( const QString &amp; <i>namespaceUri</i>, const QString &amp; <i>prefix</i> = QString() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeProcessingInstruction">writeProcessingInstruction</a></b> ( const QString &amp; <i>target</i>, const QString &amp; <i>data</i> = QString() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a></b> ( const QString &amp; <i>version</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeStartDocument-2">writeStartDocument</a></b> ( const QString &amp; <i>version</i>, bool <i>standalone</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeStartDocument-3">writeStartDocument</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a></b> ( const QString &amp; <i>namespaceUri</i>, const QString &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeStartElement-2">writeStartElement</a></b> ( const QString &amp; <i>qualifiedName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeTextElement">writeTextElement</a></b> ( const QString &amp; <i>namespaceUri</i>, const QString &amp; <i>name</i>, const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlstreamwriter.html#writeTextElement-2">writeTextElement</a></b> ( const QString &amp; <i>qualifiedName</i>, const QString &amp; <i>text</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QXmlStreamWriter-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QXmlStreamWriter class provides an XML writer with a simple streaming API.</p>
<p>QXmlStreamWriter is the counterpart to <a href="qxmlstreamreader.html">QXmlStreamReader</a> for writing XML. Like its related class, it operates on a <a href="qiodevice.html">QIODevice</a> specified with <a href="qxmlstreamwriter.html#setDevice">setDevice</a>(). The API is simple and straightforward: for every XML token or event you want to write, the writer provides a specialized function.</p>
<p>You start a document with <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>() and end it with <a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>(). This will implicitly close all remaining open tags.</p>
<p>Element tags are opened with <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() followed by <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() or <a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a>(), element content, and then <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>(). A shorter form <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>() can be used to write empty elements, followed by <a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a>().</p>
<p>Element content consists of either characters, entity references or nested elements. It is written with <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>(), which also takes care of escaping all forbidden characters and character sequences, <a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a>(), or subsequent calls to <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>(). A convenience method <a href="qxmlstreamwriter.html#writeTextElement">writeTextElement</a>() can be used for writing terminal elements that contain nothing but text.</p>
<p>The following abridged code snippet shows the basic use of the class to write formatted XML with indentation:</p>
<pre class="cpp">     <span class="type">QXmlStreamWriter</span> stream(<span class="operator">&amp;</span>output);
     stream<span class="operator">.</span>setAutoFormatting(<span class="keyword">true</span>);
     stream<span class="operator">.</span>writeStartDocument();
     ...
     stream<span class="operator">.</span>writeStartElement(<span class="string">&quot;bookmark&quot;</span>);
     stream<span class="operator">.</span>writeAttribute(<span class="string">&quot;href&quot;</span><span class="operator">,</span> <span class="string">&quot;http://qt.nokia.com/&quot;</span>);
     stream<span class="operator">.</span>writeTextElement(<span class="string">&quot;title&quot;</span><span class="operator">,</span> <span class="string">&quot;Qt Home&quot;</span>);
     stream<span class="operator">.</span>writeEndElement(); <span class="comment">// bookmark</span>
     ...
     stream<span class="operator">.</span>writeEndDocument();</pre>
<p>QXmlStreamWriter takes care of prefixing namespaces, all you have to do is specify the <tt>namespaceUri</tt> when writing elements or attributes. If you must conform to certain prefixes, you can force the writer to use them by declaring the namespaces manually with either <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>() or <a href="qxmlstreamwriter.html#writeDefaultNamespace">writeDefaultNamespace</a>(). Alternatively, you can bypass the stream writer's namespace support and use overloaded methods that take a qualified name instead. The namespace <i>http://www.w3.org/XML/1998/namespace</i> is implicit and mapped to the prefix <i>xml</i>.</p>
<p>The stream writer can automatically format the generated XML data by adding line-breaks and indentation to empty sections between elements, making the XML data more readable for humans and easier to work with for most source code management systems. The feature can be turned on with the <a href="qxmlstreamwriter.html#autoFormatting-prop">autoFormatting</a> property, and customized with the <a href="qxmlstreamwriter.html#autoFormattingIndent-prop">autoFormattingIndent</a> property.</p>
<p>Other functions are <a href="qxmlstreamwriter.html#writeCDATA">writeCDATA</a>(), <a href="qxmlstreamwriter.html#writeComment">writeComment</a>(), <a href="qxmlstreamwriter.html#writeProcessingInstruction">writeProcessingInstruction</a>(), and <a href="qxmlstreamwriter.html#writeDTD">writeDTD</a>(). Chaining of XML streams is supported with <a href="qxmlstreamwriter.html#writeCurrentToken">writeCurrentToken</a>().</p>
<p>By default, QXmlStreamWriter encodes XML in UTF-8. Different encodings can be enforced using <a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
<p>If an error occurs while writing to the underlying device, <a href="qxmlstreamwriter.html#hasError">hasError</a>() starts returning true and subsequent writes are ignored.</p>
<p>The <a href="xml-streambookmarks.html">QXmlStream Bookmarks Example</a> illustrates how to use a stream writer to write an XML bookmark file (XBEL) that was previously read in by a <a href="qxmlstreamreader.html">QXmlStreamReader</a>.</p>
</div>
<!-- @@@QXmlStreamWriter -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoFormatting-prop$$$autoFormatting$$$setAutoFormattingbool -->
<h3 class="fn"><a name="autoFormatting-prop"></a><span class="name">autoFormatting</span> : <span class="type">bool</span></h3>
<p>the auto-formatting flag of the stream writer</p>
<p>This property controls whether or not the stream writer automatically formats the generated XML data. If enabled, the writer automatically adds line-breaks and indentation to empty sections between elements (ignorable whitespace). The main purpose of auto-formatting is to split the data into several lines, and to increase readability for a human reader. The indentation depth can be controlled through the <a href="qxmlstreamwriter.html#autoFormattingIndent-prop">autoFormattingIndent</a> property.</p>
<p>By default, auto-formatting is disabled.</p>
<p>This property was introduced in Qt 4.4.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>autoFormatting</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoFormatting</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<!-- @@@autoFormatting -->
<!-- $$$autoFormattingIndent-prop$$$autoFormattingIndent$$$setAutoFormattingIndentint -->
<h3 class="fn"><a name="autoFormattingIndent-prop"></a><span class="name">autoFormattingIndent</span> : <span class="type">int</span></h3>
<p>This property holds the number of spaces or tabs used for indentation when auto-formatting is enabled. Positive numbers indicate spaces, negative numbers tabs.</p>
<p>The default indentation is 4.</p>
<p>This property was introduced in Qt 4.4.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>autoFormattingIndent</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoFormattingIndent</b></span> ( int <i>spacesOrTabs</i> )</td></tr>
</table>
<p><b>See also </b><a href="qxmlstreamwriter.html#autoFormatting-prop">autoFormatting</a>.</p>
<!-- @@@autoFormattingIndent -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QXmlStreamWriter[overload1]$$$QXmlStreamWriter -->
<h3 class="fn"><a name="QXmlStreamWriter"></a>QXmlStreamWriter::<span class="name">QXmlStreamWriter</span> ()</h3>
<p>Constructs a stream writer.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#setDevice">setDevice</a>().</p>
<!-- @@@QXmlStreamWriter -->
<!-- $$$QXmlStreamWriter$$$QXmlStreamWriterQIODevice* -->
<h3 class="fn"><a name="QXmlStreamWriter-2"></a>QXmlStreamWriter::<span class="name">QXmlStreamWriter</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i> )</h3>
<p>Constructs a stream writer that writes into <i>device</i>;</p>
<!-- @@@QXmlStreamWriter -->
<!-- $$$QXmlStreamWriter$$$QXmlStreamWriterQByteArray* -->
<h3 class="fn"><a name="QXmlStreamWriter-3"></a>QXmlStreamWriter::<span class="name">QXmlStreamWriter</span> ( <span class="type"><a href="qbytearray.html">QByteArray</a></span> * <i>array</i> )</h3>
<p>Constructs a stream writer that writes into <i>array</i>. This is the same as creating an xml writer that operates on a <a href="qbuffer.html">QBuffer</a> device which in turn operates on <i>array</i>.</p>
<!-- @@@QXmlStreamWriter -->
<!-- $$$QXmlStreamWriter$$$QXmlStreamWriterQString* -->
<h3 class="fn"><a name="QXmlStreamWriter-4"></a>QXmlStreamWriter::<span class="name">QXmlStreamWriter</span> ( <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i> )</h3>
<p>Constructs a stream writer that writes into <i>string</i>.</p>
<!-- @@@QXmlStreamWriter -->
<!-- $$$~QXmlStreamWriter[overload1]$$$~QXmlStreamWriter -->
<h3 class="fn"><a name="dtor.QXmlStreamWriter"></a>QXmlStreamWriter::<span class="name">~QXmlStreamWriter</span> ()</h3>
<p>Destructor.</p>
<!-- @@@~QXmlStreamWriter -->
<!-- $$$codec[overload1]$$$codec -->
<h3 class="fn"><a name="codec"></a><span class="type"><a href="qtextcodec.html">QTextCodec</a></span> * QXmlStreamWriter::<span class="name">codec</span> () const</h3>
<p>Returns the codec that is currently assigned to the stream.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
<!-- @@@codec -->
<!-- $$$device[overload1]$$$device -->
<h3 class="fn"><a name="device"></a><span class="type"><a href="qiodevice.html">QIODevice</a></span> * QXmlStreamWriter::<span class="name">device</span> () const</h3>
<p>Returns the current device associated with the <a href="qxmlstreamwriter.html">QXmlStreamWriter</a>, or 0 if no device has been assigned.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#setDevice">setDevice</a>().</p>
<!-- @@@device -->
<!-- $$$hasError[overload1]$$$hasError -->
<h3 class="fn"><a name="hasError"></a><span class="type">bool</span> QXmlStreamWriter::<span class="name">hasError</span> () const</h3>
<p>Returns true if the stream failed to write to the underlying device; otherwise returns false.</p>
<p>The error status is never reset. Writes happening after the error occurred are ignored, even if the error condition is cleared.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@hasError -->
<!-- $$$setCodec[overload1]$$$setCodecQTextCodec* -->
<h3 class="fn"><a name="setCodec"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">setCodec</span> ( <span class="type"><a href="qtextcodec.html">QTextCodec</a></span> * <i>codec</i> )</h3>
<p>Sets the codec for this stream to <i>codec</i>. The codec is used for encoding any data that is written. By default, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> uses UTF-8.</p>
<p>The encoding information is stored in the initial xml tag which gets written when you call <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>(). Call this function before calling <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>().</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#codec">codec</a>().</p>
<!-- @@@setCodec -->
<!-- $$$setCodec$$$setCodecconstchar* -->
<h3 class="fn"><a name="setCodec-2"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">setCodec</span> ( const <span class="type">char</span> * <i>codecName</i> )</h3>
<p>Sets the codec for this stream to the <a href="qtextcodec.html">QTextCodec</a> for the encoding specified by <i>codecName</i>. Common values for <tt>codecName</tt> include &quot;ISO 8859-1&quot;, &quot;UTF-8&quot;, and &quot;UTF-16&quot;. If the encoding isn't recognized, nothing happens.</p>
<p><b>See also </b><a href="qtextcodec.html#codecForName">QTextCodec::codecForName</a>().</p>
<!-- @@@setCodec -->
<!-- $$$setDevice[overload1]$$$setDeviceQIODevice* -->
<h3 class="fn"><a name="setDevice"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">setDevice</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i> )</h3>
<p>Sets the current device to <i>device</i>. If you want the stream to write into a <a href="qbytearray.html">QByteArray</a>, you can create a <a href="qbuffer.html">QBuffer</a> device.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#device">device</a>().</p>
<!-- @@@setDevice -->
<!-- $$$writeAttribute[overload1]$$$writeAttributeconstQString&constQString&constQString& -->
<h3 class="fn"><a name="writeAttribute"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeAttribute</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>namespaceUri</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>value</i> )</h3>
<p>Writes an attribute with <i>name</i> and <i>value</i>, prefixed for the specified <i>namespaceUri</i>. If the namespace has not been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it.</p>
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
<!-- @@@writeAttribute -->
<!-- $$$writeAttribute$$$writeAttributeconstQString&constQString& -->
<h3 class="fn"><a name="writeAttribute-2"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeAttribute</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>qualifiedName</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>value</i> )</h3>
<p>This is an overloaded function.</p>
<p>Writes an attribute with <i>qualifiedName</i> and <i>value</i>.</p>
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
<!-- @@@writeAttribute -->
<!-- $$$writeAttribute$$$writeAttributeconstQXmlStreamAttribute& -->
<h3 class="fn"><a name="writeAttribute-3"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeAttribute</span> ( const <span class="type"><a href="qxmlstreamattribute.html">QXmlStreamAttribute</a></span> &amp; <i>attribute</i> )</h3>
<p>This is an overloaded function.</p>
<p>Writes the <i>attribute</i>.</p>
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
<!-- @@@writeAttribute -->
<!-- $$$writeAttributes[overload1]$$$writeAttributesconstQXmlStreamAttributes& -->
<h3 class="fn"><a name="writeAttributes"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeAttributes</span> ( const <span class="type"><a href="qxmlstreamattributes.html">QXmlStreamAttributes</a></span> &amp; <i>attributes</i> )</h3>
<p>Writes the attribute vector <i>attributes</i>. If a namespace referenced in an attribute not been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it.</p>
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() and <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>().</p>
<!-- @@@writeAttributes -->
<!-- $$$writeCDATA[overload1]$$$writeCDATAconstQString& -->
<h3 class="fn"><a name="writeCDATA"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeCDATA</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>Writes <i>text</i> as CDATA section. If <i>text</i> contains the forbidden character sequence &quot;]]&gt;&quot;, it is split into different CDATA sections.</p>
<p>This function mainly exists for completeness. Normally you should not need use it, because <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>() automatically escapes all non-content characters.</p>
<!-- @@@writeCDATA -->
<!-- $$$writeCharacters[overload1]$$$writeCharactersconstQString& -->
<h3 class="fn"><a name="writeCharacters"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeCharacters</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>Writes <i>text</i>. The characters &quot;&lt;&quot;, &quot;&amp;&quot;, and &quot;&quot;&quot; are escaped as entity references &quot;&amp;lt;&quot;, &quot;&amp;amp;, and &quot;&amp;quot;&quot;. To avoid the forbidden sequence &quot;]]&gt;&quot;, &quot;&gt;&quot; is also escaped as &quot;&amp;gt;&quot;.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a>().</p>
<!-- @@@writeCharacters -->
<!-- $$$writeComment[overload1]$$$writeCommentconstQString& -->
<h3 class="fn"><a name="writeComment"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeComment</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>Writes <i>text</i> as XML comment, where <i>text</i> must not contain the forbidden sequence &quot;--&quot; or end with &quot;-&quot;. Note that XML does not provide any way to escape &quot;-&quot; in a comment.</p>
<!-- @@@writeComment -->
<!-- $$$writeCurrentToken[overload1]$$$writeCurrentTokenconstQXmlStreamReader& -->
<h3 class="fn"><a name="writeCurrentToken"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeCurrentToken</span> ( const <span class="type"><a href="qxmlstreamreader.html">QXmlStreamReader</a></span> &amp; <i>reader</i> )</h3>
<p>Writes the current state of the <i>reader</i>. All possible valid states are supported.</p>
<p>The purpose of this function is to support chained processing of XML data.</p>
<p><b>See also </b><a href="qxmlstreamreader.html#tokenType">QXmlStreamReader::tokenType</a>().</p>
<!-- @@@writeCurrentToken -->
<!-- $$$writeDTD[overload1]$$$writeDTDconstQString& -->
<h3 class="fn"><a name="writeDTD"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeDTD</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>dtd</i> )</h3>
<p>Writes a DTD section. The <i>dtd</i> represents the entire doctypedecl production from the XML 1.0 specification.</p>
<!-- @@@writeDTD -->
<!-- $$$writeDefaultNamespace[overload1]$$$writeDefaultNamespaceconstQString& -->
<h3 class="fn"><a name="writeDefaultNamespace"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeDefaultNamespace</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>namespaceUri</i> )</h3>
<p>Writes a default namespace declaration for <i>namespaceUri</i>.</p>
<p>If <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() or <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>() was called, the declaration applies to the current element; otherwise it applies to the next child element.</p>
<p>Note that the namespaces <i>http://www.w3.org/XML/1998/namespace</i> (bound to <i>xmlns</i>) and <i>http://www.w3.org/2000/xmlns/</i> (bound to <i>xml</i>) by definition cannot be declared as default.</p>
<!-- @@@writeDefaultNamespace -->
<!-- $$$writeEmptyElement[overload1]$$$writeEmptyElementconstQString&constQString& -->
<h3 class="fn"><a name="writeEmptyElement"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeEmptyElement</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>namespaceUri</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )</h3>
<p>Writes an empty element with <i>name</i>, prefixed for the specified <i>namespaceUri</i>. If the namespace has not been declared, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>().</p>
<!-- @@@writeEmptyElement -->
<!-- $$$writeEmptyElement$$$writeEmptyElementconstQString& -->
<h3 class="fn"><a name="writeEmptyElement-2"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeEmptyElement</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>qualifiedName</i> )</h3>
<p>This is an overloaded function.</p>
<p>Writes an empty element with qualified name <i>qualifiedName</i>. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
<!-- @@@writeEmptyElement -->
<!-- $$$writeEndDocument[overload1]$$$writeEndDocument -->
<h3 class="fn"><a name="writeEndDocument"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeEndDocument</span> ()</h3>
<p>Closes all remaining open start elements and writes a newline.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>().</p>
<!-- @@@writeEndDocument -->
<!-- $$$writeEndElement[overload1]$$$writeEndElement -->
<h3 class="fn"><a name="writeEndElement"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeEndElement</span> ()</h3>
<p>Closes the previous start element.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>().</p>
<!-- @@@writeEndElement -->
<!-- $$$writeEntityReference[overload1]$$$writeEntityReferenceconstQString& -->
<h3 class="fn"><a name="writeEntityReference"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeEntityReference</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )</h3>
<p>Writes the entity reference <i>name</i> to the stream, as &quot;&amp;<i>name</i>;&quot;.</p>
<!-- @@@writeEntityReference -->
<!-- $$$writeNamespace[overload1]$$$writeNamespaceconstQString&constQString& -->
<h3 class="fn"><a name="writeNamespace"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeNamespace</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>namespaceUri</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>prefix</i> = QString() )</h3>
<p>Writes a namespace declaration for <i>namespaceUri</i> with <i>prefix</i>. If <i>prefix</i> is empty, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> assigns a unique prefix consisting of the letter 'n' followed by a number.</p>
<p>If <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() or <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>() was called, the declaration applies to the current element; otherwise it applies to the next child element.</p>
<p>Note that the prefix <i>xml</i> is both predefined and reserved for <i>http://www.w3.org/XML/1998/namespace</i>, which in turn cannot be bound to any other prefix. The prefix <i>xmlns</i> and its URI <i>http://www.w3.org/2000/xmlns/</i> are used for the namespace mechanism itself and thus completely forbidden in declarations.</p>
<!-- @@@writeNamespace -->
<!-- $$$writeProcessingInstruction[overload1]$$$writeProcessingInstructionconstQString&constQString& -->
<h3 class="fn"><a name="writeProcessingInstruction"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeProcessingInstruction</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>target</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>data</i> = QString() )</h3>
<p>Writes an XML processing instruction with <i>target</i> and <i>data</i>, where <i>data</i> must not contain the sequence &quot;?&gt;&quot;.</p>
<!-- @@@writeProcessingInstruction -->
<!-- $$$writeStartDocument[overload1]$$$writeStartDocumentconstQString& -->
<h3 class="fn"><a name="writeStartDocument"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeStartDocument</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>version</i> )</h3>
<p>Writes a document start with the XML version number <i>version</i>.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>().</p>
<!-- @@@writeStartDocument -->
<!-- $$$writeStartDocument$$$writeStartDocumentconstQString&bool -->
<h3 class="fn"><a name="writeStartDocument-2"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeStartDocument</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>version</i>, <span class="type">bool</span> <i>standalone</i> )</h3>
<p>Writes a document start with the XML version number <i>version</i> and a standalone attribute <i>standalone</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>().</p>
<!-- @@@writeStartDocument -->
<!-- $$$writeStartDocument$$$writeStartDocument -->
<h3 class="fn"><a name="writeStartDocument-3"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeStartDocument</span> ()</h3>
<p>This is an overloaded function.</p>
<p>Writes a document start with XML version number &quot;1.0&quot;. This also writes the encoding information.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>() and <a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
<!-- @@@writeStartDocument -->
<!-- $$$writeStartElement[overload1]$$$writeStartElementconstQString&constQString& -->
<h3 class="fn"><a name="writeStartElement"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeStartElement</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>namespaceUri</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )</h3>
<p>Writes a start element with <i>name</i>, prefixed for the specified <i>namespaceUri</i>. If the namespace has not been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>(), <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>(), and <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
<!-- @@@writeStartElement -->
<!-- $$$writeStartElement$$$writeStartElementconstQString& -->
<h3 class="fn"><a name="writeStartElement-2"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeStartElement</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>qualifiedName</i> )</h3>
<p>This is an overloaded function.</p>
<p>Writes a start element with <i>qualifiedName</i>. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
<p><b>See also </b><a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>() and <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
<!-- @@@writeStartElement -->
<!-- $$$writeTextElement[overload1]$$$writeTextElementconstQString&constQString&constQString& -->
<h3 class="fn"><a name="writeTextElement"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeTextElement</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>namespaceUri</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>Writes a text element with <i>name</i>, prefixed for the specified <i>namespaceUri</i>, and <i>text</i>. If the namespace has not been declared, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it.</p>
<p>This is a convenience function equivalent to:</p>
<pre class="cpp">         <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>(namespaceUri<span class="operator">,</span> name);
         <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>(text);
         <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>();</pre>
<!-- @@@writeTextElement -->
<!-- $$$writeTextElement$$$writeTextElementconstQString&constQString& -->
<h3 class="fn"><a name="writeTextElement-2"></a><span class="type">void</span> QXmlStreamWriter::<span class="name">writeTextElement</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>qualifiedName</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>This is an overloaded function.</p>
<p>Writes a text element with <i>qualifiedName</i> and <i>text</i>.</p>
<p>This is a convenience function equivalent to:</p>
<pre class="cpp">         <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>(qualifiedName);
         <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>(text);
         <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>();</pre>
<!-- @@@writeTextElement -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      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>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <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>