⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qdomelement.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
字号:
'\" t.TH QDomElement 3qt "24 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQDomElement \- Represents one element in the DOM tree.br.PP\fC#include <qdom.h>\fR.PPInherits QDomNode..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQDomElement\fR () ".br.ti -1c.BI "\fBQDomElement\fR ( const QDomElement & x ) ".br.ti -1c.BI "QDomElement& \fBoperator=\fR ( const QDomElement & ) ".br.ti -1c.BI "\fB~QDomElement\fR () ".br.ti -1c.BI "void \fBsetTagName\fR ( const QString & name ) ".br.ti -1c.BI "QString \fBtagName\fR () const".br.ti -1c.BI "QString \fBattribute\fR ( const QString & " "name" ", const QString & defValue = QString::null ) const".br.ti -1c.BI "void \fBsetAttribute\fR ( const QString & " "name" ", const QString & value ) ".br.ti -1c.BI "void \fBsetAttribute\fR ( const QString & " "name" ", int value ) ".br.ti -1c.BI "void \fBsetAttribute\fR ( const QString & " "name" ", uint value ) ".br.ti -1c.BI "void \fBsetAttribute\fR ( const QString & " "name" ", double value ) ".br.ti -1c.BI "void \fBremoveAttribute\fR ( const QString & name ) ".br.ti -1c.BI "QDomAttr \fBattributeNode\fR ( const QString & name ) ".br.ti -1c.BI "QDomAttr \fBsetAttributeNode\fR ( const QDomAttr & newAttr ) ".br.ti -1c.BI "QDomAttr \fBremoveAttributeNode\fR ( const QDomAttr & oldAttr ) ".br.ti -1c.BI "bool \fBhasAttribute\fR ( const QString & name ) const".br.ti -1c.BI "virtual QDomNodeList \fBelementsByTagName\fR ( const QString & tagname ) const".br.ti -1c.BI "void \fBnormalize\fR () ".br.ti -1c.BI "virtual QDomNamedNodeMap \fBattributes\fR () const".br.ti -1c.BI "virtual QDomNode::NodeType \fBnodeType\fR () const".br.ti -1c.BI "virtual bool \fBisElement\fR () const".br.ti -1c.BI "QString \fBtext\fR () const".br.in -1c.SH DESCRIPTIONThe QDomElement class represents one element in the DOM tree..PPElements have a name() and zero or more attributes associated with them..PPAttributes of the element are represented by QDomAttr objects, that can be queried using the attribute() and attributeNode() functions. You can set attributes with the setAttribute() and setAttributeNode() functions..PPFor further information about the Document Objct Model see http://www.w3.org/TR/REC-DOM-Level-1/. For a more general introduction of the DOM implementation see the QDomDocument documentation..SH MEMBER FUNCTION DOCUMENTATION.SH "QDomElement::QDomElement ()"Constructs an empty element. Use the QDomDocument::createElement() function to construct elements with content..SH "QDomElement::QDomElement ( const QDomElement & x )"Copy constructor..PPThe data of the copy is shared: modifying one will also change the other. If you want to make a real copy, use cloneNode() instead..SH "QDomElement::~QDomElement ()"Destructor..SH "QString QDomElement::attribute ( const QString & name, const QString & defValue = QString::null ) const"Returns the attribute with the name \fIname.\fR If the attribute does not exist \fIdefValue\fR is returned..PPSee also setAttribute(), attributeNode() and setAttributeNode()..SH "QDomAttr QDomElement::attributeNode ( const QString & name )"Returns the QDomAttr object that corresponds to the attribute with the name \fIname.\fR If no such attribute exists a null object is returned..PPSee also setAttributeNode(), attribute() and setAttribute()..SH "QDomNamedNodeMap QDomElement::attributes () const \fC[virtual]\fR"Returns a QDomNamedNodeMap containing all attributes for this element..PPSee also attribute(), setAttribute(), attributeNode() and setAttributeNode()..PPReimplemented from QDomNode..SH "QDomNodeList QDomElement::elementsByTagName ( const QString & tagname ) const \fC[virtual]\fR"Returns a QDomNodeList containing all descendant elements of this element with the name \fItagname.\fR The order they are in the node list, is the order they are encountered in a preorder traversal of the element tree..SH "bool QDomElement::hasAttribute ( const QString & name ) const"Returns TRUE is this element has an attribute with the name \fIname,\fR otherwise FALSE..SH "bool QDomElement::isElement () const \fC[virtual]\fR"Returns TRUE..PPReimplemented from QDomNode..SH "QDomNode::NodeType QDomElement::nodeType() const \fC[virtual]\fR"Returns \fCElementNode.\fR.PPReimplemented from QDomNode..SH "void QDomElement::normalize ()"Calling normalize() on an element brings all its children into a standard form. This means, that adjacent QDomText objects will be merged to one text object (QDomCDATASection nodes are not merged)..SH "QDomElement& QDomElement::operator= ( const QDomElement & x )"Assignment operator..PPThe data of the copy is shared: modifying one will also change the other. If you want to make a real copy, use cloneNode() instead..SH "void QDomElement::removeAttribute ( const QString & name )"Removes the attribute with the name \fIname\fR from this element..PPSee also setAttribute() and attribute()..SH "QDomAttr QDomElement::removeAttributeNode ( const QDomAttr & oldAttr )"Removes the attribute \fIoldAttr\fR from the element and returns it..PPSee also attributeNode() and setAttributeNode()..SH "void QDomElement::setAttribute ( const QString & name, const QString & value )"Sets the attribute with the name \fIname\fR to the string \fIvalue.\fR If the attribute does not exist, a new one is created..SH "void QDomElement::setAttribute ( const QString & name, double value )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "void QDomElement::setAttribute ( const QString & name, int value )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "void QDomElement::setAttribute ( const QString & name, uint value )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "QDomAttr QDomElement::setAttributeNode ( const QDomAttr & newAttr )"Adds the attribute \fInewAttr\fR to this element..PPIf an attribute with the name \fInewAttr\fR exists in the element, the function returns this attribute; otherwise the function returns a null attribute..PPSee also attributeNode()..SH "void QDomElement::setTagName ( const QString & name )"Sets the tag name of this element..PPSee also tagName()..SH "QString QDomElement::tagName () const"Returns the tag name of this element. For an XML element like.PP.nf.br  <img src="myimg.png">.fi.PPthe tagname would return "img"..PPSee also setTagName()..SH "QString QDomElement::text () const"Returns the text contained inside this element..PPExample:.PP.nf.br  <h1>Hello <b>Qt</b> <![CDATA[<xml is cool>]]></h1>.fi.PPThe function text() of the QDomElement for the <h1> tag, will return "Hello Qt <xml is cool>"..PPComments are ignored by this function. It evaluates onlyQDomText and QDomCDATASection objects..SH "SEE ALSO".BR http://doc.trolltech.com/qdomelement.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qdomelement.3qt) and the Qtversion (2.3.10).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -