<?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" /> <!-- qxml.cpp --> <title>Qt 4.8: QXmlAttributes 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 & 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> 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 & 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="qtxml.html">QtXml</a></li> <li>QXmlAttributes</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-functions">Public Functions</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QXmlAttributes Class Reference</h1> <!-- $$$QXmlAttributes-brief --> <p>The QXmlAttributes class provides XML attributes. <a href="#details">More...</a></p> <!-- @@@QXmlAttributes --> <pre class="cpp"> <span class="preprocessor">#include <QXmlAttributes></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="qxmlattributes-members.html">List of all members, including inherited members</a></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="qxmlattributes.html#QXmlAttributes">QXmlAttributes</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#dtor.QXmlAttributes">~QXmlAttributes</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#append">append</a></b> ( const QString & <i>qName</i>, const QString & <i>uri</i>, const QString & <i>localPart</i>, const QString & <i>value</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#clear">clear</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#count">count</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#index">index</a></b> ( const QString & <i>qName</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#index-2">index</a></b> ( const QLatin1String & <i>qName</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#index-3">index</a></b> ( const QString & <i>uri</i>, const QString & <i>localPart</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#length">length</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#localName">localName</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#qName">qName</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#type">type</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#type-2">type</a></b> ( const QString & <i>qName</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#type-3">type</a></b> ( const QString & <i>uri</i>, const QString & <i>localName</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#uri">uri</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#value">value</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#value-2">value</a></b> ( const QString & <i>qName</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#value-3">value</a></b> ( const QLatin1String & <i>qName</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlattributes.html#value-4">value</a></b> ( const QString & <i>uri</i>, const QString & <i>localName</i> ) const</td></tr> </table> <a name="details"></a> <!-- $$$QXmlAttributes-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QXmlAttributes class provides XML attributes.</p> <p>If attributes are reported by <a href="qxmlcontenthandler.html#startElement">QXmlContentHandler::startElement</a>() this class is used to pass the attribute values.</p> <p>Use <a href="qxmlattributes.html#index">index</a>() to locate the position of an attribute in the list, <a href="qxmlattributes.html#count">count</a>() to retrieve the number of attributes, and <a href="qxmlattributes.html#clear">clear</a>() to remove the attributes. New attributes can be added with <a href="qxmlattributes.html#append">append</a>(). Use <a href="qxmlattributes.html#type">type</a>() to get an attribute's type and <a href="qxmlattributes.html#value">value</a>() to get its value. The attribute's name is available from <a href="qxmlattributes.html#localName">localName</a>() or <a href="qxmlattributes.html#qName">qName</a>(), and its namespace URI from <a href="qxmlattributes.html#uri">uri</a>().</p> </div> <!-- @@@QXmlAttributes --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QXmlAttributes[overload1]$$$QXmlAttributes --> <h3 class="fn"><a name="QXmlAttributes"></a>QXmlAttributes::<span class="name">QXmlAttributes</span> ()</h3> <p>Constructs an empty attribute list.</p> <!-- @@@QXmlAttributes --> <!-- $$$~QXmlAttributes[overload1]$$$~QXmlAttributes --> <h3 class="fn"><a name="dtor.QXmlAttributes"></a>QXmlAttributes::<span class="name">~QXmlAttributes</span> ()<tt> [virtual]</tt></h3> <p>Destroys the attributes object.</p> <!-- @@@~QXmlAttributes --> <!-- $$$append[overload1]$$$appendconstQString&constQString&constQString&constQString& --> <h3 class="fn"><a name="append"></a><span class="type">void</span> QXmlAttributes::<span class="name">append</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>qName</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>uri</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>localPart</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>value</i> )</h3> <p>Appends a new attribute entry to the list of attributes. The qualified name of the attribute is <i>qName</i>, the namespace URI is <i>uri</i> and the local name is <i>localPart</i>. The value of the attribute is <i>value</i>.</p> <p><b>See also </b><a href="qxmlattributes.html#qName">qName</a>(), <a href="qxmlattributes.html#uri">uri</a>(), <a href="qxmlattributes.html#localName">localName</a>(), and <a href="qxmlattributes.html#value">value</a>().</p> <!-- @@@append --> <!-- $$$clear[overload1]$$$clear --> <h3 class="fn"><a name="clear"></a><span class="type">void</span> QXmlAttributes::<span class="name">clear</span> ()</h3> <p>Clears the list of attributes.</p> <p><b>See also </b><a href="qxmlattributes.html#append">append</a>().</p> <!-- @@@clear --> <!-- $$$count[overload1]$$$count --> <h3 class="fn"><a name="count"></a><span class="type">int</span> QXmlAttributes::<span class="name">count</span> () const</h3> <p>Returns the number of attributes in the list. This function is equivalent to <a href="qxmlattributes.html#length">length</a>().</p> <!-- @@@count --> <!-- $$$index[overload1]$$$indexconstQString& --> <h3 class="fn"><a name="index"></a><span class="type">int</span> QXmlAttributes::<span class="name">index</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>qName</i> ) const</h3> <p>Looks up the index of an attribute by the qualified name <i>qName</i>.</p> <p>Returns the index of the attribute or -1 if it wasn't found.</p> <p><b>See also </b><a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p> <!-- @@@index --> <!-- $$$index$$$indexconstQLatin1String& --> <h3 class="fn"><a name="index-2"></a><span class="type">int</span> QXmlAttributes::<span class="name">index</span> ( const <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> & <i>qName</i> ) const</h3> <p>This is an overloaded function.</p> <!-- @@@index --> <!-- $$$index$$$indexconstQString&constQString& --> <h3 class="fn"><a name="index-3"></a><span class="type">int</span> QXmlAttributes::<span class="name">index</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>uri</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>localPart</i> ) const</h3> <p>This is an overloaded function.</p> <p>Looks up the index of an attribute by a namespace name.</p> <p><i>uri</i> specifies the namespace URI, or an empty string if the name has no namespace URI. <i>localPart</i> specifies the attribute's local name.</p> <p>Returns the index of the attribute, or -1 if it wasn't found.</p> <p><b>See also </b><a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p> <!-- @@@index --> <!-- $$$length[overload1]$$$length --> <h3 class="fn"><a name="length"></a><span class="type">int</span> QXmlAttributes::<span class="name">length</span> () const</h3> <p>Returns the number of attributes in the list.</p> <p><b>See also </b><a href="qxmlattributes.html#count">count</a>().</p> <!-- @@@length --> <!-- $$$localName[overload1]$$$localNameint --> <h3 class="fn"><a name="localName"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">localName</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Looks up an attribute's local name for the attribute at position <i>index</i>. If no namespace processing is done, the local name is an empty string.</p> <p><b>See also </b><a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p> <!-- @@@localName --> <!-- $$$qName[overload1]$$$qNameint --> <h3 class="fn"><a name="qName"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">qName</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Looks up an attribute's XML 1.0 qualified name for the attribute at position <i>index</i>.</p> <p><b>See also </b><a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p> <!-- @@@qName --> <!-- $$$type[overload1]$$$typeint --> <h3 class="fn"><a name="type"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">type</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Looks up an attribute's type for the attribute at position <i>index</i>.</p> <p>Currently only "CDATA" is returned.</p> <!-- @@@type --> <!-- $$$type$$$typeconstQString& --> <h3 class="fn"><a name="type-2"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">type</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>qName</i> ) const</h3> <p>This is an overloaded function.</p> <p>Looks up an attribute's type for the qualified name <i>qName</i>.</p> <p>Currently only "CDATA" is returned.</p> <!-- @@@type --> <!-- $$$type$$$typeconstQString&constQString& --> <h3 class="fn"><a name="type-3"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">type</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>uri</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>localName</i> ) const</h3> <p>This is an overloaded function.</p> <p>Looks up an attribute's type by namespace name.</p> <p><i>uri</i> specifies the namespace URI and <i>localName</i> specifies the local name. If the name has no namespace URI, use an empty string for <i>uri</i>.</p> <p>Currently only "CDATA" is returned.</p> <!-- @@@type --> <!-- $$$uri[overload1]$$$uriint --> <h3 class="fn"><a name="uri"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">uri</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Looks up an attribute's namespace URI for the attribute at position <i>index</i>. If no namespace processing is done or if the attribute has no namespace, the namespace URI is an empty string.</p> <p><b>See also </b><a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p> <!-- @@@uri --> <!-- $$$value[overload1]$$$valueint --> <h3 class="fn"><a name="value"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">value</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Returns an attribute's value for the attribute at position <i>index</i>. The index must be a valid position (i.e., 0 <= <i>index</i> < <a href="qxmlattributes.html#count">count</a>()).</p> <!-- @@@value --> <!-- $$$value$$$valueconstQString& --> <h3 class="fn"><a name="value-2"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">value</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>qName</i> ) const</h3> <p>This is an overloaded function.</p> <p>Returns an attribute's value for the qualified name <i>qName</i>, or an empty string if no attribute exists for the name given.</p> <p><b>See also </b><a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p> <!-- @@@value --> <!-- $$$value$$$valueconstQLatin1String& --> <h3 class="fn"><a name="value-3"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">value</span> ( const <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> & <i>qName</i> ) const</h3> <p>This is an overloaded function.</p> <p>Returns an attribute's value for the qualified name <i>qName</i>, or an empty string if no attribute exists for the name given.</p> <p><b>See also </b><a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p> <!-- @@@value --> <!-- $$$value$$$valueconstQString&constQString& --> <h3 class="fn"><a name="value-4"></a><span class="type"><a href="qstring.html">QString</a></span> QXmlAttributes::<span class="name">value</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>uri</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>localName</i> ) const</h3> <p>This is an overloaded function.</p> <p>Returns an attribute's value by namespace name.</p> <p><i>uri</i> specifies the namespace URI, or an empty string if the name has no namespace URI. <i>localName</i> specifies the attribute's local name.</p> <!-- @@@value --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</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>