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

Public Functions

bool isNull ()
 
 NamedNodeMap ()
 
 NamedNodeMap (const NamedNodeMap &)
 
 ~NamedNodeMap ()
 

Static Public Functions

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

Public Variables

NodeImpld
 
QList< NodeImpl * > * list
 

Private Functions

NamedNodeMapoperator= (const NamedNodeMap &)
 

Detailed Description

Definition at line 166 of file qdeclarativexmlhttprequest.cpp.

Constructors and Destructors

◆ NamedNodeMap() [1/2]

NamedNodeMap::NamedNodeMap ( )

Definition at line 776 of file qdeclarativexmlhttprequest.cpp.

777 : d(0), list(0)
778 {
779 }
QList< NodeImpl * > * list

◆ NamedNodeMap() [2/2]

NamedNodeMap::NamedNodeMap ( const NamedNodeMap o)

Definition at line 781 of file qdeclarativexmlhttprequest.cpp.

782 : d(o.d), list(o.list)
783 {
784  if (d) A(d);
785 }
#define A(arg)
QList< NodeImpl * > * list

◆ ~NamedNodeMap()

NamedNodeMap::~NamedNodeMap ( )

Definition at line 787 of file qdeclarativexmlhttprequest.cpp.

788 {
789  if (d) D(d);
790 }
#define D(arg)

Functions

◆ create()

QScriptValue NamedNodeMap::create ( QScriptEngine engine,
NodeImpl data,
QList< NodeImpl *> *  list 
)
static

Definition at line 756 of file qdeclarativexmlhttprequest.cpp.

Referenced by Node::attributes().

757 {
758  QScriptValue instance = engine->newObject();
759  instance.setPrototype(NamedNodeMap::prototype(engine));
760 
762  map.d = data;
763  map.list = list;
764  if (data) A(data);
765 
766  instance.setData(engine->newVariant(QVariant::fromValue(map)));
767 
770 
771  instance.setScriptClass(QDeclarativeScriptEngine::get(engine)->namedNodeMapClass);
772 
773  return instance;
774 }
static QScriptValue prototype(QScriptEngine *)
#define A(arg)
static QDeclarativeScriptEngine * get(QScriptEngine *e)
QFuture< void > map(Sequence &sequence, MapFunction function)
static const char * data(const QByteArray &arr)
QScriptValue newObject()
Creates a QtScript object of class Object.
QList< NodeImpl * > * list
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...
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 NamedNodeMap::isNull ( )

Definition at line 792 of file qdeclarativexmlhttprequest.cpp.

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

793 {
794  return d == 0;
795 }

◆ length()

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

Definition at line 739 of file qdeclarativexmlhttprequest.cpp.

Referenced by NodeList::prototype().

740 {
742  if (map.isNull()) return engine->undefinedValue();
743 
744  return QScriptValue(map.list->count());
745 }
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 * > * list
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=()

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

◆ prototype()

QScriptValue NamedNodeMap::prototype ( QScriptEngine engine)
static

Definition at line 747 of file qdeclarativexmlhttprequest.cpp.

Referenced by create().

748 {
749  QScriptValue proto = engine->newObject();
750 
752 
753  return proto;
754 }
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* NamedNodeMap::d

Definition at line 181 of file qdeclarativexmlhttprequest.cpp.

Referenced by create(), isNull(), NamedNodeMap(), and ~NamedNodeMap().

◆ list

QList<NodeImpl *>* NamedNodeMap::list

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