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

#include <qdeclarativecustomparser_p_p.h>

Static Public Functions

static QDeclarativeCustomParserNode fromObject (QDeclarativeParser::Object *)
 
static QDeclarativeCustomParserProperty fromProperty (QDeclarativeParser::Property *)
 

Public Variables

QDeclarativeParser::Location location
 
QByteArray name
 
QList< QDeclarativeCustomParserPropertyproperties
 

Detailed Description

Definition at line 64 of file qdeclarativecustomparser_p_p.h.

Functions

◆ fromObject()

QDeclarativeCustomParserNode QDeclarativeCustomParserNodePrivate::fromObject ( QDeclarativeParser::Object root)
static

Definition at line 101 of file qdeclarativecustomparser.cpp.

102 {
104  rootNode.d->name = root->typeName;
105  rootNode.d->location = root->location.start;
106 
107  for(QHash<QByteArray, Property *>::Iterator iter = root->properties.begin();
108  iter != root->properties.end();
109  ++iter) {
110 
111  Property *p = *iter;
112 
113  rootNode.d->properties << fromProperty(p);
114  }
115 
116  if (root->defaultProperty)
117  rootNode.d->properties << fromProperty(root->defaultProperty);
118 
119  return rootNode;
120 }
QList< QDeclarativeCustomParserProperty > properties
static QDeclarativeCustomParserProperty fromProperty(QDeclarativeParser::Property *)
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
Definition: qhash.h:330
QDeclarativeCustomParserNodePrivate * d
QHash< QByteArray, Property * > properties

◆ fromProperty()

QDeclarativeCustomParserProperty QDeclarativeCustomParserNodePrivate::fromProperty ( QDeclarativeParser::Property p)
static

Definition at line 123 of file qdeclarativecustomparser.cpp.

Referenced by QDeclarativeCompiler::buildObject().

124 {
126  prop.d->name = p->name;
127  prop.d->isList = (p->values.count() > 1);
128  prop.d->location = p->location.start;
129 
130  if (p->value) {
133  for (int ii = 0; ii < props.count(); ++ii)
134  prop.d->values << QVariant::fromValue(props.at(ii));
135  } else {
136  for(int ii = 0; ii < p->values.count(); ++ii) {
137  QDeclarativeParser::Value *v = p->values.at(ii);
139 
140  if(v->object) {
142  prop.d->values << QVariant::fromValue(node);
143  } else {
144  prop.d->values << QVariant::fromValue(v->value);
145  }
146 
147  }
148  }
149 
150  return prop;
151 }
QList< QDeclarativeCustomParserProperty > properties() const
static QDeclarativeCustomParserNode fromObject(QDeclarativeParser::Object *)
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336
QDeclarativeCustomParserPropertyPrivate * d

Properties

◆ location

QDeclarativeParser::Location QDeclarativeCustomParserNodePrivate::location

◆ name

QByteArray QDeclarativeCustomParserNodePrivate::name

◆ properties

QList<QDeclarativeCustomParserProperty> QDeclarativeCustomParserNodePrivate::properties

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