QXmlStreamAttribute 類

QXmlStreamAttribute 類錶示單 XML 屬性。 更多...

頭: #include <QXmlStreamAttribute>
qmake: QT += core
Since: Qt 4.3

該類在 Qt 4.3 引入。

注意: 此類的所有函數 可重入 .

公共函數

QXmlStreamAttribute (const QXmlStreamAttribute & other )
QXmlStreamAttribute (const QString & namespaceUri , const QString & name , const QString & value )
QXmlStreamAttribute (const QString & qualifiedName , const QString & value )
QXmlStreamAttribute ()
QXmlStreamAttribute & operator= (const QXmlStreamAttribute & other )
~QXmlStreamAttribute ()
bool isDefault () const
QStringRef name () const
QStringRef namespaceUri () const
QStringRef prefix () const
QStringRef qualifiedName () const
QStringRef value () const
bool operator!= (const QXmlStreamAttribute & other ) const
bool operator== (const QXmlStreamAttribute & other ) const

詳細描述

An attribute consists of an optionally empty namespaceUri (), name (), value (), and an isDefault () attribute.

The raw XML attribute name is returned as qualifiedName ().

成員函數文檔編製

QXmlStreamAttribute:: QXmlStreamAttribute (const QXmlStreamAttribute & other )

創建副本為 other .

QXmlStreamAttribute:: QXmlStreamAttribute (const QString & namespaceUri , const QString & name , const QString & value )

Constructs an attribute in the namespace described with namespaceUri with name and value value .

QXmlStreamAttribute:: QXmlStreamAttribute (const QString & qualifiedName , const QString & value )

Constructs an attribute with qualified name qualifiedName and value value .

QXmlStreamAttribute:: QXmlStreamAttribute ()

Creates an empty attribute.

QXmlStreamAttribute &QXmlStreamAttribute:: operator= (const QXmlStreamAttribute & other )

賦值 other to this attribute.

QXmlStreamAttribute:: ~QXmlStreamAttribute ()

Destructs an attribute.

bool QXmlStreamAttribute:: isDefault () const

返迴 true if the parser added this attribute with a default value following an ATTLIST declaration in the DTD; otherwise returns false .

QStringRef QXmlStreamAttribute:: name () const

Returns the attribute's local name.

QStringRef QXmlStreamAttribute:: namespaceUri () const

Returns the attribute's resolved namespaceUri, or an empty string reference if the attribute does not have a defined namespace.

QStringRef QXmlStreamAttribute:: prefix () const

Returns the attribute's namespace prefix.

該函數在 Qt 4.4 引入。

另請參閱 name () 和 qualifiedName ().

QStringRef QXmlStreamAttribute:: qualifiedName () const

Returns the attribute's qualified name.

A qualified name is the raw name of an attribute in the XML data. It consists of the namespace prefix (), followed by colon, followed by the attribute's local name (). Since the namespace prefix is not unique (the same prefix can point to different namespaces and different prefixes can point to the same namespace), you shouldn't use qualifiedName(), but the resolved namespaceUri () and the attribute's local name ().

QStringRef QXmlStreamAttribute:: value () const

Returns the attribute's value.

bool QXmlStreamAttribute:: operator!= (const QXmlStreamAttribute & other ) const

Compares this attribute with other 並返迴 true 若它們不相等;否則返迴 false .

bool QXmlStreamAttribute:: operator== (const QXmlStreamAttribute & other ) const

Compares this attribute with other 並返迴 true 若它們相等;否則返迴 false .