QDomDocumentFragment(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– 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 () const
  • virtual 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 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