26 #include <QXmlNodeModelIndex> 36 QObject(parent), m_zQuery(NULL)
42 qmlRegisterType<ZxItem>(
"org.zuble.qml", 1, 0,
"ZxItem");
65 return m_item.isAtomicValue();
80 return m_item.toAtomicValue();
90 QXmlNodeModelIndex mi(
m_item.toNodeModelIndex());
94 QXmlName name = mi.model()->name(mi);
109 QXmlNodeModelIndex mi(
m_item.toNodeModelIndex());
112 result = mi.model()->stringValue(mi);
124 QXmlNodeModelIndex miThis(
m_item.toNodeModelIndex());
129 QXmlNodeModelIndex miRoot = miThis.model()->root(miThis);
147 QXmlNodeModelIndex miThis(
m_item.toNodeModelIndex());
156 QXmlName idName(np,
id);
172 QXmlNodeModelIndex miId = miThis.model()->elementById(idName);
188 zThreadErr.raiseError(
"ZxItem", code, message);
This class allows Javascript programs to access QXmlItem objects.
Q_INVOKABLE void setAtomicValue(QVariant value)
set the item to an atomic value
ZxItem(QObject *parent=0)
static void registerType()
Registers ZxItem as a QML type.
Q_INVOKABLE bool isNull() const
determine if this item is null
Q_INVOKABLE bool isAtomicValue() const
determine if this item is an atomic value. Atomic values are represented by QVariant objects...
Q_INVOKABLE QVariant toAtomicValue() const
convert this item to it's atomic value equivalent.
Q_INVOKABLE QObject * elementById(const QString &id)
Obtain the element node from this node model that has the specified id attribute. ...
bool ensureIntegrity(const QString &code, const QString &message)
ZxQuery * m_zQuery
Pointer to the ZxQuery object associated with this item.
void stringValueChanged()
QXmlNamePool getNamePool() const
Obtains the XML name pool for the encapsulated QXmlQuery object.
QXmlItem m_item
Encapsulated QmlItem object.
#define zThreadErr
where does this show up?
Q_INVOKABLE bool isNode() const
determine if this item is a node value.
const QString getLocalName()
returns the local name of this item
const QString getStringValue()
returns the string value of this item
This class provides access to the QXMLQuery class from Javascript.
QObject * getRootNode()
Obtain the root node from the node model that contains this node.
void setValue(const QXmlItem &item, ZxQuery *zQuery)