Qt 4.8
Classes | Functions | Variables
qdeclarativeitem.cpp File Reference
#include "qdeclarativeitem.h"
#include "private/qdeclarativeevents_p_p.h"
#include <private/qdeclarativeengine_p.h>
#include <private/qgraphicsitem_p.h>
#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <qdeclarativeengine.h>
#include <qdeclarativeopenmetaobject_p.h>
#include <qdeclarativestate_p.h>
#include <qdeclarativeview.h>
#include <qdeclarativestategroup_p.h>
#include <qdeclarativecomponent.h>
#include <qdeclarativeinfo.h>
#include <QDebug>
#include <QPen>
#include <QEvent>
#include <QGraphicsSceneMouseEvent>
#include <QtCore/qnumeric.h>
#include <QtScript/qscriptengine.h>
#include <QtGui/qgraphicstransform.h>
#include <qlistmodelinterface_p.h>
#include <float.h>
#include <moc_qdeclarativeitem.cpp>

Go to the source code of this file.

Classes

class  QDeclarativeItemAccessor
 
class  QElapsedTimerConsistentTimeHack
 
struct  RegisterAnchorLineAtStartup
 

Functions

static QObjectchildren_at_helper (QDeclarativeListProperty< QObject > *prop, int index)
 
static void children_clear_helper (QDeclarativeListProperty< QObject > *prop)
 
static int children_count_helper (QDeclarativeListProperty< QObject > *prop)
 
QDebug operator<< (QDebug debug, QDeclarativeItem *item)
 

Variables

static RegisterAnchorLineAtStartup registerAnchorLineAtStartup
 

Function Documentation

◆ children_at_helper()

static QObject* children_at_helper ( QDeclarativeListProperty< QObject > *  prop,
int  index 
)
inlinestatic

Definition at line 2020 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeItemPrivate::data_at().

2021 {
2022  QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(prop->object));
2023  if (index >= 0 && index < d->children.count())
2024  return d->children.at(index)->toGraphicsObject();
2025  else
2026  return 0;
2027 }
double d
Definition: qnumeric_p.h:62
QGraphicsObject * toGraphicsObject()
Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object...
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
quint16 index
QList< QGraphicsItem * > children

◆ children_clear_helper()

static void children_clear_helper ( QDeclarativeListProperty< QObject > *  prop)
inlinestatic

Definition at line 2029 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeItemPrivate::data_clear().

2030 {
2031  QDeclarativeItemPrivate *d = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(prop->object)));
2032  int childCount = d->children.count();
2033  if (d->componentComplete) {
2034  for (int index = 0 ;index < childCount; index++)
2035  d->children.at(0)->setParentItem(0);
2036  } else {
2037  for (int index = 0 ;index < childCount; index++)
2038  QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, /*newParentVariant=*/0, /*thisPointerVariant=*/0);
2039  }
2040 }
double d
Definition: qnumeric_p.h:62
void setParentItem(QGraphicsItem *parent)
Sets this item&#39;s parent item to newParent.
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 const QGraphicsItemPrivate * get(const QGraphicsItem *item)
quint16 index
QList< QGraphicsItem * > children

◆ children_count_helper()

static int children_count_helper ( QDeclarativeListProperty< QObject > *  prop)
inlinestatic

Definition at line 2014 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeItemPrivate::data_at(), and QDeclarativeItemPrivate::data_count().

2015 {
2016  QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(prop->object));
2017  return d->children.count();
2018 }
double d
Definition: qnumeric_p.h:62
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
QList< QGraphicsItem * > children

◆ operator<<()

QDebug operator<< ( QDebug  debug,
QDeclarativeItem item 
)

Definition at line 4004 of file qdeclarativeitem.cpp.

Referenced by qobject_cast().

4005 {
4006  if (!item) {
4007  debug << "QDeclarativeItem(0)";
4008  return debug;
4009  }
4010 
4011  debug << item->metaObject()->className() << "(this =" << ((void*)item)
4012  << ", parent =" << ((void*)item->parentItem())
4013  << ", geometry =" << QRectF(item->pos(), QSizeF(item->width(), item->height()))
4014  << ", z =" << item->zValue() << ')';
4015  return debug;
4016 }
QPointF pos() const
Returns the position of the item in parent coordinates.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
qreal zValue() const
Returns the Z-value of the item.
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QDeclarativeItem * parentItem() const
Returns the QDeclarativeItem parent of this item.
const char * className() const
Returns the class name.
Definition: qobjectdefs.h:491
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.

Variable Documentation

◆ registerAnchorLineAtStartup

RegisterAnchorLineAtStartup registerAnchorLineAtStartup
static

Definition at line 1822 of file qdeclarativeitem.cpp.