Qt 4.8
Classes | Functions
qdeclarativeitem.h File Reference
#include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtGui/qgraphicsitem.h>
#include <QtGui/qgraphicstransform.h>
#include <QtGui/qfont.h>
#include <QtGui/qaction.h>

Go to the source code of this file.

Classes

class  QDeclarativeItem
 The QDeclarativeItem class provides the most basic of all visual items in QML. More...
 

Functions

QDebug Q_DECLARATIVE_EXPORT operator<< (QDebug debug, QDeclarativeItem *item)
 
template<typename T >
qobject_cast (QGraphicsObject *o)
 
template<typename T >
qobject_cast (QGraphicsItem *item)
 

Function Documentation

◆ operator<<()

QDebug Q_DECLARATIVE_EXPORT 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.

◆ qobject_cast() [1/2]

template<typename T >
T qobject_cast ( QGraphicsObject o)

Definition at line 203 of file qdeclarativeitem.h.

Referenced by qobject_cast().

204 {
205  QObject *obj = o;
206  return qobject_cast<T>(obj);
207 }
T * qobject_cast(QObject *object)
Definition: qobject.h:375
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111

◆ qobject_cast() [2/2]

template<typename T >
T qobject_cast ( QGraphicsItem item)

Definition at line 211 of file qdeclarativeitem.h.

212 {
213  if (!item) return 0;
214  QObject *o = item->toGraphicsObject();
215  return qobject_cast<T>(o);
216 }
T * qobject_cast(QObject *object)
Definition: qobject.h:375
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QGraphicsObject * toGraphicsObject()
Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object...