Qt 4.8
Public Functions | Properties | Friends | List of all members
QDeclarativeDomList Class Reference

The QDeclarativeDomList class represents a list of values assigned to a QML property. More...

#include <qdeclarativedom_p.h>

Public Functions

QList< int > commaPositions () const
 Returns a list of positions of the commas in the QML file. More...
 
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. More...
 
QDeclarativeDomListoperator= (const QDeclarativeDomList &)
 Assign other to this QDeclarativeDomList. More...
 
int position () const
 Returns the position in the input data where the list started, or -1 if the property is invalid. More...
 
 QDeclarativeDomList ()
 Construct an empty QDeclarativeDomList. More...
 
 QDeclarativeDomList (const QDeclarativeDomList &)
 Create a copy of other QDeclarativeDomList. More...
 
QList< QDeclarativeDomValuevalues () const
 Returns the list of QDeclarativeDomValue's. More...
 
 ~QDeclarativeDomList ()
 Destroy the QDeclarativeDomList. More...
 

Properties

QSharedDataPointer< QDeclarativeDomValuePrivated
 

Friends

class QDeclarativeDomValue
 

Detailed Description

The QDeclarativeDomList class represents a list of values assigned to a QML property.

Warning
This function is not part of the public interface.
Lists of values can be assigned to properties.  For example, the following
example assigns multiple objects to Item's "children" property
children: [
Text { },
]
}

Lists can also be implicitly created by assigning multiple QDeclarativeDomValueValueSource{value sources} or constants to a property.

x: 10
running: false
from: 0
to: 100
}
}

Definition at line 317 of file qdeclarativedom_p.h.

Constructors and Destructors

◆ QDeclarativeDomList() [1/2]

QDeclarativeDomList::QDeclarativeDomList ( )

Construct an empty QDeclarativeDomList.

Definition at line 1609 of file qdeclarativedom.cpp.

1610 {
1611 }

◆ QDeclarativeDomList() [2/2]

QDeclarativeDomList::QDeclarativeDomList ( const QDeclarativeDomList other)

Create a copy of other QDeclarativeDomList.

Definition at line 1616 of file qdeclarativedom.cpp.

1617 : d(other.d)
1618 {
1619 }
QSharedDataPointer< QDeclarativeDomValuePrivate > d

◆ ~QDeclarativeDomList()

QDeclarativeDomList::~QDeclarativeDomList ( )

Destroy the QDeclarativeDomList.

Definition at line 1624 of file qdeclarativedom.cpp.

1625 {
1626 }

Functions

◆ commaPositions()

QList< int > QDeclarativeDomList::commaPositions ( ) const

Returns a list of positions of the commas in the QML file.

Definition at line 1690 of file qdeclarativedom.cpp.

1691 {
1692  if (d && d->property)
1693  return d->property->listCommaPositions;
1694  else
1695  return QList<int>();
1696 }
QSharedDataPointer< QDeclarativeDomValuePrivate > d
QDeclarativeParser::Property * property

◆ length()

int QDeclarativeDomList::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.

Definition at line 1679 of file qdeclarativedom.cpp.

1680 {
1681  if (d && d->property)
1682  return d->property->listValueRange.length;
1683  else
1684  return -1;
1685 }
QSharedDataPointer< QDeclarativeDomValuePrivate > d
QDeclarativeParser::Property * property

◆ operator=()

QDeclarativeDomList & QDeclarativeDomList::operator= ( const QDeclarativeDomList other)

Assign other to this QDeclarativeDomList.

Definition at line 1631 of file qdeclarativedom.cpp.

1632 {
1633  d = other.d;
1634  return *this;
1635 }
QSharedDataPointer< QDeclarativeDomValuePrivate > d

◆ position()

int QDeclarativeDomList::position ( ) const

Returns the position in the input data where the list started, or -1 if the property is invalid.

Definition at line 1667 of file qdeclarativedom.cpp.

1668 {
1669  if (d && d->property) {
1670  return d->property->listValueRange.offset;
1671  } else
1672  return -1;
1673 }
QSharedDataPointer< QDeclarativeDomValuePrivate > d
QDeclarativeParser::Property * property

◆ values()

QList< QDeclarativeDomValue > QDeclarativeDomList::values ( ) const

Returns the list of QDeclarativeDomValue's.

Definition at line 1640 of file qdeclarativedom.cpp.

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 }
QSharedDataPointer< QDeclarativeDomValuePrivate > d
The QDeclarativeDomValue class represents a generic Qml value.
QSharedDataPointer< QDeclarativeDomValuePrivate > d
QDeclarativeParser::Property * property
QDeclarativeParser::Value * value
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

Friends and Related Functions

◆ QDeclarativeDomValue

friend class QDeclarativeDomValue
friend

Definition at line 333 of file qdeclarativedom_p.h.

Properties

◆ d

QSharedDataPointer<QDeclarativeDomValuePrivate> QDeclarativeDomList::d
private

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