QDomDocumentFragment(3qt)
π QDomDocumentFragment β a 3qt manual page, bestie edition π
okay so. this is QDomDocumentFragment(3qt), straight out of the Qt 3 docs, and i'm gonna make it make sense for you. grab a snack. π
β¨ NAME β¨
QDomDocumentFragment β a whole tree of QDomNodes that is not usually a complete QDomDocument.
like... it's a fragment. a lil guy. a piece. not the whole document, usually. periodt. π
πΈ SYNOPSIS πΈ
first things first, and this is important:
All the functions in this class are reentrant when Qt is built with thread support.
(yeah the original has a stray </p> there. we don't talk about it. π)
#include <qdom.h>
it inherits QDomNode. so everything QDomNode can do? it can do too. main character energy honestly. π
π Public Members
QDomDocumentFragment ()QDomDocumentFragment ( const QDomDocumentFragment & x )QDomDocumentFragment & operator= ( const QDomDocumentFragment & x )~QDomDocumentFragment ()virtual QDomNode::NodeType nodeType () constvirtual bool isDocumentFragment () const
π¦ DESCRIPTION π¦
so the QDomDocumentFragment class is, fr fr, a tree of QDomNodes that is not usually a complete QDomDocument. that's the whole vibe. π
here's when you'd actually want it: if you're doing complex tree operations, it's genuinely useful to have a lightweight class to hold onto nodes and their relations. QDomDocumentFragment stores a subtree of a document β and that subtree does not necessarily represent a well-formed XML document. no cap. it's just a chunk. β¨
it's also lowkey iconic if you wanna group several nodes into a list and then insert them all together as children of some node. in those cases, QDomDocumentFragment is your temporary container for that list of children. a lil holding pen for your nodes. π«Ά
now the most important feature, the thing you're gonna remember:
QDomDocumentFragment is treated in a special way by QDomNode::insertAfter(), QDomNode::insertBefore(), QDomNode::replaceChild() and QDomNode::appendChild(). instead of inserting the fragment itself, all the fragment's children get inserted. π€―
so the fragment is basically a ghost β it does the work, and then it does not show up in the tree. it's giving... behind the scenes producer. π
See also: XML.
π MEMBER FUNCTION DOCUMENTATION π
QDomDocumentFragment::QDomDocumentFragment ()
constructs an empty document fragment. that's it. a lil blank slate. π
QDomDocumentFragment::QDomDocumentFragment ( const QDomDocumentFragment & x )
constructs a copy of x.
β οΈ the data of the copy is shared (shallow copy): modifying one node will also change the other. if you want a deep copy, use cloneNode(). don't get caught out by this one bestie, i'm begging. π
QDomDocumentFragment::~QDomDocumentFragment ()
destroys the object and frees its resources. bye boo π
bool QDomDocumentFragment::isDocumentFragment () const [virtual]
this function reimplements QDomNode::isDocumentFragment().
See also: nodeType() and QDomNode::toDocumentFragment().
Reimplemented from QDomNode.
QDomNode::NodeType QDomDocumentFragment::nodeType () const [virtual]
returns DocumentFragment. that's the answer. that's the whole function. slay. π
See also: isDocumentFragment() and QDomNode::toDocumentFragment().
Reimplemented from QDomNode.
QDomDocumentFragment & QDomDocumentFragment::operator= ( const QDomDocumentFragment & x )
assigns x to this DOM document fragment.
β οΈ again for the people in the back: the data of the copy is shared (shallow copy). modifying one node will also change the other. deep copy? use cloneNode(). π«‘
π₯ SEE ALSO π₯
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
π§ AUTHOR π§
Generated automatically from the source code. (no human wrote this one, it just manifested. icon behaviour honestly. β¨)
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. thank you. π
the definitive Qt documentation is provided in HTML format; it lives at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (so like, it's a vibe, not a contract. π)
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qdomdocumentfragment.3qt) and the Qt version (3.3.8).
and that's the whole page bestie!! brought to you by Trolltech AS, dated 2 February 2007, living in the 3.3.8 era of Qt. drink some water, cloneNode() your heart out, and remember: the fragment inserts its children, not itself. iykyk. πβ¨π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms