QDomText Class

QDomText クラスは、パースされた XML ドキュメント内のテキスト・データを表します。詳細...

ヘッダ #include <QDomText>
CMake: find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
qmake: QT += xml
を継承する: QDomCharacterData
継承元:

QDomCDATASection

注意:このクラスの関数はすべてリエントラントです。

パブリック関数

QDomText()
QDomText(const QDomText &text)
QDomNode::NodeType nodeType() const
QDomText splitText(int offset)
QDomText &operator=(const QDomText &other)

詳細説明

splitText() を使用して、QDomText オブジェクト内のテキストを 2 つの QDomText オブジェクトに分割できます。

ドキュメント・オブジェクト・モデルの詳細については、「レベル 1およびレベル 2 コア」を参照してください。DOM 実装のより一般的な紹介については、QDomDocument ドキュメントを参照してください。

メンバ関数のドキュメント

QDomText::QDomText()

空の QDomText オブジェクトを構築します。

内容のある QDomText を構築するには、QDomDocument::createTextNode() を使用します。

QDomText::QDomText(const QDomText &text)

text のコピーを構築する。

コピーのデータは共有されます(シャローコピー):一方のノードを変更すると、もう一方のノードも変更されます。深いコピーを作成したい場合は、cloneNode() を使用します。

QDomNode::NodeType QDomText::nodeType() const

TextNode を返す。

QDomText QDomText::splitText(int offset)

この DOM テキストオブジェクトを 2 つのQDomText オブジェクトに分割します。このオブジェクトは最初のoffset 文字を保持し、2 番目の (新しく作成された) オブジェクトは残りの文字とともにこのオブジェクトの後にドキュメントツリーに挿入されます。

この関数は、新しく作成されたオブジェクトを返します。

QDomNode::normalize()も参照してください

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

この DOM テキストにother を割り当てます。

コピーのデータは共有されます(シャローコピー):一方のノードを変更すると、もう一方のノードも変更されます。ディープコピーを作成したい場合は、cloneNode() を使用してください。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. 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.