Qt Declarative Module

The QDeclarativeListReference class allows the manipulation of QDeclarativeListProperty properties. More...

This documentation was introduced in Qt 4.7.

Classes

QDeclarativeComponent

Encapsulates a QML component definition

QDeclarativeContext

Defines a context within a QML engine

QDeclarativeEngine

Environment for instantiating QML components

QDeclarativeError

Encapsulates a QML error

QDeclarativeExpression

Evaluates JavaScript in a QML context

QDeclarativeExtensionPlugin

Abstract base for custom QML extension plugins

QDeclarativeImageProvider

Interface for supporting pixmaps and threaded image requests in QML

QDeclarativeItem

The most basic of all visual items in QML

QDeclarativeListProperty

Allows applications to expose list-like properties to QML

QDeclarativeNetworkAccessManagerFactory

Creates QNetworkAccessManager instances for a QML engine

QDeclarativeParserStatus

Updates on the QML parser state

QDeclarativeProperty

Abstracts accessing properties on objects created from QML

QDeclarativePropertyMap

Allows you to set key-value pairs that can be used in QML bindings

QDeclarativePropertyValueSource

Interface for property value sources such as animations and bindings

QDeclarativeScriptString

Encapsulates a script and its context

QDeclarativeView

Widget for displaying a Qt Declarative user interface

Detailed Description

QDeclarativeListReference allows C++ programs to read from, and assign values to a QML list property in a simple and type safe way. A QDeclarativeListReference can be created by passing an object and property name or through a QDeclarativeProperty instance. These two are equivalant:

QDeclarativeListReference ref1(object, "children");

QDeclarativeProperty ref2(object, "children");
QDeclarativeListReference ref2 = qvariant_cast<QDeclarativeListReference>(ref2.read());

Not all QML list properties support all operations. A set of methods, canAppend(), canAt(), canClear() and canCount() allow programs to query whether an operation is supported on a given property.

QML list properties are typesafe. Only QObject's that derive from the correct base class can be assigned to the list. The listElementType() method can be used to query the QMetaObject of the QObject type supported. Attempting to add objects of the incorrect type to a list property will fail.

Like with normal lists, when accessing a list element by index, it is the callers responsibility to ensure that it does not request an out of range element using the count() method before calling at().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.