42 #include "private/qdeclarativerepeater_p.h" 43 #include "private/qdeclarativerepeater_p_p.h" 45 #include "private/qdeclarativevisualitemmodel_p.h" 46 #include <private/qdeclarativeglobal_p.h> 53 : model(0), ownModel(false)
192 return d->dataSource;
198 if (
d->dataSource == model)
215 if (
object && (vim = qobject_cast<QDeclarativeVisualModel *>(
object))) {
227 dataModel->setModel(model);
285 return dataModel->delegate();
295 if (delegate == dataModel->delegate())
303 dataModel->setDelegate(delegate);
321 return d->model->count();
338 if (index >= 0 && index < d->deletables.count())
339 return d->deletables[index];
367 while (
d->deletables.count() > 0) {
371 d->model->release(item);
374 d->deletables.clear();
388 for (
int ii = 0; ii <
count(); ++ii) {
394 d->deletables << item;
405 for (
int i = 0; i <
count; ++i) {
406 int modelIndex = index + i;
411 if (modelIndex < d->deletables.count())
415 d->deletables.insert(modelIndex, item);
431 d->model->release(item);
443 if (from + count >
d->deletables.count()) {
448 int removedCount =
count;
449 while (removedCount--)
450 removed <<
d->deletables.takeAt(from);
451 for (
int i = 0; i <
count; ++i)
452 d->deletables.insert(to + i, removed.
at(i));
453 d->deletables.last()->stackBefore(
this);
454 for (
int i =
d->model->count()-1; i > 0; --i) {
The QVariant class acts like a union for the most common Qt data types.
QDeclarativeRepeater(QDeclarativeItem *parent=0)
This handler is called when an item is added to the repeater.
#define QT_END_NAMESPACE
This macro expands to.
QDeclarativeParserStatus ** d
void itemAdded(int index, QDeclarativeItem *item)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
virtual ~QDeclarativeRepeater()
void setDelegate(QDeclarativeComponent *)
void setModel(const QVariant &)
void itemsInserted(int, int)
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
void itemsMoved(int, int, int)
The QObject class is the base class of all Qt objects.
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is not called during initial widget p...
void itemRemoved(int index, QDeclarativeItem *item)
void setParentItem(QDeclarativeItem *parent)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QDeclarativeComponent class encapsulates a QML component definition.
The QDeclarativeItem class provides the most basic of all visual items in QML.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
QDeclarativeVisualModel * model
const T & at(int i) const
Returns the item at index position i in the list.
QDeclarativeComponent * delegate() const
QDeclarativeRepeaterPrivate()
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
void itemsRemoved(int, int)
QDeclarativeItem * parentItem() const
Returns the QDeclarativeItem parent of this item.
virtual QVariant itemChange(GraphicsItemChange, const QVariant &)
Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is not called during initial widget p...
void stackBefore(const QGraphicsItem *sibling)
Stacks this item before sibling, which must be a sibling item (i.
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
virtual void componentComplete()
T qvariant_cast(const QVariant &)
virtual void componentComplete()
~QDeclarativeRepeaterPrivate()
Q_INVOKABLE QDeclarativeItem * itemAt(int index) const
The QList class is a template class that provides lists.