QDomDocumentFragment Class

QDomDocumentFragment 클래스는 일반적으로 완전한 QDomDocument 이 아닌 QDomNode의 트리입니다. 더 보기...

헤더: #include <QDomDocumentFragment>
CMake: find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
qmake: QT += xml
상속합니다: QDomNode

참고: 이 클래스의 모든 함수는 재진입합니다.

공용 함수

QDomDocumentFragment()
QDomDocumentFragment(const QDomDocumentFragment &documentFragment)
QDomNode::NodeType nodeType() const
QDomDocumentFragment &operator=(const QDomDocumentFragment &other)

상세 설명

복잡한 트리 연산을 수행하려는 경우 노드와 그 관계를 저장하는 경량 클래스를 사용하는 것이 유용합니다. QDomDocumentFragment는 문서의 하위 트리를 저장하는데, 이는 반드시 잘 구성된 XML 문서를 나타낼 필요는 없습니다.

QDomDocumentFragment는 목록에서 여러 노드를 그룹화하여 특정 노드의 자식으로 모두 삽입하려는 경우에도 유용합니다. 이러한 경우 QDomDocumentFragment를 이 자식 목록의 임시 컨테이너로 사용할 수 있습니다.

QDomDocumentFragment의 가장 중요한 특징은 QDomNode::insertAfter(), QDomNode::insertBefore(), QDomNode::replaceChild() 및 QDomNode::appendChild()에서 특별한 방식으로 처리된다는 것입니다: 조각 자체를 삽입하는 대신 조각의 모든 자식들을 삽입합니다.

멤버 함수 문서

QDomDocumentFragment::QDomDocumentFragment()

빈 문서 조각을 생성합니다.

QDomDocumentFragment::QDomDocumentFragment(const QDomDocumentFragment &documentFragment)

documentFragment 의 복사본을 생성합니다.

사본의 데이터는 공유됩니다(얕은 사본): 한 노드를 수정하면 다른 노드도 변경됩니다. 심층 복사본을 만들려면 cloneNode()를 사용합니다.

QDomNode::NodeType QDomDocumentFragment::nodeType() const

DocumentFragment 를 반환합니다.

isDocumentFragment() 및 QDomNode::toDocumentFragment()도 참조하세요 .

QDomDocumentFragment &QDomDocumentFragment::operator=(const QDomDocumentFragment &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.