Qt 4.8
Public Functions | Static Public Functions | Public Variables | Private Functions | List of all members
NodeList Class Reference

Public Functions

bool isNull ()
 
 NodeList ()
 
 NodeList (const NodeList &)
 
 ~NodeList ()
 

Static Public Functions

static QScriptValue create (QScriptEngine *, NodeImpl *)
 
static QScriptValue length (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue prototype (QScriptEngine *)
 

Public Variables

NodeImpld
 

Private Functions

NodeListoperator= (const NodeList &)
 

Detailed Description

Definition at line 196 of file qdeclarativexmlhttprequest.cpp.

Constructors and Destructors

◆ NodeList() [1/2]

NodeList::NodeList ( )

Definition at line 833 of file qdeclarativexmlhttprequest.cpp.

834 : d(0)
835 {
836 }

◆ NodeList() [2/2]

NodeList::NodeList ( const NodeList o)

Definition at line 838 of file qdeclarativexmlhttprequest.cpp.

839 : d(o.d)
840 {
841  if (d) A(d);
842 }
#define A(arg)

◆ ~NodeList()

NodeList::~NodeList ( )

Definition at line 844 of file qdeclarativexmlhttprequest.cpp.

845 {
846  if (d) D(d);
847 }
#define D(arg)

Functions

◆ create()

QScriptValue NodeList::create ( QScriptEngine engine,
NodeImpl data 
)
static

Definition at line 814 of file qdeclarativexmlhttprequest.cpp.

Referenced by Node::childNodes().

815 {
816  QScriptValue instance = engine->newObject();
817  instance.setPrototype(NodeList::prototype(engine));
818 
819  NodeList list;
820  list.d = data;
821  if (data) A(data);
822 
823  instance.setData(engine->newVariant(QVariant::fromValue(list)));
824 
827 
828  instance.setScriptClass(QDeclarativeScriptEngine::get(engine)->nodeListClass);
829 
830  return instance;
831 }
#define A(arg)
static QDeclarativeScriptEngine * get(QScriptEngine *e)
static const char * data(const QByteArray &arr)
QScriptValue newObject()
Creates a QtScript object of class Object.
void setScriptClass(QScriptClass *scriptClass)
Sets the custom script class of this script object to scriptClass.
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336
void setPrototype(const QScriptValue &prototype)
If this QScriptValue is an object, sets the internal prototype (__proto__ property) of this object to...
static QScriptValue prototype(QScriptEngine *)
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57
QScriptValue newVariant(const QVariant &value)
Creates a QtScript object holding the given variant value.
void setData(const QScriptValue &data)
Sets the internal data of this QScriptValue object.

◆ isNull()

bool NodeList::isNull ( )

Definition at line 849 of file qdeclarativexmlhttprequest.cpp.

Referenced by length(), and NodeListClass::queryProperty().

850 {
851  return d == 0;
852 }

◆ length()

QScriptValue NodeList::length ( QScriptContext context,
QScriptEngine engine 
)
static

Definition at line 797 of file qdeclarativexmlhttprequest.cpp.

798 {
799  NodeList list = qscriptvalue_cast<NodeList>(context->thisObject().data());
800  if (list.isNull()) return engine->undefinedValue();
801 
802  return QScriptValue(list.d->children.count());
803 }
T qscriptvalue_cast(const QScriptValue &)
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QList< NodeImpl * > children
QScriptValue data() const
Returns the internal data of this QScriptValue object.
QScriptValue undefinedValue()
Returns a QScriptValue of the primitive type Undefined.
QScriptValue thisObject() const
Returns the `this&#39; object associated with this QScriptContext.
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57

◆ operator=()

NodeList& NodeList::operator= ( const NodeList )
private

◆ prototype()

QScriptValue NodeList::prototype ( QScriptEngine engine)
static

Definition at line 805 of file qdeclarativexmlhttprequest.cpp.

Referenced by create().

806 {
807  QScriptValue proto = engine->newObject();
808 
810 
811  return proto;
812 }
QScriptValue newFunction(FunctionSignature signature, int length=0)
Creates a QScriptValue that wraps a native (C++) function.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QScriptValue newObject()
Creates a QtScript object of class Object.
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue&#39;s property with the given name to the given value.
static QScriptValue length(QScriptContext *context, QScriptEngine *engine)
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57

Properties

◆ d

NodeImpl* NodeList::d

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