Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1094

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDomAttr Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDomAttr Class Reference<br /><sup><sup>[<a href="qtxml.html">QtXml</a> module]</sup></sup></h1><p>The QDomAttr class represents one attribute of a <a href="qdomelement.html">QDomElement</a>. <a href="#details">More...</a></p>
<p>Inherits <a href="qdomnode.html">QDomNode</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdomattr.html#QDomAttr">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdomattr.html#QDomAttr-2">__init__</a></b> (<i>self</i>, QDomAttr)</li><li><div class="fn" />QString <b><a href="qdomattr.html#name">name</a></b> (<i>self</i>)</li><li><div class="fn" />QDomNode.NodeType <b><a href="qdomattr.html#nodeType">nodeType</a></b> (<i>self</i>)</li><li><div class="fn" />QDomElement <b><a href="qdomattr.html#ownerElement">ownerElement</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdomattr.html#setValue">setValue</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qdomattr.html#specified">specified</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qdomattr.html#value">value</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDomAttr class represents one attribute of a <a href="qdomelement.html">QDomElement</a>.</p>
<p>For example, the following piece of XML produces an element with no children, but two attributes:</p>
<pre> &lt;link href="http:<span class="comment">//qt.nokia.com" color="red" /&gt;</span></pre>
<p>You can access the attributes of an element with code like this:</p>
<pre> QDomElement e = <span class="comment">//...</span>
<span class="comment"> //...</span>
 QDomAttr a = e.attributeNode("href");
 cout &lt;&lt; a.value() &lt;&lt; endl;                <span class="comment">// prints "http://qt.nokia.com"</span>
 a.setValue("http:<span class="comment">//qt.nokia.com/doc"); // change the node's attribute</span>
 QDomAttr a2 = e.attributeNode("href");
 cout &lt;&lt; a2.value() &lt;&lt; endl;               <span class="comment">// prints "http://qt.nokia.com/doc"</span></pre>
<p>This example also shows that changing an attribute received from an element changes the attribute of the element. If you do not want to change the value of the element's attribute you must use <a href="qdomnode.html#cloneNode">cloneNode</a>() to get an independent copy of the attribute.</p>
<p>QDomAttr can return the <a href="qdomattr.html#name">name</a>() and <a href="qdomattr.html#value">value</a>() of an attribute. An attribute's value is set with <a href="qdomattr.html#setValue">setValue</a>(). If <a href="qdomattr.html#specified">specified</a>() returns true the value was set with <a href="qdomattr.html#setValue">setValue</a>(). The node this attribute is attached to (if any) is returned by <a href="qdomattr.html#ownerElement">ownerElement</a>().</p>
<p>For further information about the Document Object Model see <a href="http://www.w3.org/TR/REC-DOM-Level-1/">http://www.w3.org/TR/REC-DOM-Level-1/</a> and <a href="http://www.w3.org/TR/DOM-Level-2-Core/">http://www.w3.org/TR/DOM-Level-2-Core/</a>. For a more general introduction of the DOM implementation see the <a href="qdomdocument.html">QDomDocument</a> documentation.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDomAttr" />QDomAttr.__init__ (<i>self</i>)</h3><p>Constructs an empty attribute.</p>
<h3 class="fn"><a name="QDomAttr-2" />QDomAttr.__init__ (<i>self</i>, <a href="qdomattr.html">QDomAttr</a>)</h3><p>Constructs a copy of <i>x</i>.</p>
<p>The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use <a href="qdomnode.html#cloneNode">cloneNode</a>().</p>
<a name="//apple_ref/cpp/instm/QDomAttr/name" />
<h3 class="fn"><a name="name" />QString QDomAttr.name (<i>self</i>)</h3><p>Returns the attribute's name.</p>
<a name="//apple_ref/cpp/instm/QDomAttr/nodeType" />
<h3 class="fn"><a name="nodeType" /><a href="qdomnode.html#NodeType-enum">QDomNode.NodeType</a> QDomAttr.nodeType (<i>self</i>)</h3><p>Returns <a href="qdomnode.html#NodeType-enum">AttributeNode</a>.</p>
<a name="//apple_ref/cpp/instm/QDomAttr/ownerElement" />
<h3 class="fn"><a name="ownerElement" /><a href="qdomelement.html">QDomElement</a> QDomAttr.ownerElement (<i>self</i>)</h3><p>Returns the element node this attribute is attached to or a <a href="qdomnode.html#isNull">null node</a> if this attribute is not attached to any element.</p>
<a name="//apple_ref/cpp/instm/QDomAttr/setValue" />
<h3 class="fn"><a name="setValue" />QDomAttr.setValue (<i>self</i>, QString)</h3><p>Sets the attribute's value to <i>v</i>.</p>
<p>See also <a href="qdomattr.html#value">value</a>().</p>
<a name="//apple_ref/cpp/instm/QDomAttr/specified" />
<h3 class="fn"><a name="specified" />bool QDomAttr.specified (<i>self</i>)</h3><p>Returns true if the attribute has been set by the user with <a href="qdomattr.html#setValue">setValue</a>(). Returns false if the value hasn't been specified or set.</p>
<p>See also <a href="qdomattr.html#setValue">setValue</a>().</p>
<a name="//apple_ref/cpp/instm/QDomAttr/value" />
<h3 class="fn"><a name="value" />QString QDomAttr.value (<i>self</i>)</h3><p>Returns the value of the attribute or an empty string if the attribute has not been specified.</p>
<p>See also <a href="qdomattr.html#specified">specified</a>() and <a href="qdomattr.html#setValue">setValue</a>().</p>
<a name="//apple_ref/cpp/instm/QDomAttr/operator=" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>