Skip to content

PythonQt.QtXmlPatterns.QXmlNodeModelIndex

QXmlNodeModelIndex

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

QXmlNodeModelIndex is an index into an XML node model. It contains:

Because QXmlNodeModelIndex is intentionally a simple class, it doesn't have member functions for accessing the properties of nodes. For example, it doesn't have functions for getting a node's name or its list of attributes or child nodes. If you find that you need to retrieve this kind of information from your query results, there are two ways to proceed.

The second case is explained by example. Suppose you want to populate a list widget with the values of certain attributes from a set of result elements. You could write an XQuery to return the set of elements, and then you would write the code to iterate over the result elements, get their attributes, and extract the desired string values. But the simpler way is to just augment your XQuery to finding the desired attribute values. Then all you have to do is evaluate the XQuery using the version of QXmlQuery::evaluateTo() that populates a QStringList, which you can send directly to your widget.

QXmlNodeModelIndex doesn't impose any restrictions on the data value an QXmlNodeModelIndex should contain. The meaning of the data left to the associated node model. Because QXmlNodeModelIndex depends on a particular subclass of QAbstractXmlNodeModel for its existence, the only way you can create an instance of QXmlNodeModelIndex is by asking the node model to create one for you with QAbstractXmlNodeModel::createIndex(). Since that function is protected, it is usually a good idea to write a public function that creates a QXmlNodeModelIndex from arguments that are appropriate for your particular node model.

A default constructed node index is said to be null, i.e., isNull() returns true.

QXmlNodeModelIndex and QAbstractXmlNodeModel follow the same design pattern used for QModelIndex and QAbstractItemModel.

Source: https://doc.qt.io/archives/qt-5.15/qxmlnodemodelindex.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
Attribute attribute Any
Comment attribute Any
Document attribute Any (shared captured text)
DocumentOrder attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
Element attribute Any
Follows attribute Any
Is attribute Any
Namespace attribute Any
NodeKind attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
Precedes attribute Any
ProcessingInstruction attribute Any
Text attribute Any (shared captured text)
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
additionalData function (self) -> int X.additionalData() -> int
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
data function (self) -> int X.data() -> int
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isNull function (self) -> bool X.isNull() -> bool
model function (self) -> Any X.model() -> PythonQt.QtXmlPatterns.QAbstractXmlNodeModel