Qt 4.8
qdeclarativedom.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "private/qdeclarativedom_p.h"
43 #include "private/qdeclarativedom_p_p.h"
44 
45 #include "private/qdeclarativecompiler_p.h"
46 #include "private/qdeclarativeengine_p.h"
47 #include "private/qdeclarativescriptparser_p.h"
48 #include "private/qdeclarativeglobal_p.h"
49 
50 #include <QtCore/QByteArray>
51 #include <QtCore/QDebug>
52 #include <QtCore/QString>
53 
55 
57 : root(0)
58 {
59 }
60 
62 {
63  if (root) root->release();
64 }
65 
103 {
104 }
105 
110 : d(other.d)
111 {
112 }
113 
118 {
119 }
120 
125 {
126  d = other.d;
127  return *this;
128 }
129 
134 {
135  return d->imports;
136 }
137 
146 {
147  d->errors.clear();
148  d->imports.clear();
149 
152 
153  if(td->isError()) {
154  d->errors = td->errors();
155  td->release();
156  return false;
157  } else if(!td->isCompleteOrError()) {
159  error.setDescription(QLatin1String("QDeclarativeDomDocument supports local types only"));
160  d->errors << error;
161  td->release();
162  return false;
163  }
164 
165  for (int i = 0; i < td->parser().imports().size(); ++i) {
166  QDeclarativeScriptParser::Import parserImport = td->parser().imports().at(i);
167  QDeclarativeDomImport domImport;
168  domImport.d->type = static_cast<QDeclarativeDomImportPrivate::Type>(parserImport.type);
169  domImport.d->uri = parserImport.uri;
170  domImport.d->qualifier = parserImport.qualifier;
171  domImport.d->version = parserImport.version;
172  d->imports += domImport;
173  }
174 
175  if (td->parser().tree()) {
176  d->root = td->parser().tree();
177  d->root->addref();
178  }
179 
180  td->release();
181  return true;
182 }
183 
191 {
192  return d->errors;
193 }
194 
209 {
211  rv.d->object = d->root;
212  if (rv.d->object) rv.d->object->addref();
213  return rv;
214 }
215 
217 : property(0)
218 {
219 }
220 
222 {
223  if (property) property->release();
224 }
225 
227  valid(false)
228 {
229 }
230 
232 {
233  if (valid && property.defaultValue) property.defaultValue->release();
234 }
235 
255 {
256 }
257 
262 : d(other.d)
263 {
264 }
265 
270 {
271 }
272 
277 {
278  d = other.d;
279  return *this;
280 }
281 
286 {
287  return d->property != 0;
288 }
289 
290 
312 {
313  return d->propertyName;
314 }
315 
334 {
335  if (d->propertyName.isEmpty()) return QList<QByteArray>();
336  else return d->propertyName.split('.');
337 }
338 
355 {
356  return d->property && d->property->isDefault;
357 }
358 
364 {
366  if (d->property) {
367  rv.d->property = d->property;
368  if (d->property->values.count())
369  rv.d->value = d->property->values.at(0);
370  else
371  rv.d->value = d->property->onValues.at(0);
372  rv.d->property->addref();
373  rv.d->value->addref();
374  }
375  return rv;
376 }
377 
383 {
384  if (d && d->property) {
385  return d->property->location.range.offset;
386  } else
387  return -1;
388 }
389 
395 {
396  if (d && d->property)
397  return d->property->location.range.length;
398  else
399  return -1;
400 }
401 
407 {
408 }
409 
414  d(other.d)
415 {
416 }
417 
422 {
423 }
424 
429 {
430  d = other.d;
431  return *this;
432 }
433 
435 {
436  return d && d->valid;
437 }
438 
452 {
453  if (isValid())
454  return d->property.name;
455  else
456  return QByteArray();
457 }
458 
465 {
466  if (isValid()) {
467  switch (d->property.type) {
469  return QMetaType::type("bool");
470 
472  return QMetaType::type("QColor");
473 
475  return QMetaType::type("QTime");
476 
478  return QMetaType::type("QDate");
479 
481  return QMetaType::type("QDateTime");
482 
484  return QMetaType::type("int");
485 
487  return sizeof(qreal) == sizeof(double) ? QMetaType::type("double") : QMetaType::type("float");
488 
490  return QMetaType::type("QString");
491 
493  return QMetaType::type("QUrl");
494 
496  return QMetaType::type("QVariant");
497 
498  default:
499  break;
500  }
501  }
502 
503  return -1;
504 }
505 
507 {
508  if (isValid())
509  return d->property.customType;
510 
511  return QByteArray();
512 }
513 
530 {
531  if (isValid())
532  return d->property.isDefaultProperty;
533  else
534  return false;
535 }
536 
541 {
543 
544  if (isValid() && d->property.defaultValue) {
546  rp.d->propertyName = propertyName();
547  rp.d->property->addref();
548  }
549 
550  return rp;
551 }
552 
558 {
559  if (isValid())
561  else
562  return false;
563 }
564 
570 {
571  if (isValid()) {
572  return d->property.location.range.offset;
573  } else
574  return -1;
575 }
576 
582 {
583  if (isValid())
584  return d->property.location.range.length;
585  else
586  return -1;
587 }
588 
590 : object(0)
591 {
592 }
593 
595 {
596  if (object) object->release();
597 }
598 
601 {
602  Properties rv;
603 
605  object->properties.begin();
606  iter != object->properties.end();
607  ++iter) {
608 
609  rv << properties(*iter);
610 
611  }
612  return rv;
613 }
614 
617 {
618  Properties rv;
619 
620  if (property->value) {
621 
623  property->value->properties.begin();
624  iter != property->value->properties.end();
625  ++iter) {
626 
627  rv << properties(*iter);
628 
629  }
630 
631  QByteArray name(property->name + '.');
632  for (Properties::Iterator iter = rv.begin(); iter != rv.end(); ++iter)
633  iter->second.prepend(name);
634 
635  } else {
636  rv << qMakePair(property, property->name);
637  }
638 
639  return rv;
640 }
641 
676 {
677 }
678 
683 : d(other.d)
684 {
685 }
686 
691 {
692 }
693 
698 {
699  d = other.d;
700  return *this;
701 }
702 
707 {
708  return d->object != 0;
709 }
710 
720 {
721  if (d->object) return d->object->typeName;
722  else return QByteArray();
723 }
724 
734 {
735  if (d->object)
736  return d->object->className;
737  else
738  return QByteArray();
739 }
740 
742 {
743  if (d->object)
744  return d->object->majorVersion;
745  else
746  return -1;
747 }
748 
750 {
751  if (d->object)
752  return d->object->minorVersion;
753  else
754  return -1;
755 }
756 
767 {
768  if (d->object) {
769  return d->object->id;
770  } else {
771  return QString();
772  }
773 }
774 
787 {
789 
790  if (!d->object || isComponent())
791  return rv;
792 
794  for (int ii = 0; ii < properties.count(); ++ii) {
795 
796  QDeclarativeDomProperty domProperty;
797  domProperty.d->property = properties.at(ii).first;
798  domProperty.d->property->addref();
799  domProperty.d->propertyName = properties.at(ii).second;
800  rv << domProperty;
801 
802  }
803 
804  if (d->object->defaultProperty) {
805  QDeclarativeDomProperty domProperty;
806  domProperty.d->property = d->object->defaultProperty;
807  domProperty.d->property->addref();
808  domProperty.d->propertyName = d->object->defaultProperty->name;
809  rv << domProperty;
810  }
811 
812  return rv;
813 }
814 
827 {
829  for (int ii = 0; ii < props.count(); ++ii)
830  if (props.at(ii).propertyName() == name)
831  return props.at(ii);
832  return QDeclarativeDomProperty();
833 }
834 
836 {
838 
839  for (int i = 0; i < d->object->dynamicProperties.size(); ++i) {
842  p.d->property = d->object->dynamicProperties.at(i);
843  p.d->valid = true;
844 
845  if (p.d->property.defaultValue)
847 
848  properties.append(p);
849  }
850 
851  return properties;
852 }
853 
855 {
857 
858  if (!isValid())
859  return p;
860 
861  for (int i = 0; i < d->object->dynamicProperties.size(); ++i) {
862  if (d->object->dynamicProperties.at(i).name == name) {
864  p.d->property = d->object->dynamicProperties.at(i);
866  p.d->valid = true;
867  }
868  }
869 
870  return p;
871 }
872 
884 {
885  return false;
886 }
887 
895 {
896  return QByteArray();
897 }
898 
907 {
908  return (d->object && (d->object->typeName == "Qt/Component" || d->object->typeName == "QtQuick/Component"));
909 }
910 
919 {
921  if (isComponent())
922  rv.d = d;
923  return rv;
924 }
925 
931 {
932  if (d && d->object)
933  return d->object->location.range.offset;
934  else
935  return -1;
936 }
937 
943 {
944  if (d && d->object)
945  return d->object->location.range.length;
946  else
947  return -1;
948 }
949 
950 // Returns the URL of the type, if it is an external type, or an empty URL if
951 // not
953 {
954  if (d && d->object)
955  return d->object->url;
956  else
957  return QUrl();
958 }
959 
961 : value(0)
962 {
963 }
964 
966 {
967  if (value) value->release();
968 }
969 
996 {
997 }
998 
1003 : d(other.d)
1004 {
1005 }
1006 
1011 {
1012 }
1013 
1018 {
1019  d = other.d;
1020  return *this;
1021 }
1022 
1032 {
1033  if (d->value) return d->value->primitive();
1034  else return QString();
1035 }
1036 
1058 {
1059 }
1060 
1065 : d(other.d)
1066 {
1067 }
1068 
1073 {
1074 }
1075 
1080 {
1081  d = other.d;
1082  return *this;
1083 }
1084 
1094 {
1095  if (d->value)
1096  return d->value->value.asScript();
1097  else
1098  return QString();
1099 }
1100 
1130 {
1131 }
1132 
1137 : d(other.d)
1138 {
1139 }
1140 
1145 {
1146 }
1147 
1152 {
1153  d = other.d;
1154  return *this;
1155 }
1156 
1173 {
1175  if (d->value) {
1176  rv.d->object = d->value->object;
1177  rv.d->object->addref();
1178  }
1179  return rv;
1180 }
1181 
1207 {
1208 }
1209 
1214 : d(other.d)
1215 {
1216 }
1217 
1222 {
1223 }
1224 
1229 {
1230  d = other.d;
1231  return *this;
1232 }
1233 
1246 {
1248  if (d->value) {
1249  rv.d->object = d->value->object;
1250  rv.d->object->addref();
1251  }
1252  return rv;
1253 }
1254 
1256 : property(0), value(0)
1257 {
1258 }
1259 
1261 {
1262  if (property) property->release();
1263  if (value) value->release();
1264 }
1265 
1317 {
1318 }
1319 
1324 : d(other.d)
1325 {
1326 }
1327 
1332 {
1333 }
1334 
1339 {
1340  d = other.d;
1341  return *this;
1342 }
1343 
1365 {
1366  if (d->property)
1368  (d->property && (d->property->values.count() + d->property->onValues.count()) > 1))
1369  return List;
1370 
1371  QDeclarativeParser::Value *value = d->value;
1372  if (!value && !d->property)
1373  return Invalid;
1374 
1375  switch(value->type) {
1377  return Invalid;
1379  return Literal;
1381  return PropertyBinding;
1383  return ValueSource;
1385  return ValueInterceptor;
1387  return Object;
1389  return Invalid;
1391  return Literal;
1393  return Literal;
1394  }
1395  return Invalid;
1396 }
1397 
1402 {
1403  return type() == Invalid;
1404 }
1405 
1410 {
1411  return type() == Literal;
1412 }
1413 
1418 {
1419  return type() == PropertyBinding;
1420 }
1421 
1426 {
1427  return type() == ValueSource;
1428 }
1429 
1434 {
1435  return type() == ValueInterceptor;
1436 }
1437 
1442 {
1443  return type() == Object;
1444 }
1445 
1450 {
1451  return type() == List;
1452 }
1453 
1461 {
1463  if (type() == Literal) {
1464  rv.d->value = d->value;
1465  rv.d->value->addref();
1466  }
1467  return rv;
1468 }
1469 
1477 {
1479  if (type() == PropertyBinding) {
1480  rv.d->value = d->value;
1481  rv.d->value->addref();
1482  }
1483  return rv;
1484 }
1485 
1493 {
1495  if (type() == ValueSource) {
1496  rv.d->value = d->value;
1497  rv.d->value->addref();
1498  }
1499  return rv;
1500 }
1501 
1509 {
1511  if (type() == ValueInterceptor) {
1512  rv.d->value = d->value;
1513  rv.d->value->addref();
1514  }
1515  return rv;
1516 }
1517 
1525 {
1527  if (type() == Object) {
1528  rv.d->object = d->value->object;
1529  rv.d->object->addref();
1530  }
1531  return rv;
1532 }
1533 
1541 {
1543  if (type() == List) {
1544  rv.d = d;
1545  }
1546  return rv;
1547 }
1548 
1554 {
1555  if (type() == Invalid)
1556  return -1;
1557  else
1558  return d->value->location.range.offset;
1559 }
1560 
1566 {
1567  if (type() == Invalid)
1568  return -1;
1569  else
1570  return d->value->location.range.length;
1571 }
1572 
1610 {
1611 }
1612 
1617 : d(other.d)
1618 {
1619 }
1620 
1625 {
1626 }
1627 
1632 {
1633  d = other.d;
1634  return *this;
1635 }
1636 
1641 {
1643  if (!d->property)
1644  return rv;
1645 
1646  for (int ii = 0; ii < d->property->values.count(); ++ii) {
1648  v.d->value = d->property->values.at(ii);
1649  v.d->value->addref();
1650  rv << v;
1651  }
1652 
1653  for (int ii = 0; ii < d->property->onValues.count(); ++ii) {
1655  v.d->value = d->property->onValues.at(ii);
1656  v.d->value->addref();
1657  rv << v;
1658  }
1659 
1660  return rv;
1661 }
1662 
1668 {
1669  if (d && d->property) {
1670  return d->property->listValueRange.offset;
1671  } else
1672  return -1;
1673 }
1674 
1680 {
1681  if (d && d->property)
1682  return d->property->listValueRange.length;
1683  else
1684  return -1;
1685 }
1686 
1691 {
1692  if (d && d->property)
1693  return d->property->listCommaPositions;
1694  else
1695  return QList<int>();
1696 }
1697 
1728 {
1729 }
1730 
1735 : QDeclarativeDomObject(other)
1736 {
1737 }
1738 
1743 {
1744 }
1745 
1750 {
1751  static_cast<QDeclarativeDomObject &>(*this) = other;
1752  return *this;
1753 }
1754 
1771 {
1773  if (d->object) {
1774  QDeclarativeParser::Object *obj = 0;
1775  if (d->object->defaultProperty &&
1776  d->object->defaultProperty->values.count() == 1 &&
1777  d->object->defaultProperty->values.at(0)->object)
1778  obj = d->object->defaultProperty->values.at(0)->object;
1779 
1780  if (obj) {
1781  rv.d->object = obj;
1782  rv.d->object->addref();
1783  }
1784  }
1785 
1786  return rv;
1787 }
1788 
1790 : type(File)
1791 {
1792 }
1793 
1795 {
1796 }
1797 
1812 {
1813 }
1814 
1819 : d(other.d)
1820 {
1821 }
1822 
1827 {
1828 }
1829 
1834 {
1835  d = other.d;
1836  return *this;
1837 }
1838 
1843 {
1844  return static_cast<QDeclarativeDomImport::Type>(d->type);
1845 }
1846 
1851 {
1852  return d->uri;
1853 }
1854 
1859 {
1860  return d->version;
1861 }
1862 
1867 {
1868  return d->qualifier;
1869 }
1870 
double d
Definition: qnumeric_p.h:62
Type
The type of the QDeclarativeDomValue node.
~QDeclarativeDomValueValueSource()
Destroy the QDeclarativeDomValueValueSource.
bool isError() const
Returns true if the status is Error.
QString binding() const
Return the binding expression.
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
Definition: qhash.h:395
QString literal() const
Return the literal value.
The QDeclarativeDomProperty class represents one property assignment in the QML DOM tree...
int type
Definition: qmetatype.cpp:239
bool isDefaultProperty() const
Return true if this property is used as a default property in the QML document.
double qreal
Definition: qglobal.h:1193
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
~QDeclarativeDomList()
Destroy the QDeclarativeDomList.
bool isValid() const
Returns true if this is a valid QDeclarativeDomObject, false otherwise.
~QDeclarativeDomProperty()
Destroy the QDeclarativeDomProperty.
void setDescription(const QString &)
Sets the error description.
int position() const
Returns the position in the input data where the list started, or -1 if the property is invalid...
The QDeclarativeDomImport class represents an import statement.
The QDeclarativeDomList class represents a list of values assigned to a QML property.
~QDeclarativeDomImport()
Destroy the QDeclarativeDomImport.
int position() const
Returns the position in the input data where the property value startd, or -1 if the value is invalid...
QDeclarativeDomValueValueSource()
Construct an empty QDeclarativeDomValueValueSource.
bool isObject() const
Returns true if this is an object value, otherwise false.
QList< QDeclarativeDomProperty > properties() const
Returns the list of assigned properties on this object.
QDeclarativeParser::Value * value
QDeclarativeParser::Object * root
bool isComponent() const
Returns true if this object is a sub-component object.
QSharedDataPointer< QDeclarativeDomImportPrivate > d
#define error(msg)
QList< QDeclarativeError > errors() const
Returns the last load errors.
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QDeclarativeDomValueValueSource & operator=(const QDeclarativeDomValueValueSource &)
Assign other to this QDeclarativeDomValueValueSource.
QDeclarativeDomObject()
Construct an invalid QDeclarativeDomObject.
QDeclarativeDomComponent & operator=(const QDeclarativeDomComponent &)
Assign other to this QDeclarativeDomComponent.
QSharedDataPointer< QDeclarativeDomValuePrivate > d
QByteArray propertyName() const
Return the name of this dynamic property.
bool isInvalid() const
Returns true if this is an invalid value, otherwise false.
QDeclarativeDomList toList() const
Returns a QDeclarativeDomList if this value is a list type, otherwise returns an invalid QDeclarative...
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlist.h:267
The QDeclarativeDomDocument class represents the root of a QML document.
QDeclarativeDomObject toObject() const
Returns a QDeclarativeDomObject if this value is an object assignment type, otherwise returns an inva...
QDeclarativeDomValue value() const
Returns the QDeclarativeDomValue that is assigned to this property, or an invalid QDeclarativeDomValu...
int objectTypeMajorVersion() const
bool isCompleteOrError() const
Returns true if the status is Complete or Error.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QDeclarativeDomDynamicProperty()
Construct an invalid QDeclarativeDomDynamicProperty.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QDeclarativeDomDynamicProperty & operator=(const QDeclarativeDomDynamicProperty &)
Assign other to this QDeclarativeDomDynamicProperty.
QDeclarativeDomObject object() const
Return the value source object.
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
QDeclarativeTypeLoader typeLoader
The QString class provides a Unicode character string.
Definition: qstring.h:83
QDeclarativeDomValueValueInterceptor()
Construct an empty QDeclarativeDomValueValueInterceptor.
QList< QDeclarativeError > errors
Type type() const
Returns the type of the import.
~QDeclarativeDomValueLiteral()
Destroy the QDeclarativeDomValueLiteral.
The QDeclarativeDomValueBinding class represents a property binding.
~QDeclarativeDomValueValueInterceptor()
Destroy the QDeclarativeDomValueValueInterceptor.
int position() const
Returns the position in the input data where the property assignment started , or -1 if the property...
QDeclarativeDomValue()
Construct an invalid QDeclarativeDomValue.
QDeclarativeDomValueLiteral()
Construct an empty QDeclarativeDomValueLiteral.
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
int length() const
Returns the length in the input data from where the property assignment star ted upto the end of it...
The QDeclarativeDomValue class represents a generic Qml value.
The QDeclarativeDomComponent class represents sub-component within a QML document.
QDeclarativeDomValueValueSource toValueSource() const
Returns a QDeclarativeDomValueValueSource if this value is a property value source type...
QDeclarativeParser::Object::DynamicProperty property
QDeclarativeParser::Object * object
int length() const
Returns the length in the input data from where the property ID started upto the end of it...
QSharedDataPointer< QDeclarativeDomObjectPrivate > d
QByteArray propertyName() const
Return the name of this property.
int propertyType() const
Returns the type of the dynamic property.
bool isBinding() const
Returns true if this is a property binding value, otherwise false.
QList< int > commaPositions() const
Returns a list of positions of the commas in the QML file.
bool isValueSource() const
Returns true if this is a value source value, otherwise false.
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QDeclarativeDomDocument & operator=(const QDeclarativeDomDocument &)
Assign other to this QDeclarativeDomDocument.
~QDeclarativeDomValue()
Destroy the QDeclarativeDomValue.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
int length() const
Returns the length in the input data from where the property ID started upto the end of it...
Type type() const
Returns the type of this QDeclarativeDomValue.
QSharedDataPointer< QDeclarativeDomValuePrivate > d
QDeclarativeDomValueValueInterceptor toValueInterceptor() const
Returns a QDeclarativeDomValueValueInterceptor if this value is a property value interceptor type...
QList< DynamicProperty > dynamicProperties
QDeclarativeDomValueBinding toBinding() const
Returns a QDeclarativeDomValueBinding if this value is a property binding type, otherwise returns an ...
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:270
const char * name
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QString uri() const
Returns the URI of the import (e.g.
QDeclarativeDomValueLiteral toLiteral() const
Returns a QDeclarativeDomValueLiteral if this value is a literal type, otherwise returns an invalid Q...
QString version() const
Returns the version specified by the import.
bool isValid() const
Returns true if this is a valid QDeclarativeDomProperty, false otherwise.
~QDeclarativeDomObject()
Destroy the QDeclarativeDomObject.
QSharedDataPointer< QDeclarativeDomDocumentPrivate > d
static const char * data(const QByteArray &arr)
The QDeclarativeError class encapsulates a QML error.
int position() const
Returns the position in the input data where the property ID startd, or -1 if the property is invalid...
QDeclarativeDomValue & operator=(const QDeclarativeDomValue &)
Assign other to this QDeclarativeDomValue.
QDeclarativeDomProperty()
Construct an invalid QDeclarativeDomProperty.
void clear()
Removes all items from the list.
Definition: qlist.h:764
static int type(const char *typeName)
Returns a handle to the type called typeName, or 0 if there is no such type.
Definition: qmetatype.cpp:607
QByteArray objectClassName() const
Returns the type name as referenced in the qml file.
QDeclarativeDomValueBinding()
Construct an empty QDeclarativeDomValueBinding.
int position() const
Returns the position in the input data where the property ID startd, or 0 if the property is invalid...
QDeclarativeDomValueValueInterceptor & operator=(const QDeclarativeDomValueValueInterceptor &)
Assign other to this QDeclarativeDomValueValueInterceptor.
QDeclarativeDomProperty property(const QByteArray &) const
Returns the object&#39;s name property if a value has been assigned to it, or an invalid QDeclarativeDomP...
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181
bool isList() const
Returns true if this is a list value, otherwise false.
int objectTypeMinorVersion() const
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d
QSharedDataPointer< QDeclarativeDomPropertyPrivate > d
QDeclarativeDomObject componentRoot() const
Returns the component&#39;s root object.
QList< QDeclarativeDomValue > values() const
Returns the list of QDeclarativeDomValue&#39;s.
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
QDeclarativeDomValueLiteral & operator=(const QDeclarativeDomValueLiteral &)
Assign other to this QDeclarativeDomValueLiteral.
bool isDefaultProperty() const
Return true if this property is used as a default property in the QML document.
int length() const
Returns the length in the input data from where the property value started u pto the end of it...
QDeclarativeDomProperty defaultValue() const
Returns the default value as a QDeclarativeDomProperty.
QDeclarativeDomImport & operator=(const QDeclarativeDomImport &)
Assign other to this QDeclarativeDomImport.
~QDeclarativeDomDynamicProperty()
Destroy the QDeclarativeDomDynamicProperty.
QDeclarativeParser::Property * property
~QDeclarativeDomComponent()
Destroy the QDeclarativeDomComponent.
QList< QDeclarativeError > errors() const
Return the errors on this blob.
QList< QDeclarativeDomDynamicProperty > dynamicProperties() const
QList< QByteArray > propertyNameParts() const
Return the name of this property, split into multiple parts in the case of dot properties.
The QDeclarativeEngine class provides an environment for instantiating QML components.
QByteArray objectType() const
Returns the fully-qualified type name of this object.
QDeclarativeDomComponent()
Construct an empty QDeclarativeDomComponent.
The QDeclarativeDomValueLiteral class represents a literal value.
The QDeclarativeDomValueValueInterceptor class represents a value interceptor assignment value...
QDeclarativeDomDynamicProperty dynamicProperty(const QByteArray &) const
bool load(QDeclarativeEngine *, const QByteArray &, const QUrl &=QUrl())
Loads a QDeclarativeDomDocument from data.
QDeclarativeDomObject & operator=(const QDeclarativeDomObject &)
Assign other to this QDeclarativeDomObject.
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
Definition: qpair.h:102
QDeclarativeDomList & operator=(const QDeclarativeDomList &)
Assign other to this QDeclarativeDomList.
int length() const
Returns the length in the input data from where the list started upto the end of it, or 0 if the property is invalid.
QSharedDataPointer< QDeclarativeDomDynamicPropertyPrivate > d
QDeclarativeDomDocument()
Construct an empty QDeclarativeDomDocument.
const char * property
Definition: qwizard.cpp:138
The QDeclarativeDomObject class represents an object instantiation.
~QDeclarativeDomDocument()
Destroy the QDeclarativeDomDocument.
QString objectId() const
Returns the QML id assigned to this object, or an empty QByteArray if no id has been assigned...
QDeclarativeDomProperty & operator=(const QDeclarativeDomProperty &)
Assign other to this QDeclarativeDomProperty.
QDeclarativeTypeData * get(const QUrl &url)
Returns a QDeclarativeTypeData for the specified url.
bool isCustomType() const
Returns true if this object is a custom type.
bool isLiteral() const
Returns true if this is a literal value, otherwise false.
QDeclarativeParser::Property * property
QDeclarativeDomValueBinding & operator=(const QDeclarativeDomValueBinding &)
Assign other to this QDeclarativeDomValueBinding.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
The QDeclarativeDomValueValueSource class represents a value source assignment value.
const QDeclarativeScriptParser & parser() const
QList< QDeclarativeDomImport > imports() const
Returns all import statements in qml.
QByteArray customTypeData() const
If this object represents a custom type, returns the data associated with the custom type...
QDeclarativeDomImport()
Construct an empty QDeclarativeDomImport.
QString qualifier() const
Returns the (optional) qualifier string (the token following the &#39;as&#39; keyword) of the import...
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d
QDeclarativeDomObject object() const
Return the value interceptor object.
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d
QDeclarativeDomList()
Construct an empty QDeclarativeDomList.
~QDeclarativeDomValueBinding()
Destroy the QDeclarativeDomValueBinding.
QDeclarativeDomObject rootObject() const
Returns the document&#39;s root object, or an invalid QDeclarativeDomObject if the document has no root...
bool isAlias() const
Returns true if this dynamic property is an alias for another property, false otherwise.
QDeclarativeParser::Object * tree() const
QDeclarativeParser::Value * value
QDeclarativeDomComponent toComponent() const
Returns a QDeclarativeDomComponent for this object if it is a sub-component, or an invalid QDeclarati...
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d
QHash< QByteArray, Property * > properties
bool isValueInterceptor() const
Returns true if this is a value interceptor value, otherwise false.
QList< QDeclarativeDomImport > imports