WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Friends | List of all members
Zbl::ZxItem Class Reference

This class allows Javascript programs to access QXmlItem objects. More...

#include <ZxItem.h>

Inheritance diagram for Zbl::ZxItem:
Inheritance graph
[legend]
Collaboration diagram for Zbl::ZxItem:
Collaboration graph
[legend]

Signals

void stringValueChanged ()
 

Public Member Functions

 ZxItem (QObject *parent=0)
 
Q_INVOKABLE bool isAtomicValue () const
 determine if this item is an atomic value. Atomic values are represented by QVariant objects. More...
 
Q_INVOKABLE bool isNode () const
 determine if this item is a node value. More...
 
Q_INVOKABLE bool isNull () const
 determine if this item is null More...
 
Q_INVOKABLE QVariant toAtomicValue () const
 convert this item to it's atomic value equivalent. More...
 
QObject * getRootNode ()
 Obtain the root node from the node model that contains this node. More...
 
Q_INVOKABLE QObject * elementById (const QString &id)
 Obtain the element node from this node model that has the specified id attribute. More...
 
Q_INVOKABLE void setAtomicValue (QVariant value)
 set the item to an atomic value More...
 
const QString getLocalName ()
 returns the local name of this item More...
 
const QString getStringValue ()
 returns the string value of this item More...
 

Static Public Member Functions

static void registerType ()
 Registers ZxItem as a QML type. More...
 

Protected Member Functions

void setValue (const QXmlItem &item, ZxQuery *zQuery)
 
bool ensureIntegrity (const QString &code, const QString &message)
 

Protected Attributes

QXmlItem m_item
 Encapsulated QmlItem object. More...
 
ZxQuerym_zQuery
 Pointer to the ZxQuery object associated with this item. More...
 

Properties

QString localName
 get the node local name More...
 
QString stringValue
 get the node string value More...
 
QObject rootNode
 get the root node for the model containing this node More...
 

Friends

class ZxResultItems
 
class ZxQuery
 

Detailed Description

This class allows Javascript programs to access QXmlItem objects.

Definition at line 43 of file ZxItem.h.

Constructor & Destructor Documentation

◆ ZxItem()

Zbl::ZxItem::ZxItem ( QObject *  parent = 0)
explicit

Definition at line 35 of file ZxItem.cpp.

Referenced by elementById(), and getRootNode().

Member Function Documentation

◆ elementById()

QObject * Zbl::ZxItem::elementById ( const QString &  id)

Obtain the element node from this node model that has the specified id attribute.

Parameters
idthe id value of the desired element (attribute must have type xs:ID)
Returns
the ZxItem object corresponding to the ID value or NULL if no model items were present in the sequence.

Definition at line 142 of file ZxItem.cpp.

◆ ensureIntegrity()

bool Zbl::ZxItem::ensureIntegrity ( const QString &  code,
const QString &  message 
)
protected

Definition at line 183 of file ZxItem.cpp.

Referenced by elementById(), getLocalName(), getRootNode(), and getStringValue().

◆ getLocalName()

const QString Zbl::ZxItem::getLocalName ( )

returns the local name of this item

Returns

Definition at line 83 of file ZxItem.cpp.

◆ getRootNode()

QObject * Zbl::ZxItem::getRootNode ( )

Obtain the root node from the node model that contains this node.

Returns
the ZxItem object for this model's root node.

Definition at line 119 of file ZxItem.cpp.

◆ getStringValue()

const QString Zbl::ZxItem::getStringValue ( )

returns the string value of this item

Returns

Definition at line 102 of file ZxItem.cpp.

◆ isAtomicValue()

bool Zbl::ZxItem::isAtomicValue ( ) const

determine if this item is an atomic value. Atomic values are represented by QVariant objects.

Definition at line 63 of file ZxItem.cpp.

◆ isNode()

bool Zbl::ZxItem::isNode ( ) const

determine if this item is a node value.

Definition at line 68 of file ZxItem.cpp.

◆ isNull()

bool Zbl::ZxItem::isNull ( ) const

determine if this item is null

Definition at line 73 of file ZxItem.cpp.

◆ registerType()

void Zbl::ZxItem::registerType ( )
static

Registers ZxItem as a QML type.

Definition at line 40 of file ZxItem.cpp.

Referenced by Zbl::Zblcore::registerTypes().

◆ setAtomicValue()

void Zbl::ZxItem::setAtomicValue ( QVariant  value)

set the item to an atomic value

Definition at line 54 of file ZxItem.cpp.

◆ setValue()

void Zbl::ZxItem::setValue ( const QXmlItem &  item,
ZxQuery zQuery 
)
protected

◆ stringValueChanged

void Zbl::ZxItem::stringValueChanged ( )
signal

Referenced by setAtomicValue(), and setValue().

◆ toAtomicValue()

QVariant Zbl::ZxItem::toAtomicValue ( ) const

convert this item to it's atomic value equivalent.

Returns
a variant object containing the value

Definition at line 78 of file ZxItem.cpp.

Friends And Related Function Documentation

◆ ZxQuery

friend class ZxQuery
friend

Definition at line 46 of file ZxItem.h.

◆ ZxResultItems

friend class ZxResultItems
friend

Definition at line 45 of file ZxItem.h.

Member Data Documentation

◆ m_item

QXmlItem Zbl::ZxItem::m_item
protected

◆ m_zQuery

ZxQuery* Zbl::ZxItem::m_zQuery
protected

Pointer to the ZxQuery object associated with this item.

This is needed to obtain the XML model from which the QXmlItem's data can be obtained.

Definition at line 172 of file ZxItem.h.

Referenced by elementById(), ensureIntegrity(), getLocalName(), getRootNode(), and setValue().

Property Documentation

◆ localName

QString Zbl::ZxItem::localName
read

get the node local name

Definition at line 57 of file ZxItem.h.

◆ rootNode

QObject Zbl::ZxItem::rootNode
read

get the root node for the model containing this node

Definition at line 69 of file ZxItem.h.

◆ stringValue

QString Zbl::ZxItem::stringValue
read

get the node string value

Definition at line 63 of file ZxItem.h.


The documentation for this class was generated from the following files: