Qt 4.8
Public Types | Signals | Public Functions | Protected Functions | Properties | List of all members
QDeclarativeItem Class Reference

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

#include <qdeclarativeitem.h>

Inheritance diagram for QDeclarativeItem:
QGraphicsObject QDeclarativeParserStatus QObject QGraphicsItem AccessibleFxItem QDeclarativeFlickable QDeclarativeFlipable QDeclarativeFocusPanel QDeclarativeFocusScope QDeclarativeGestureArea QDeclarativeImplicitSizeItem QDeclarativeLayoutItem QDeclarativeMouseArea QDeclarativePaintedItem QDeclarativeParticles QDeclarativeParticlesPainter QDeclarativePathView QDeclarativePinchArea QDeclarativeRectangle QDeclarativeRepeater ShaderEffectItem ShaderEffectSource

Public Types

enum  TransformOrigin {
  TopLeft, Top, TopRight, Left,
  Center, Right, BottomLeft, Bottom,
  BottomRight
}
 Controls the point about which simple transforms like scale apply. More...
 
- Public Types inherited from QGraphicsItem
enum  { Type = 1, UserType = 65536 }
 
enum  CacheMode { NoCache, ItemCoordinateCache, DeviceCoordinateCache }
 This enum describes QGraphicsItem's cache modes. More...
 
enum  GraphicsItemChange {
  ItemPositionChange, ItemMatrixChange, ItemVisibleChange, ItemEnabledChange,
  ItemSelectedChange, ItemParentChange, ItemChildAddedChange, ItemChildRemovedChange,
  ItemTransformChange, ItemPositionHasChanged, ItemTransformHasChanged, ItemSceneChange,
  ItemVisibleHasChanged, ItemEnabledHasChanged, ItemSelectedHasChanged, ItemParentHasChanged,
  ItemSceneHasChanged, ItemCursorChange, ItemCursorHasChanged, ItemToolTipChange,
  ItemToolTipHasChanged, ItemFlagsChange, ItemFlagsHaveChanged, ItemZValueChange,
  ItemZValueHasChanged, ItemOpacityChange, ItemOpacityHasChanged, ItemScenePositionHasChanged,
  ItemRotationChange, ItemRotationHasChanged, ItemScaleChange, ItemScaleHasChanged,
  ItemTransformOriginPointChange, ItemTransformOriginPointHasChanged
}
 This enum describes the state changes that are notified by QGraphicsItem::itemChange(). More...
 
enum  GraphicsItemFlag {
  ItemIsMovable = 0x1, ItemIsSelectable = 0x2, ItemIsFocusable = 0x4, ItemClipsToShape = 0x8,
  ItemClipsChildrenToShape = 0x10, ItemIgnoresTransformations = 0x20, ItemIgnoresParentOpacity = 0x40, ItemDoesntPropagateOpacityToChildren = 0x80,
  ItemStacksBehindParent = 0x100, ItemUsesExtendedStyleOption = 0x200, ItemHasNoContents = 0x400, ItemSendsGeometryChanges = 0x800,
  ItemAcceptsInputMethod = 0x1000, ItemNegativeZStacksBehindParent = 0x2000, ItemIsPanel = 0x4000, ItemIsFocusScope = 0x8000,
  ItemSendsScenePositionChanges = 0x10000, ItemStopsClickFocusPropagation = 0x20000, ItemStopsFocusHandling = 0x40000
}
 This enum describes different flags that you can set on an item to toggle different features in the item's behavior. More...
 
enum  PanelModality { NonModal, PanelModal, SceneModal }
 This enum specifies the behavior of a modal panel. More...
 

Signals

void activeFocusChanged (bool)
 
void baselineOffsetChanged (qreal)
 
void childrenRectChanged (const QRectF &)
 
void clipChanged (bool)
 
void focusChanged (bool)
 
void implicitHeightChanged ()
 
void implicitWidthChanged ()
 
void parentChanged (QDeclarativeItem *)
 
void smoothChanged (bool)
 
void stateChanged (const QString &)
 
void transformOriginChanged (TransformOrigin)
 
- Signals inherited from QGraphicsObject
void childrenChanged ()
 This signal gets emitted whenever the children list changes. More...
 
void enabledChanged ()
 This signal gets emitted whenever the item get's enabled or disabled. More...
 
void heightChanged ()
 
void opacityChanged ()
 This signal gets emitted whenever the opacity of the item changes. More...
 
void parentChanged ()
 This signal gets emitted whenever the parent of the item changes. More...
 
void rotationChanged ()
 This signal gets emitted whenever the roation of the item changes. More...
 
void scaleChanged ()
 This signal is emitted when the scale of the item changes. More...
 
void visibleChanged ()
 This signal gets emitted whenever the visibility of the item changes. More...
 
void widthChanged ()
 
void xChanged ()
 This signal gets emitted whenever the x position of the item changes. More...
 
void yChanged ()
 This signal gets emitted whenever the y position of the item changes. More...
 
void zChanged ()
 This signal gets emitted whenever the z value of the item changes. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

qreal baselineOffset () const
 
QRectF boundingRect () const
 
Q_INVOKABLE QDeclarativeItemchildAt (qreal x, qreal y) const
 Returns the visible child item at point (x, y), which is in this item's coordinate system, or 0 if there is no such item. More...
 
QRectF childrenRect ()
 
bool clip () const
 
Q_INVOKABLE void forceActiveFocus ()
 Forces active focus on the item. More...
 
bool hasActiveFocus () const
 
bool hasFocus () const
 
qreal height () const
 
qreal implicitHeight () const
 
qreal implicitWidth () const
 
bool keepMouseGrab () const
 Returns a value indicating whether mouse input should remain with this item exclusively. More...
 
Q_INVOKABLE QScriptValue mapFromItem (const QScriptValue &item, qreal x, qreal y) const
 Maps the point (x, y), which is in item's coordinate system, to this item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate. More...
 
Q_INVOKABLE QScriptValue mapToItem (const QScriptValue &item, qreal x, qreal y) const
 Maps the point (x, y), which is in this item's coordinate system, to item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate. More...
 
virtual void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
 
QDeclarativeItemparentItem () const
 Returns the QDeclarativeItem parent of this item. More...
 
 QDeclarativeItem (QDeclarativeItem *parent=0)
 Constructs a QDeclarativeItem with the given parent. More...
 
void resetHeight ()
 
void resetWidth ()
 
void setBaselineOffset (qreal)
 
void setClip (bool)
 
void setFocus (bool)
 
void setHeight (qreal)
 
void setKeepMouseGrab (bool)
 The flag indicating whether the mouse should remain with this item is set to keep. More...
 
void setParentItem (QDeclarativeItem *parent)
 
void setSize (const QSizeF &size)
 
void setSmooth (bool)
 Sets whether the item should be drawn with antialiasing and smooth pixmap filtering to smooth. More...
 
void setTransformOrigin (TransformOrigin)
 Set the transform origin. More...
 
void setWidth (qreal)
 
bool smooth () const
 
QDeclarativeListProperty< QGraphicsTransformtransform ()
 
TransformOrigin transformOrigin () const
 
qreal width () const
 
virtual ~QDeclarativeItem ()
 Destroys the QDeclarativeItem. More...
 
- Public Functions inherited from QGraphicsObject
void grabGesture (Qt::GestureType type, Qt::GestureFlags flags=Qt::GestureFlags())
 Subscribes the graphics object to the given gesture with specific flags. More...
 
 QGraphicsObject (QGraphicsItem *parent=0)
 Constructs a QGraphicsObject with parent. More...
 
void ungrabGesture (Qt::GestureType type)
 Unsubscribes the graphics object from the given gesture. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QGraphicsItem
bool acceptDrops () const
 Returns true if this item can accept drag and drop events; otherwise, returns false. More...
 
Qt::MouseButtons acceptedMouseButtons () const
 Returns the mouse buttons that this item accepts mouse events for. More...
 
bool acceptHoverEvents () const
 Returns true if an item accepts hover events (QGraphicsSceneHoverEvent); otherwise, returns false. More...
 
bool acceptsHoverEvents () const
 Call acceptHoverEvents() instead. More...
 
bool acceptTouchEvents () const
 Returns true if an item accepts touch events; otherwise, returns false. More...
 
virtual void advance (int phase)
 This virtual function is called twice for all items by the QGraphicsScene::advance() slot. More...
 
QRegion boundingRegion (const QTransform &itemToDeviceTransform) const
 Returns the bounding region for this item. More...
 
qreal boundingRegionGranularity () const
 Returns the item's bounding region granularity; a value between and including 0 and 1. More...
 
CacheMode cacheMode () const
 Returns the cache mode for this item. More...
 
QList< QGraphicsItem * > childItems () const
 Returns a list of this item's children. More...
 
QList< QGraphicsItem * > children () const
 Use childItems() instead. More...
 
QRectF childrenBoundingRect () const
 Returns the bounding rect of this item's descendants (i.e., its children, their children, etc.) in local coordinates. More...
 
void clearFocus ()
 Takes keyboard input focus from the item. More...
 
QPainterPath clipPath () const
 Returns this item's clip path, or an empty QPainterPath if this item is not clipped. More...
 
virtual bool collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns true if this item collides with other; otherwise returns false. More...
 
virtual bool collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns true if this item collides with path. More...
 
QList< QGraphicsItem * > collidingItems (Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns a list of all items that collide with this item. More...
 
QGraphicsItemcommonAncestorItem (const QGraphicsItem *other) const
 Returns the closest common ancestor item of this item and other, or 0 if either other is 0, or there is no common ancestor. More...
 
virtual bool contains (const QPointF &point) const
 Returns true if this item contains point, which is in local coordinates; otherwise, false is returned. More...
 
QCursor cursor () const
 Returns the current cursor shape for the item. More...
 
QVariant data (int key) const
 Returns this item's custom data for the key key as a QVariant. More...
 
QTransform deviceTransform (const QTransform &viewportTransform) const
 Returns this item's device transformation matrix, using viewportTransform to map from scene to device coordinates. More...
 
qreal effectiveOpacity () const
 Returns this item's effective opacity, which is between 0. More...
 
void ensureVisible (const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
 If this item is part of a scene that is viewed by a QGraphicsView, this convenience function will attempt to scroll the view to ensure that rect is visible inside the view's viewport. More...
 
void ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin=50, int ymargin=50)
 This convenience function is equivalent to calling ensureVisible(QRectF(x, y, w, h), xmargin, ymargin): More...
 
bool filtersChildEvents () const
 Returns true if this item filters child events (i. More...
 
GraphicsItemFlags flags () const
 Returns this item's flags. More...
 
QGraphicsItemfocusItem () const
 If this item, a child or descendant of this item currently has input focus, this function will return a pointer to that item. More...
 
QGraphicsItemfocusProxy () const
 Returns this item's focus proxy, or 0 if this item has no focus proxy. More...
 
QGraphicsItemfocusScopeItem () const
 Returns this item's focus scope item. More...
 
void grabKeyboard ()
 Grabs the keyboard input. More...
 
void grabMouse ()
 Grabs the mouse input. More...
 
QGraphicsEffectgraphicsEffect () const
 Returns a pointer to this item's effect if it has one; otherwise 0. More...
 
QGraphicsItemGroupgroup () const
 Returns a pointer to this item's item group, or 0 if this item is not member of a group. More...
 
bool handlesChildEvents () const
 Returns true if this item handles child events (i. More...
 
bool hasCursor () const
 Returns true if this item has a cursor set; otherwise, false is returned. More...
 
bool hasFocus () const
 Returns true if this item is active, and it or its focus proxy has keyboard input focus; otherwise, returns false. More...
 
void hide ()
 Hides the item. More...
 
Qt::InputMethodHints inputMethodHints () const
 Returns the current input method hints of this item. More...
 
void installSceneEventFilter (QGraphicsItem *filterItem)
 Installs an event filter for this item on filterItem, causing all events for this item to first pass through filterItem's sceneEventFilter() function. More...
 
bool isActive () const
 Returns true if this item is active; otherwise returns false. More...
 
bool isAncestorOf (const QGraphicsItem *child) const
 Returns true if this item is an ancestor of child (i.e., if this item is child's parent, or one of child's parent's ancestors). More...
 
bool isBlockedByModalPanel (QGraphicsItem **blockingPanel=0) const
 Returns true if this item is blocked by a modal panel, false otherwise. More...
 
bool isClipped () const
 Returns true if this item is clipped. More...
 
bool isEnabled () const
 Returns true if the item is enabled; otherwise, false is returned. More...
 
bool isObscured () const
 Returns true if this item's bounding rect is completely obscured by the opaque shape of any of colliding items above it (i.e., with a higher Z value than this item). More...
 
bool isObscured (const QRectF &rect) const
 Returns true if rect is completely obscured by the opaque shape of any of colliding items above it (i. More...
 
bool isObscured (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling isObscured(QRectF(x, y, w, h)). More...
 
virtual bool isObscuredBy (const QGraphicsItem *item) const
 Returns true if this item's bounding rect is completely obscured by the opaque shape of item. More...
 
bool isPanel () const
 Returns true if the item is a panel; otherwise returns false. More...
 
bool isSelected () const
 Returns true if this item is selected; otherwise, false is returned. More...
 
bool isUnderMouse () const
 Returns true if this item is currently under the mouse cursor in one of the views; otherwise, false is returned. More...
 
bool isVisible () const
 Returns true if the item is visible; otherwise, false is returned. More...
 
bool isVisibleTo (const QGraphicsItem *parent) const
 Returns true if the item is visible to parent; otherwise, false is returned. More...
 
bool isWidget () const
 Returns true if this item is a widget (i. More...
 
bool isWindow () const
 Returns true if the item is a QGraphicsWidget window, otherwise returns false. More...
 
QTransform itemTransform (const QGraphicsItem *other, bool *ok=0) const
 Returns a QTransform that maps coordinates from this item to other. More...
 
QPointF mapFromItem (const QGraphicsItem *item, const QPointF &point) const
 Maps the point point, which is in item's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 Maps the polygon polygon, which is in item's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const
 Maps the path path, which is in item's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapFromItem(item, QPointF(x, y)). More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapFromParent (const QPointF &point) const
 Maps the point point, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromParent (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromParent (const QPainterPath &path) const
 Maps the path path, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromParent (qreal x, qreal y) const
 This convenience function is equivalent to calling mapFromParent(QPointF(x, y)). More...
 
QPolygonF mapFromParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapFromItem(QRectF(x, y, w, h)). More...
 
QPointF mapFromScene (const QPointF &point) const
 Maps the point point, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromScene (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromScene (const QPainterPath &path) const
 Maps the path path, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromScene (qreal x, qreal y) const
 This convenience function is equivalent to calling mapFromScene(QPointF(x, y)). More...
 
QPolygonF mapFromScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapFromScene(QRectF(x, y, w, h)). More...
 
QRectF mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectFromParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectFromParent(QRectF(x, y, w, h)). More...
 
QRectF mapRectFromScene (const QRectF &rect) const
 Maps the rectangle rect, which is in scene coordinates, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectFromScene(QRectF(x, y, w, h)). More...
 
QRectF mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectToParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectToParent(QRectF(x, y, w, h)). More...
 
QRectF mapRectToScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to the scene coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectToScene(QRectF(x, y, w, h)). More...
 
QPointF mapToItem (const QGraphicsItem *item, const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToItem (const QGraphicsItem *item, const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to item's coordinate system, and returns the mapped path. More...
 
QPointF mapToItem (const QGraphicsItem *item, qreal x, qreal y) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapToItem(item, QPointF(x, y)). More...
 
QPolygonF mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapToParent (const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToParent (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToParent (const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped path. More...
 
QPointF mapToParent (qreal x, qreal y) const
 This convenience function is equivalent to calling mapToParent(QPointF(x, y)). More...
 
QPolygonF mapToParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapToParent(QRectF(x, y, w, h)). More...
 
QPointF mapToScene (const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToScene (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToScene (const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped path. More...
 
QPointF mapToScene (qreal x, qreal y) const
 This convenience function is equivalent to calling mapToScene(QPointF(x, y)). More...
 
QPolygonF mapToScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapToScene(QRectF(x, y, w, h)). More...
 
QMatrix matrix () const
 Returns the item's affine transformation matrix. More...
 
void moveBy (qreal dx, qreal dy)
 Moves the item by dx points horizontally, and dy point vertically. More...
 
qreal opacity () const
 Returns this item's local opacity, which is between 0. More...
 
virtual QPainterPath opaqueArea () const
 This virtual function returns a shape representing the area where this item is opaque. More...
 
QGraphicsItempanel () const
 Returns the item's panel, or 0 if this item does not have a panel. More...
 
PanelModality panelModality () const
 Returns the modality for this item. More...
 
QGraphicsItemparentItem () const
 Returns a pointer to this item's parent item. More...
 
QGraphicsObjectparentObject () const
 Returns a pointer to the item's parent, cast to a QGraphicsObject. More...
 
QGraphicsWidgetparentWidget () const
 Returns a pointer to the item's parent widget. More...
 
QPointF pos () const
 Returns the position of the item in parent coordinates. More...
 
 QGraphicsItem (QGraphicsItem *parent=0)
 Constructs a QGraphicsItem with the given parent item. More...
 
void removeSceneEventFilter (QGraphicsItem *filterItem)
 Removes an event filter on this item from filterItem. More...
 
void resetMatrix ()
 Use resetTransform() instead. More...
 
void resetTransform ()
 Resets this item's transformation matrix to the identity matrix or all the transformation properties to their default values. More...
 
void rotate (qreal angle)
 Use. More...
 
qreal rotation () const
 Returns the clockwise rotation, in degrees, around the Z axis. More...
 
void scale (qreal sx, qreal sy)
 Use. More...
 
qreal scale () const
 Returns the scale factor of the item. More...
 
QGraphicsScenescene () const
 Returns the current scene for the item, or 0 if the item is not stored in a scene. More...
 
QRectF sceneBoundingRect () const
 Returns the bounding rect of this item in scene coordinates, by combining sceneTransform() with boundingRect(). More...
 
QMatrix sceneMatrix () const
 Use sceneTransform() instead. More...
 
QPointF scenePos () const
 Returns the item's position in scene coordinates. More...
 
QTransform sceneTransform () const
 Returns this item's scene transformation matrix. More...
 
void scroll (qreal dx, qreal dy, const QRectF &rect=QRectF())
 Scrolls the contents of rect by dx, dy. More...
 
void setAcceptDrops (bool on)
 If on is true, this item will accept drag and drop events; otherwise, it is transparent for drag and drop events. More...
 
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
 Sets the mouse buttons that this item accepts mouse events for. More...
 
void setAcceptHoverEvents (bool enabled)
 If enabled is true, this item will accept hover events; otherwise, it will ignore them. More...
 
void setAcceptsHoverEvents (bool enabled)
 Use setAcceptHoverEvents(enabled) instead. More...
 
void setAcceptTouchEvents (bool enabled)
 If enabled is true, this item will accept touch events; otherwise, it will ignore them. More...
 
void setActive (bool active)
 If active is true, and the scene is active, this item's panel will be activated. More...
 
void setBoundingRegionGranularity (qreal granularity)
 Sets the bounding region granularity to granularity; a value between and including 0 and 1. More...
 
void setCacheMode (CacheMode mode, const QSize &cacheSize=QSize())
 Sets the item's cache mode to mode. More...
 
void setCursor (const QCursor &cursor)
 Sets the current cursor shape for the item to cursor. More...
 
void setData (int key, const QVariant &value)
 Sets this item's custom data for the key key to value. More...
 
void setEnabled (bool enabled)
 If enabled is true, the item is enabled; otherwise, it is disabled. More...
 
void setFiltersChildEvents (bool enabled)
 If enabled is true, this item is set to filter all events for all its children (i. More...
 
void setFlag (GraphicsItemFlag flag, bool enabled=true)
 If enabled is true, the item flag flag is enabled; otherwise, it is disabled. More...
 
void setFlags (GraphicsItemFlags flags)
 Sets the item flags to flags. More...
 
void setFocus (Qt::FocusReason focusReason=Qt::OtherFocusReason)
 Gives keyboard input focus to this item. More...
 
void setFocusProxy (QGraphicsItem *item)
 Sets the item's focus proxy to item. More...
 
void setGraphicsEffect (QGraphicsEffect *effect)
 Sets effect as the item's effect. More...
 
void setGroup (QGraphicsItemGroup *group)
 Adds this item to the item group group. More...
 
void setHandlesChildEvents (bool enabled)
 If enabled is true, this item is set to handle all events for all its children (i. More...
 
void setInputMethodHints (Qt::InputMethodHints hints)
 Sets the current input method hints of this item to hints. More...
 
void setMatrix (const QMatrix &matrix, bool combine=false)
 Sets the item's affine transformation matrix. More...
 
void setOpacity (qreal opacity)
 Sets this item's local opacity, between 0. More...
 
void setPanelModality (PanelModality panelModality)
 Sets the modality for this item to panelModality. More...
 
void setParentItem (QGraphicsItem *parent)
 Sets this item's parent item to newParent. More...
 
void setPos (const QPointF &pos)
 Sets the position of the item to pos, which is in parent coordinates. More...
 
void setPos (qreal x, qreal y)
 This convenience function is equivalent to calling setPos(QPointF(x, y)). More...
 
void setRotation (qreal angle)
 Sets the clockwise rotation angle, in degrees, around the Z axis. More...
 
void setScale (qreal scale)
 Sets the scale factor of the item. More...
 
void setSelected (bool selected)
 If selected is true and this item is selectable, this item is selected; otherwise, it is unselected. More...
 
void setToolTip (const QString &toolTip)
 Sets the item's tool tip to toolTip. More...
 
void setTransform (const QTransform &matrix, bool combine=false)
 Sets the item's current transformation matrix to matrix. More...
 
void setTransformations (const QList< QGraphicsTransform *> &transformations)
 Sets a list of graphics transformations (QGraphicsTransform) that currently apply to this item. More...
 
void setTransformOriginPoint (const QPointF &origin)
 Sets the origin point for the transformation in item coordinates. More...
 
void setTransformOriginPoint (qreal ax, qreal ay)
 Sets the origin point for the transformation in item coordinates. More...
 
void setVisible (bool visible)
 If visible is true, the item is made visible. More...
 
void setX (qreal x)
 Set's the x coordinate of the item's position. More...
 
void setY (qreal y)
 Set's the y coordinate of the item's position. More...
 
void setZValue (qreal z)
 Sets the Z-value of the item to z. More...
 
virtual QPainterPath shape () const
 Returns the shape of this item as a QPainterPath in local coordinates. More...
 
void shear (qreal sh, qreal sv)
 Use. More...
 
void show ()
 Shows the item. More...
 
void stackBefore (const QGraphicsItem *sibling)
 Stacks this item before sibling, which must be a sibling item (i. More...
 
QGraphicsObjecttoGraphicsObject ()
 Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object, 0 otherwise. More...
 
const QGraphicsObjecttoGraphicsObject () const
 Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object, 0 otherwise. More...
 
QString toolTip () const
 Returns the item's tool tip, or an empty QString if no tool tip has been set. More...
 
QGraphicsItemtopLevelItem () const
 Returns this item's top-level item. More...
 
QGraphicsWidgettopLevelWidget () const
 Returns a pointer to the item's top level widget (i. More...
 
QTransform transform () const
 Returns this item's transformation matrix. More...
 
QList< QGraphicsTransform * > transformations () const
 Returns a list of graphics transforms that currently apply to this item. More...
 
QPointF transformOriginPoint () const
 Returns the origin point for the transformation in item coordinates. More...
 
void translate (qreal dx, qreal dy)
 Use setPos() or setTransformOriginPoint() instead. More...
 
virtual int type () const
 Returns the type of an item as an int. More...
 
void ungrabKeyboard ()
 Releases the keyboard grab. More...
 
void ungrabMouse ()
 Releases the mouse grab. More...
 
void unsetCursor ()
 Clears the cursor from this item. More...
 
void update (const QRectF &rect=QRectF())
 Schedules a redraw of the area covered by rect in this item. More...
 
void update (qreal x, qreal y, qreal width, qreal height)
 This convenience function is equivalent to calling update(QRectF(x, y, width, height)). More...
 
QGraphicsWidgetwindow () const
 Returns the item's window, or 0 if this item does not have a window. More...
 
qreal x () const
 This convenience function is equivalent to calling pos(). More...
 
qreal y () const
 This convenience function is equivalent to calling pos(). More...
 
qreal zValue () const
 Returns the Z-value of the item. More...
 
virtual ~QGraphicsItem ()
 Destroys the QGraphicsItem and all its children. More...
 
- Public Functions inherited from QDeclarativeParserStatus
 QDeclarativeParserStatus ()
 
virtual ~QDeclarativeParserStatus ()
 

Protected Functions

virtual void classBegin ()
 
virtual void componentComplete ()
 
virtual bool event (QEvent *)
 
virtual void geometryChanged (const QRectF &newGeometry, const QRectF &oldGeometry)
 This function is called to handle this item's changes in geometry from oldGeometry to newGeometry. More...
 
bool heightValid () const
 Returns whether the height property has been set explicitly. More...
 
virtual void inputMethodEvent (QInputMethodEvent *)
 
void inputMethodPreHandler (QInputMethodEvent *)
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 
bool isComponentComplete () const
 Returns true if construction of the QML component is complete; otherwise returns false. More...
 
virtual QVariant itemChange (GraphicsItemChange, const QVariant &)
 Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is not called during initial widget polishing. More...
 
virtual void keyPressEvent (QKeyEvent *event)
 
void keyPressPreHandler (QKeyEvent *)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
void keyReleasePreHandler (QKeyEvent *)
 
 QDeclarativeItem (QDeclarativeItemPrivate &dd, QDeclarativeItem *parent=0)
 
virtual bool sceneEvent (QEvent *)
 
void setImplicitHeight (qreal)
 Sets the implied height of the item to h. More...
 
void setImplicitWidth (qreal)
 Sets the implied width of the item to w. More...
 
bool widthValid () const
 Returns whether the width property has been set explicitly. More...
 
- Protected Functions inherited from QGraphicsObject
 QGraphicsObject (QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene)
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Functions inherited from QGraphicsItem
void addToIndex ()
 Adds this item to the scene's index. More...
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 This event handler can be reimplemented in a subclass to process context menu events. More...
 
virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag enter events for this item. More...
 
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag leave events for this item. More...
 
virtual void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag move events for this item. More...
 
virtual void dropEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drop events for this item. More...
 
virtual QVariant extension (const QVariant &variant) const
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
virtual void focusInEvent (QFocusEvent *event)
 This event handler, for event event, can be reimplemented to receive focus in events for this item. More...
 
virtual void focusOutEvent (QFocusEvent *event)
 This event handler, for event event, can be reimplemented to receive focus out events for this item. More...
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover enter events for this item. More...
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover leave events for this item. More...
 
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover move events for this item. More...
 
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse doubleclick events for this item. More...
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse move events for this item. More...
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse press events for this item. More...
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse release events for this item. More...
 
void prepareGeometryChange ()
 Prepares the item for a geometry change. More...
 
 QGraphicsItem (QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene)
 
void removeFromIndex ()
 Removes this item from the scene's index. More...
 
virtual bool sceneEventFilter (QGraphicsItem *watched, QEvent *event)
 Filters events for the item watched. More...
 
virtual void setExtension (Extension extension, const QVariant &variant)
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
virtual bool supportsExtension (Extension extension) const
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
void updateMicroFocus ()
 Updates the item's micro focus. More...
 
virtual void wheelEvent (QGraphicsSceneWheelEvent *event)
 This event handler, for event event, can be reimplemented to receive wheel events for this item. More...
 

Properties

bool activeFocus
 
qreal baselineOffset
 The position of the item's baseline in local coordinates. More...
 
QDeclarativeItem *QRectF childrenRect
 The geometry of an item's children. More...
 
bool clip
 This property holds whether clipping is enabled. More...
 
bool focus
 
qreal implicitHeight
 Returns the height of the item that is implied by other properties that determine the content. More...
 
qreal implicitWidth
 Returns the width of the item that is implied by other properties that determine the content. More...
 
bool smooth
 whether the item is smoothly transformed. More...
 
QDeclarativeListProperty< QGraphicsTransformtransform
 
TransformOrigin transformOrigin
 Returns the current transform origin. More...
 
QPointF transformOriginPoint
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QObject
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 receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
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. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Types inherited from QGraphicsItem
enum  Extension { UserExtension = 0x80000000 }
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
- Protected Slots inherited from QGraphicsObject
void updateMicroFocus ()
 Updates the item's micro focus. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Variables inherited from QGraphicsItem
QScopedPointer< QGraphicsItemPrivated_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

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

Since
4.7

All visual items in Qt Declarative inherit from QDeclarativeItem. Although QDeclarativeItem has no visual appearance, it defines all the properties that are common across visual items - such as the x and y position, the width and height, anchor-layout{anchoring} and key handling.

You can subclass QDeclarativeItem to provide your own custom visual item that inherits these features. Note that, because it does not draw anything, QDeclarativeItem sets the QGraphicsItem::ItemHasNoContents flag. If you subclass QDeclarativeItem to create a visual item, you will need to unset this flag.

Definition at line 67 of file qdeclarativeitem.h.

Enumerations

◆ TransformOrigin

Controls the point about which simple transforms like scale apply.

  • TopLeft The top-left corner of the item.
  • Top The center point of the top of the item.
  • TopRight The top-right corner of the item.
  • Left The left most point of the vertical middle.
  • Center The center of the item.
  • Right The right most point of the vertical middle.
  • BottomLeft The bottom-left corner of the item.
  • Bottom The center point of the bottom of the item.
  • BottomRight The bottom-right corner of the item.
Enumerator
TopLeft 
Top 
TopRight 
Left 
Center 
Right 
BottomLeft 
Bottom 
BottomRight 

Definition at line 102 of file qdeclarativeitem.h.

Constructors and Destructors

◆ QDeclarativeItem() [1/2]

QDeclarativeItem::QDeclarativeItem ( QDeclarativeItem parent = 0)

Constructs a QDeclarativeItem with the given parent.

Definition at line 1830 of file qdeclarativeitem.cpp.

1831  : QGraphicsObject(*(new QDeclarativeItemPrivate), parent, 0)
1832 {
1834  d->init(parent);
1835 }
QDeclarativeParserStatus ** d
QGraphicsObject(QGraphicsItem *parent=0)
Constructs a QGraphicsObject with parent.
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ ~QDeclarativeItem()

QDeclarativeItem::~QDeclarativeItem ( )
virtual

Destroys the QDeclarativeItem.

Definition at line 1849 of file qdeclarativeitem.cpp.

1850 {
1852  for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
1853  QDeclarativeAnchorsPrivate *anchor = d->changeListeners.at(ii).listener->anchorPrivate();
1854  if (anchor)
1855  anchor->clearItem(this);
1856  }
1857  if (!d->parent || (parentItem() && !parentItem()->QGraphicsItem::d_ptr->inDestructor)) {
1858  for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
1859  QDeclarativeAnchorsPrivate *anchor = d->changeListeners.at(ii).listener->anchorPrivate();
1860  if (anchor && anchor->item && anchor->item->parentItem() != this) //child will be deleted anyway
1861  anchor->updateOnComplete();
1862  }
1863  }
1864  for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
1865  const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
1867  change.listener->itemDestroyed(this);
1868  }
1869  d->changeListeners.clear();
1870  delete d->_anchorLines; d->_anchorLines = 0;
1871  delete d->_anchors; d->_anchors = 0;
1872  delete d->_stateGroup; d->_stateGroup = 0;
1873  delete d->_contents; d->_contents = 0;
1874 }
QDeclarativeParserStatus ** d
QScopedPointer< QGraphicsItemPrivate > d_ptr
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeItemPrivate::ChangeTypes types
The QDeclarativeItem class provides the most basic of all visual items in QML.
void clearItem(QGraphicsObject *)
virtual void itemDestroyed(QDeclarativeItem *)
QGraphicsItem * parentItem() const
Returns a pointer to this item&#39;s parent item.
QDeclarativeItem * parentItem() const
Returns the QDeclarativeItem parent of this item.
QDeclarativeItemChangeListener * listener

◆ QDeclarativeItem() [2/2]

QDeclarativeItem::QDeclarativeItem ( QDeclarativeItemPrivate dd,
QDeclarativeItem parent = 0 
)
protected
Warning
This function is not part of the public interface.

Definition at line 1839 of file qdeclarativeitem.cpp.

1840  : QGraphicsObject(dd, parent, 0)
1841 {
1843  d->init(parent);
1844 }
QDeclarativeParserStatus ** d
QGraphicsObject(QGraphicsItem *parent=0)
Constructs a QGraphicsObject with parent.
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

Functions

◆ activeFocusChanged

void QDeclarativeItem::activeFocusChanged ( bool  )
signal
Warning
This function is not part of the public interface.

◆ baselineOffset()

qreal QDeclarativeItem::baselineOffset ( ) const

◆ baselineOffsetChanged

void QDeclarativeItem::baselineOffsetChanged ( qreal  )
signal
Warning
This function is not part of the public interface.

Referenced by setBaselineOffset().

◆ boundingRect()

QRectF QDeclarativeItem::boundingRect ( ) const
virtual
Warning
This function is not part of the public interface.

Implements QGraphicsItem.

Reimplemented in QDeclarativeTextEdit, QDeclarativeTextInput, QDeclarativeText, QDeclarativeRectangle, and QDeclarativePaintedItem.

Definition at line 3372 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeMouseArea::mouseMoveEvent().

3373 {
3374  Q_D(const QDeclarativeItem);
3375  return QRectF(0, 0, d->mWidth, d->mHeight);
3376 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ childAt()

QDeclarativeItem * QDeclarativeItem::childAt ( qreal  x,
qreal  y 
) const

Returns the visible child item at point (x, y), which is in this item's coordinate system, or 0 if there is no such item.

Definition at line 2966 of file qdeclarativeitem.cpp.

2967 {
2969  for (int i = children.count()-1; i >= 0; --i) {
2970  if (QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i))) {
2971  if (child->isVisible() && child->x() <= x
2972  && child->x() + child->width() >= x
2973  && child->y() <= y
2974  && child->y() + child->height() >= y)
2975  return child;
2976  }
2977  }
2978  return 0;
2979 }
QList< QGraphicsItem * > childItems() const
Returns a list of this item&#39;s children.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QDeclarativeItem class provides the most basic of all visual items in QML.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().
const QObjectList & children() const
Returns a list of child objects.
Definition: qobject.h:197
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ childrenRect()

QRectF QDeclarativeItem::childrenRect ( )

◆ childrenRectChanged

void QDeclarativeItem::childrenRectChanged ( const QRectF )
signal
Warning
This function is not part of the public interface.

◆ classBegin()

void QDeclarativeItem::classBegin ( )
protectedvirtual
Warning
This function is not part of the public interface.

classBegin() is called when the item is constructed, but its properties have not yet been set.

See also
componentComplete(), isComponentComplete()

Implements QDeclarativeParserStatus.

Definition at line 3194 of file qdeclarativeitem.cpp.

3195 {
3197  d->componentComplete = false;
3198  if (d->_stateGroup)
3199  d->_stateGroup->classBegin();
3200  if (d->_anchors)
3201  d->_anchors->classBegin();
3202 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
The QDeclarativeItem class provides the most basic of all visual items in QML.
virtual void classBegin()=0
Invoked after class creation, but before any properties have been set.

◆ clip()

bool QDeclarativeItem::clip ( ) const

◆ clipChanged

void QDeclarativeItem::clipChanged ( bool  )
signal
Warning
This function is not part of the public interface.

Referenced by setClip().

◆ componentComplete()

void QDeclarativeItem::componentComplete ( )
protectedvirtual
Warning
This function is not part of the public interface.

componentComplete() is called when all items in the component have been constructed. It is often desirable to delay some processing until the component is complete an all bindings in the component have been resolved.

Implements QDeclarativeParserStatus.

Reimplemented in QDeclarativeListView, QDeclarativeParticles, QDeclarativeGridView, QDeclarativeTextEdit, QDeclarativePathView, QDeclarativeText, QDeclarativeAnimatedImage, QDeclarativeImageBase, QDeclarativeLoader, QDeclarativeRepeater, QDeclarativeBasePositioner, QDeclarativeGestureArea, and ShaderEffectItem.

Definition at line 3212 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeItemPrivate::_states(), ShaderEffectItem::componentComplete(), QDeclarativeGestureArea::componentComplete(), QDeclarativeBasePositioner::componentComplete(), QDeclarativeRepeater::componentComplete(), QDeclarativeLoader::componentComplete(), QDeclarativeImageBase::componentComplete(), QDeclarativeAnimatedImage::componentComplete(), QDeclarativeText::componentComplete(), QDeclarativePathView::componentComplete(), QDeclarativeTextEdit::componentComplete(), QDeclarativeGridView::componentComplete(), QDeclarativeParticles::componentComplete(), QDeclarativeListView::componentComplete(), and QDeclarativeFlickablePrivate::data_append().

3213 {
3215  d->componentComplete = true;
3216  if (d->_stateGroup)
3217  d->_stateGroup->componentComplete();
3218  if (d->_anchors) {
3219  d->_anchors->componentComplete();
3220  d->_anchors->d_func()->updateOnComplete();
3221  }
3222  if (d->keyHandler)
3223  d->keyHandler->componentComplete();
3224  if (d->_contents)
3225  d->_contents->complete();
3226 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ event()

bool QDeclarativeItem::event ( QEvent ev)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QObject.

Reimplemented in QDeclarativePinchArea, QDeclarativeTextEdit, QDeclarativeTextInput, QDeclarativeListView, QDeclarativeGridView, and QDeclarativePathView.

Definition at line 3987 of file qdeclarativeitem.cpp.

Referenced by QDeclarativePathView::event(), QDeclarativeGridView::event(), QDeclarativeListView::event(), QDeclarativeTextInput::event(), QDeclarativeTextEdit::event(), QDeclarativePinchArea::event(), sceneEvent(), and QDeclarativeFlickable::sendMouseEvent().

3988 {
3990  switch (ev->type()) {
3991  case QEvent::KeyPress:
3992  case QEvent::KeyRelease:
3993  case QEvent::InputMethod:
3994  d->doneEventPreHandler = false;
3995  break;
3996  default:
3997  break;
3998  }
3999 
4000  return QGraphicsObject::event(ev);
4001 }
QDeclarativeParserStatus ** d
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
Type type() const
Returns the event type.
Definition: qcoreevent.h:303

◆ focusChanged

void QDeclarativeItem::focusChanged ( bool  )
signal
Warning
This function is not part of the public interface.

◆ forceActiveFocus()

void QDeclarativeItem::forceActiveFocus ( )

Forces active focus on the item.

This method sets focus on the item and makes sure that all the focus scopes higher in the object hierarchy are also given the focus.

Definition at line 2940 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeTextInput::mousePressEvent(), and QDeclarativeTextEdit::mousePressEvent().

2941 {
2942  setFocus(true);
2944  while (parent) {
2945  if (parent->flags() & QGraphicsItem::ItemIsFocusScope)
2946  parent->setFocus(Qt::OtherFocusReason);
2947  parent = parent->parentItem();
2948  }
2949 }
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
GraphicsItemFlags flags() const
Returns this item&#39;s flags.
QGraphicsItem * parentItem() const
Returns a pointer to this item&#39;s parent item.
QDeclarativeItem * parentItem() const
Returns the QDeclarativeItem parent of this item.
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
void setFocus(Qt::FocusReason focusReason=Qt::OtherFocusReason)
Gives keyboard input focus to this item.

◆ geometryChanged()

void QDeclarativeItem::geometryChanged ( const QRectF newGeometry,
const QRectF oldGeometry 
)
protectedvirtual

This function is called to handle this item's changes in geometry from oldGeometry to newGeometry.

If the two geometries are the same, it doesn't do anything.

Reimplemented in QDeclarativePinchArea, QDeclarativeTextEdit, QDeclarativeListView, QDeclarativeTextInput, QDeclarativeFlickable, QDeclarativeMouseArea, QDeclarativeText, ShaderEffectItem, QDeclarativeLoader, QDeclarativePaintedItem, and QDeclarativeImage.

Definition at line 2350 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeImage::geometryChanged(), QDeclarativePaintedItem::geometryChanged(), QDeclarativeLoader::geometryChanged(), ShaderEffectItem::geometryChanged(), QDeclarativeText::geometryChanged(), QDeclarativeMouseArea::geometryChanged(), QDeclarativeFlickable::geometryChanged(), QDeclarativePinchArea::geometryChanged(), setImplicitHeight(), setImplicitWidth(), and setSize().

2352 {
2354 
2355  if (d->_anchors)
2356  d->_anchors->d_func()->updateMe();
2357 
2359  && (newGeometry.width() != oldGeometry.width() || newGeometry.height() != oldGeometry.height())) {
2360  if (d->transformData) {
2361  QPointF origin = d->computeTransformOrigin();
2362  if (transformOriginPoint() != origin)
2363  setTransformOriginPoint(origin);
2364  } else {
2365  d->transformOriginDirty = true;
2366  }
2367  }
2368 
2369  for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
2370  const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
2372  change.listener->itemGeometryChanged(this, newGeometry, oldGeometry);
2373  }
2374 
2375  if (newGeometry.width() != oldGeometry.width())
2376  emit widthChanged();
2377  if (newGeometry.height() != oldGeometry.height())
2378  emit heightChanged();
2379 }
QPointF transformOriginPoint() const
Returns the origin point for the transformation in item coordinates.
QDeclarativeParserStatus ** d
void heightChanged()
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
TransformOrigin transformOrigin() const
QDeclarativeItemPrivate::ChangeTypes types
The QDeclarativeItem class provides the most basic of all visual items in QML.
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
#define emit
Definition: qobjectdefs.h:76
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
virtual void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &)
void setTransformOriginPoint(const QPointF &origin)
Sets the origin point for the transformation in item coordinates.
QDeclarativeItemChangeListener * listener

◆ hasActiveFocus()

bool QDeclarativeItem::hasActiveFocus ( ) const
Warning
This function is not part of the public interface.

Definition at line 3908 of file qdeclarativeitem.cpp.

Referenced by hasFocus(), QDeclarativeTextInput::mousePressEvent(), QDeclarativeTextEdit::mousePressEvent(), and sceneEvent().

3909 {
3910  Q_D(const QDeclarativeItem);
3911  QGraphicsItem *fi = focusItem();
3912  QGraphicsScene *s = scene();
3913  bool hasOrWillGainFocus = fi && fi->isVisible() && (!s || s->focusItem() == fi);
3914  bool isOrIsScopeOfFocusItem = (fi == this || (d->flags & QGraphicsItem::ItemIsFocusScope));
3915  return hasOrWillGainFocus && isOrIsScopeOfFocusItem;
3916 }
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
QGraphicsItem * focusItem() const
If this item, a child or descendant of this item currently has input focus, this function will return...
QDeclarativeParserStatus ** d
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
#define Q_D(Class)
Definition: qglobal.h:2482
QGraphicsItem * focusItem() const
When the scene is active, this functions returns the scene&#39;s current focus item, or 0 if no item curr...
The QDeclarativeItem class provides the most basic of all visual items in QML.
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.

◆ hasFocus()

bool QDeclarativeItem::hasFocus ( ) const
Warning
This function is not part of the public interface.

Definition at line 3954 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeTextInputPrivate::focusChanged().

3955 {
3956  Q_D(const QDeclarativeItem);
3957  QGraphicsItem *p = d->parent;
3958  while (p) {
3960  return p->focusScopeItem() == this;
3961  }
3962  p = p->parentItem();
3963  }
3964 
3965  return hasActiveFocus();
3966 }
QGraphicsItem * focusScopeItem() const
Returns this item&#39;s focus scope item.
QDeclarativeParserStatus ** d
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
bool hasActiveFocus() const
GraphicsItemFlags flags() const
Returns this item&#39;s flags.
QGraphicsItem * parentItem() const
Returns a pointer to this item&#39;s parent item.

◆ height()

qreal QDeclarativeItem::height ( ) const
Warning
This function is not part of the public interface. Return the height of the item

Definition at line 3696 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeText::boundingRect(), QDeclarativeContents::calcHeight(), QDeclarativeFlow::doPositioning(), QDeclarativeRectangle::drawRect(), QDeclarativeFlickable::geometryChanged(), QDeclarativeFlickable::maxYExtent(), QDeclarativeGridView::maxYExtent(), QDeclarativeListView::maxYExtent(), operator<<(), QDeclarativeImage::paint(), QDeclarativeRectangle::paint(), QDeclarativeText::paint(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QDeclarativePinchArea::sendMouseEvent(), QDeclarativeFlickable::setContentHeight(), QDeclarativeItemPrivate::setHeight(), setImplicitHeight(), setImplicitWidth(), setSize(), QDeclarativeImageBase::setSourceSize(), QDeclarativeItemPrivate::setWidth(), QDeclarativeParentAnimation::transition(), ShaderEffectSource::updateBackbuffer(), ShaderEffectItem::updateGeometry(), QDeclarativePathViewPrivate::updateItem(), QDeclarativeImage::updatePaintedGeometry(), QDeclarativeTextEdit::updateSize(), QDeclarativeTextInput::updateSize(), ShaderEffectSource::updateSizeAndTexture(), QDeclarativeListViewPrivate::updateUnrequestedPositions(), QDeclarativeFlickableVisibleArea::updateVisible(), QDeclarativeFlickable::vHeight(), QDeclarativeFlickable::viewportMoved(), QDeclarativeListView::viewportMoved(), and QDeclarativeFlickable::yflick().

3697 {
3698  Q_D(const QDeclarativeItem);
3699  return d->height();
3700 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ heightValid()

bool QDeclarativeItem::heightValid ( ) const
protected

Returns whether the height property has been set explicitly.

Definition at line 3852 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeFlow::doPositioning(), QDeclarativeItemPrivate::resetHeight(), QDeclarativeItemPrivate::setHeight(), setImplicitHeight(), QDeclarativeImage::updatePaintedGeometry(), and QDeclarativeTextEdit::updateSize().

3853 {
3854  Q_D(const QDeclarativeItem);
3855  return d->heightValid;
3856 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ implicitHeight()

qreal QDeclarativeItem::implicitHeight ( ) const

◆ implicitHeightChanged

void QDeclarativeItem::implicitHeightChanged ( )
signal

◆ implicitWidth()

qreal QDeclarativeItem::implicitWidth ( ) const

◆ implicitWidthChanged

void QDeclarativeItem::implicitWidthChanged ( )
signal

◆ inputMethodEvent()

void QDeclarativeItem::inputMethodEvent ( QInputMethodEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QGraphicsItem.

Reimplemented in QDeclarativeTextEdit, and QDeclarativeTextInput.

Definition at line 2414 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeTextInput::inputMethodEvent().

2415 {
2417  inputMethodPreHandler(event);
2418  if (event->isAccepted())
2419  return;
2420  if (d->keyHandler)
2421  d->keyHandler->inputMethodEvent(event, true);
2422  else
2423  event->ignore();
2424 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
The QDeclarativeItem class provides the most basic of all visual items in QML.
void inputMethodPreHandler(QInputMethodEvent *)

◆ inputMethodPreHandler()

void QDeclarativeItem::inputMethodPreHandler ( QInputMethodEvent event)
protected
Warning
This function is not part of the public interface.

Definition at line 2469 of file qdeclarativeitem.cpp.

Referenced by inputMethodEvent(), and QDeclarativeTextInput::inputMethodEvent().

2470 {
2472  if (d->keyHandler && !d->doneEventPreHandler)
2473  d->keyHandler->inputMethodEvent(event, false);
2474  else
2475  event->ignore();
2476  d->doneEventPreHandler = true;
2477 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ inputMethodQuery()

QVariant QDeclarativeItem::inputMethodQuery ( Qt::InputMethodQuery  query) const
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QGraphicsItem.

Reimplemented in QDeclarativeTextInput, and QDeclarativeTextEdit.

Definition at line 2427 of file qdeclarativeitem.cpp.

2428 {
2429  Q_D(const QDeclarativeItem);
2430  QVariant v;
2431  if (d->keyHandler)
2432  v = d->keyHandler->inputMethodQuery(query);
2433 
2434  if (!v.isValid())
2436 
2437  return v;
2438 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QDeclarativeParserStatus ** d
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
This method is only relevant for input items.
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Definition: qvariant.h:485

◆ isComponentComplete()

bool QDeclarativeItem::isComponentComplete ( ) const
protected

Returns true if construction of the QML component is complete; otherwise returns false.

It is often desirable to delay some processing until the component is completed.

See also
componentComplete()

Definition at line 1984 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeRepeater::clear(), QDeclarativeRepeater::itemsInserted(), QDeclarativePathView::itemsInserted(), QDeclarativeGridView::itemsInserted(), QDeclarativeListView::itemsInserted(), QDeclarativeRepeater::itemsMoved(), QDeclarativePathView::itemsMoved(), QDeclarativeGridView::itemsMoved(), QDeclarativeListView::itemsMoved(), QDeclarativeRepeater::itemsRemoved(), QDeclarativePathView::itemsRemoved(), QDeclarativeGridView::itemsRemoved(), QDeclarativeListView::itemsRemoved(), QDeclarativeRepeater::modelReset(), QDeclarativeBasePositioner::prePositioning(), QDeclarativePathView::refill(), QDeclarativeRepeater::regenerate(), QDeclarativeText::resetHAlign(), QDeclarativeTextInput::resetHAlign(), QDeclarativeTextEdit::resetHAlign(), QDeclarativeImageBase::resetSourceSize(), QDeclarativeImageBase::setCache(), QDeclarativeGridView::setCacheBuffer(), QDeclarativeListView::setCacheBuffer(), QDeclarativePathView::setCurrentIndex(), QDeclarativeGridView::setCurrentIndex(), QDeclarativeListView::setCurrentIndex(), QDeclarativeGridView::setDelegate(), QDeclarativeListView::setDelegate(), QDeclarativeGridView::setFooter(), QDeclarativeListView::setFooter(), ShaderEffectItem::setFragmentShader(), QDeclarativeText::setHAlign(), QDeclarativeTextInput::setHAlign(), QDeclarativeTextEdit::setHAlign(), QDeclarativeGridView::setHeader(), QDeclarativeListView::setHeader(), QDeclarativeImageBase::setMirror(), QDeclarativePathView::setModel(), QDeclarativeGridView::setModel(), QDeclarativeListView::setModel(), QDeclarativePathView::setPath(), QDeclarativePathView::setPathItemCount(), QDeclarativeLoader::setSource(), QDeclarativeImageBase::setSource(), QDeclarativeBorderImage::setSource(), QDeclarativeAnimatedImage::setSource(), QDeclarativeLoader::setSourceComponent(), QDeclarativeImageBase::setSourceSize(), QDeclarativeText::setStyle(), QDeclarativeText::setText(), QDeclarativeText::setTextFormat(), QDeclarativeText::setVAlign(), ShaderEffectItem::setVertexShader(), QDeclarativeListView::updateSections(), and QDeclarativeTextEdit::updateSize().

1985 {
1986  Q_D(const QDeclarativeItem);
1987  return d->componentComplete;
1988 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ itemChange()

QVariant QDeclarativeItem::itemChange ( GraphicsItemChange  change,
const QVariant value 
)
protectedvirtual

Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is not called during initial widget polishing.

Warning
This function is not part of the public interface.

Items wishing to optimize start-up construction should instead consider using componentComplete().

Reimplemented from QGraphicsItem.

Reimplemented in QDeclarativePinchArea, QDeclarativeMouseArea, QDeclarativePaintedItem, QDeclarativeLoader, QDeclarativeRepeater, and QDeclarativeBasePositioner.

Definition at line 3326 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeBasePositioner::itemChange(), QDeclarativeLoader::itemChange(), QDeclarativeRepeater::itemChange(), QDeclarativePaintedItem::itemChange(), QDeclarativeMouseArea::itemChange(), and QDeclarativePinchArea::itemChange().

3328 {
3330  switch (change) {
3331  case ItemParentHasChanged:
3332  d->resolveLayoutMirror();
3334  d->parentNotifier.notify();
3335  break;
3336  case ItemVisibleHasChanged: {
3337  for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
3338  const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
3340  change.listener->itemVisibilityChanged(this);
3341  }
3342  }
3343  }
3344  break;
3345  case ItemOpacityHasChanged: {
3346  for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
3347  const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
3348  if (change.types & QDeclarativeItemPrivate::Opacity) {
3349  change.listener->itemOpacityChanged(this);
3350  }
3351  }
3352  }
3353  break;
3354  case ItemChildAddedChange:
3355  if (d->_contents && d->componentComplete)
3356  d->_contents->childAdded(qobject_cast<QDeclarativeItem*>(
3357  value.value<QGraphicsItem*>()));
3358  break;
3360  if (d->_contents && d->componentComplete)
3361  d->_contents->childRemoved(qobject_cast<QDeclarativeItem*>(
3362  value.value<QGraphicsItem*>()));
3363  break;
3364  default:
3365  break;
3366  }
3367 
3368  return QGraphicsItem::itemChange(change, value);
3369 }
QDeclarativeParserStatus ** d
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
This virtual function is called by QGraphicsItem to notify custom items that some part of the item&#39;s ...
virtual void itemOpacityChanged(QDeclarativeItem *)
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
QDeclarativeItemPrivate::ChangeTypes types
The QDeclarativeItem class provides the most basic of all visual items in QML.
void parentChanged()
This signal gets emitted whenever the parent of the item changes.
#define emit
Definition: qobjectdefs.h:76
QDeclarativeItem * parentItem() const
Returns the QDeclarativeItem parent of this item.
virtual void itemVisibilityChanged(QDeclarativeItem *)
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
QDeclarativeItemChangeListener * listener

◆ keepMouseGrab()

bool QDeclarativeItem::keepMouseGrab ( ) const

Returns a value indicating whether mouse input should remain with this item exclusively.

See also
setKeepMouseGrab()

Definition at line 2796 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeMouseArea::mouseMoveEvent(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), and QDeclarativePinchArea::sendMouseEvent().

2797 {
2798  Q_D(const QDeclarativeItem);
2799  return d->keepMouse;
2800 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ keyPressEvent()

void QDeclarativeItem::keyPressEvent ( QKeyEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QGraphicsItem.

Reimplemented in QDeclarativeTextEdit, QDeclarativeTextInput, QDeclarativeListView, and QDeclarativeGridView.

Definition at line 2388 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeGridView::keyPressEvent(), QDeclarativeListView::keyPressEvent(), QDeclarativeTextInput::keyPressEvent(), QDeclarativeTextEdit::keyPressEvent(), and sceneEvent().

2389 {
2391  keyPressPreHandler(event);
2392  if (event->isAccepted())
2393  return;
2394  if (d->keyHandler)
2395  d->keyHandler->keyPressed(event, true);
2396  else
2397  event->ignore();
2398 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
The QDeclarativeItem class provides the most basic of all visual items in QML.
void keyPressPreHandler(QKeyEvent *)

◆ keyPressPreHandler()

void QDeclarativeItem::keyPressPreHandler ( QKeyEvent event)
protected
Warning
This function is not part of the public interface.

Definition at line 2443 of file qdeclarativeitem.cpp.

Referenced by keyPressEvent(), QDeclarativeGridView::keyPressEvent(), QDeclarativeListView::keyPressEvent(), QDeclarativeTextInput::keyPressEvent(), and QDeclarativeTextEdit::keyPressEvent().

2444 {
2446  if (d->keyHandler && !d->doneEventPreHandler)
2447  d->keyHandler->keyPressed(event, false);
2448  else
2449  event->ignore();
2450  d->doneEventPreHandler = true;
2451 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ keyReleaseEvent()

void QDeclarativeItem::keyReleaseEvent ( QKeyEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QGraphicsItem.

Reimplemented in QDeclarativeTextEdit.

Definition at line 2401 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeTextEdit::keyReleaseEvent().

2402 {
2404  keyReleasePreHandler(event);
2405  if (event->isAccepted())
2406  return;
2407  if (d->keyHandler)
2408  d->keyHandler->keyReleased(event, true);
2409  else
2410  event->ignore();
2411 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
The QDeclarativeItem class provides the most basic of all visual items in QML.
void keyReleasePreHandler(QKeyEvent *)

◆ keyReleasePreHandler()

void QDeclarativeItem::keyReleasePreHandler ( QKeyEvent event)
protected
Warning
This function is not part of the public interface.

Definition at line 2456 of file qdeclarativeitem.cpp.

Referenced by keyReleaseEvent(), and QDeclarativeTextEdit::keyReleaseEvent().

2457 {
2459  if (d->keyHandler && !d->doneEventPreHandler)
2460  d->keyHandler->keyReleased(event, false);
2461  else
2462  event->ignore();
2463  d->doneEventPreHandler = true;
2464 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ mapFromItem()

QScriptValue QDeclarativeItem::mapFromItem ( const QScriptValue item,
qreal  x,
qreal  y 
) const

Maps the point (x, y), which is in item's coordinate system, to this item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate.

If item is a null value, this maps the point from the coordinate system of the root QML view.

See also
Item::mapFromItem()

Definition at line 2850 of file qdeclarativeitem.cpp.

2851 {
2853  if (!itemObj && !item.isNull()) {
2854  qmlInfo(this) << "mapFromItem() given argument \"" << item.toString() << "\" which is neither null nor an Item";
2855  return 0;
2856  }
2857 
2858  // If QGraphicsItem::mapFromItem() is called with 0, behaves the same as mapFromScene()
2859  QPointF p = qobject_cast<QGraphicsItem*>(this)->mapFromItem(itemObj, x, y);
2860 
2861  // Use the script engine from the passed item, if available. Use this item's one otherwise.
2862  QScriptEngine* const se = itemObj ? item.engine() : QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this));
2863 
2864  // Engine-less items are unlikely, but nevertheless possible. Handle them.
2865  if (0 == se)
2867 
2868  QScriptValue sv = se->newObject();
2869  sv.setProperty(QLatin1String("x"), p.x());
2870  sv.setProperty(QLatin1String("y"), p.y());
2871  return sv;
2872 }
static QScriptEngine * getScriptEngine(QDeclarativeEngine *e)
bool isNull() const
Returns true if this QScriptValue is of the primitive type Null; otherwise returns false...
Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, qreal x, qreal y) const
Maps the point (x, y), which is in item&#39;s coordinate system, to this item&#39;s coordinate system...
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
QString toString() const
Returns the string value of this QScriptValue, as defined in ECMA-262 section 9.8, "ToString".
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QObject * toQObject() const
If this QScriptValue is a QObject, returns the QObject pointer that the QScriptValue represents; othe...
T * qobject_cast(QObject *object)
Definition: qobject.h:375
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
The QScriptEngine class provides an environment for evaluating Qt Script code.
The QDeclarativeItem class provides the most basic of all visual items in QML.
QScriptEngine * engine() const
Returns the QScriptEngine that created this QScriptValue, or 0 if this QScriptValue is invalid or the...
QScriptValue newObject()
Creates a QtScript object of class Object.
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue&#39;s property with the given name to the given value.
qreal y() const
This convenience function is equivalent to calling pos().
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
qreal x() const
This convenience function is equivalent to calling pos().
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
QDeclarativeInfo qmlInfo(const QObject *me)
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57

◆ mapToItem()

QScriptValue QDeclarativeItem::mapToItem ( const QScriptValue item,
qreal  x,
qreal  y 
) const

Maps the point (x, y), which is in this item's coordinate system, to item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate.

If item is a null value, this maps x and y to the coordinate system of the root QML view.

See also
Item::mapToItem()

Definition at line 2898 of file qdeclarativeitem.cpp.

2899 {
2901  if (!itemObj && !item.isNull()) {
2902  qmlInfo(this) << "mapToItem() given argument \"" << item.toString() << "\" which is neither null nor an Item";
2903  return 0;
2904  }
2905 
2906  // If QGraphicsItem::mapToItem() is called with 0, behaves the same as mapToScene()
2907  QPointF p = qobject_cast<QGraphicsItem*>(this)->mapToItem(itemObj, x, y);
2908 
2909  // Use the script engine from the passed item, if available. Use this item's one otherwise.
2910  QScriptEngine* const se = itemObj ? item.engine() : QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this));
2911 
2912  // Engine-less items are unlikely, but nevertheless possible. Handle them.
2913  if (0 == se)
2915 
2916  QScriptValue sv = se->newObject();
2917  sv.setProperty(QLatin1String("x"), p.x());
2918  sv.setProperty(QLatin1String("y"), p.y());
2919  return sv;
2920 }
static QScriptEngine * getScriptEngine(QDeclarativeEngine *e)
bool isNull() const
Returns true if this QScriptValue is of the primitive type Null; otherwise returns false...
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
QString toString() const
Returns the string value of this QScriptValue, as defined in ECMA-262 section 9.8, "ToString".
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QObject * toQObject() const
If this QScriptValue is a QObject, returns the QObject pointer that the QScriptValue represents; othe...
T * qobject_cast(QObject *object)
Definition: qobject.h:375
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
The QScriptEngine class provides an environment for evaluating Qt Script code.
The QDeclarativeItem class provides the most basic of all visual items in QML.
QScriptEngine * engine() const
Returns the QScriptEngine that created this QScriptValue, or 0 if this QScriptValue is invalid or the...
QScriptValue newObject()
Creates a QtScript object of class Object.
Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const
Maps the point (x, y), which is in this item&#39;s coordinate system, to item&#39;s coordinate system...
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue&#39;s property with the given name to the given value.
qreal y() const
This convenience function is equivalent to calling pos().
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
qreal x() const
This convenience function is equivalent to calling pos().
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
QDeclarativeInfo qmlInfo(const QObject *me)
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57

◆ paint()

void QDeclarativeItem::paint ( QPainter ,
const QStyleOptionGraphicsItem ,
QWidget  
)
virtual
Warning
This function is not part of the public interface.

Implements QGraphicsItem.

Reimplemented in QDeclarativeParticlesPainter, QDeclarativeParticles, QDeclarativeText, QDeclarativeRectangle, QDeclarativePaintedItem, QDeclarativeBorderImage, QDeclarativeImage, and ShaderEffectItem.

Definition at line 3980 of file qdeclarativeitem.cpp.

3981 {
3982 }

◆ parentChanged

void QDeclarativeItem::parentChanged ( QDeclarativeItem )
signal
Warning
This function is not part of the public interface.

◆ parentItem()

QDeclarativeItem * QDeclarativeItem::parentItem ( ) const

◆ resetHeight()

void QDeclarativeItem::resetHeight ( )
Warning
This function is not part of the public interface. Reset the height of the item

Definition at line 3716 of file qdeclarativeitem.cpp.

3717 {
3719  d->resetHeight();
3720 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ resetWidth()

void QDeclarativeItem::resetWidth ( )
Warning
This function is not part of the public interface. Reset the width of the item

Definition at line 3589 of file qdeclarativeitem.cpp.

3590 {
3592  d->resetWidth();
3593 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ sceneEvent()

bool QDeclarativeItem::sceneEvent ( QEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QGraphicsItem.

Reimplemented in QDeclarativePinchArea, QDeclarativeTextInput, QDeclarativeFlickable, QDeclarativeMouseArea, QDeclarativeGestureArea, and QDeclarativeFocusPanel.

Definition at line 3290 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeFocusPanel::sceneEvent(), QDeclarativeGestureArea::sceneEvent(), QDeclarativeMouseArea::sceneEvent(), QDeclarativeFlickable::sceneEvent(), QDeclarativeTextInput::sceneEvent(), and QDeclarativePinchArea::sceneEvent().

3291 {
3293  if (event->type() == QEvent::KeyPress) {
3294  QKeyEvent *k = static_cast<QKeyEvent *>(event);
3295  if ((k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) &&
3297  keyPressEvent(static_cast<QKeyEvent *>(event));
3298  if (!event->isAccepted())
3299  return QGraphicsItem::sceneEvent(event);
3300  else
3301  return true;
3302  } else {
3303  return QGraphicsItem::sceneEvent(event);
3304  }
3305  } else {
3306  bool rv = QGraphicsItem::sceneEvent(event);
3307 
3308  if (event->type() == QEvent::FocusIn ||
3309  event->type() == QEvent::FocusOut) {
3310  d->focusChanged(hasActiveFocus());
3311  }
3312  return rv;
3313  }
3314 }
The QKeyEvent class describes a key event.
Definition: qevent.h:224
virtual bool sceneEvent(QEvent *event)
This virtual function receives events to this item.
QDeclarativeParserStatus ** d
virtual bool event(QEvent *)
virtual void keyPressEvent(QKeyEvent *event)
#define Q_D(Class)
Definition: qglobal.h:2482
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
Definition: qevent.cpp:999
int key() const
Returns the code of the key that was pressed or released.
Definition: qevent.h:231
bool isAccepted() const
Definition: qcoreevent.h:307
The QDeclarativeItem class provides the most basic of all visual items in QML.
bool hasActiveFocus() const
Type type() const
Returns the event type.
Definition: qcoreevent.h:303

◆ setBaselineOffset()

void QDeclarativeItem::setBaselineOffset ( qreal  offset)

Definition at line 2647 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeTextEdit::updateSize().

2648 {
2650  if (offset == d->baselineOffset)
2651  return;
2652 
2653  d->baselineOffset = offset;
2654 
2655  for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
2656  const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
2659  if (anchor)
2660  anchor->updateVerticalAnchors();
2661  }
2662  }
2663  emit baselineOffsetChanged(offset);
2664 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeItemPrivate::ChangeTypes types
The QDeclarativeItem class provides the most basic of all visual items in QML.
#define emit
Definition: qobjectdefs.h:76
void baselineOffsetChanged(qreal)
virtual QDeclarativeAnchorsPrivate * anchorPrivate()
QDeclarativeItemChangeListener * listener

◆ setClip()

void QDeclarativeItem::setClip ( bool  c)

Definition at line 2211 of file qdeclarativeitem.cpp.

2212 {
2213  if (clip() == c)
2214  return;
2216  emit clipChanged(c);
2217 }
unsigned char c[8]
Definition: qnumeric_p.h:62
void clipChanged(bool)
#define emit
Definition: qobjectdefs.h:76
bool clip() const
void setFlag(GraphicsItemFlag flag, bool enabled=true)
If enabled is true, the item flag flag is enabled; otherwise, it is disabled.

◆ setFocus()

void QDeclarativeItem::setFocus ( bool  focus)
Warning
This function is not part of the public interface.

Definition at line 3969 of file qdeclarativeitem.cpp.

Referenced by forceActiveFocus(), QDeclarativePathView::refill(), and QDeclarativeKeyNavigationAttached::setFocusNavigation().

3970 {
3971  if (focus)
3973  else
3975 }
void clearFocus()
Takes keyboard input focus from the item.
void setFocus(Qt::FocusReason focusReason=Qt::OtherFocusReason)
Gives keyboard input focus to this item.

◆ setHeight()

void QDeclarativeItem::setHeight ( qreal  h)
Warning
This function is not part of the public interface. Set the height of the item

Definition at line 3706 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeLayoutItem::setGeometry(), and QDeclarativeParticlesPainter::updateSize().

3707 {
3709  d->setHeight(h);
3710 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ setImplicitHeight()

void QDeclarativeItem::setImplicitHeight ( qreal  h)
protected

Sets the implied height of the item to h.

This is the height implied by other properties that determine the content.

Definition at line 3826 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeBorderImage::load(), QDeclarativeImageBase::pixmapChange(), QDeclarativeBasePositioner::prePositioning(), QDeclarativeBorderImage::requestFinished(), QDeclarativeBorderImage::setGridScaledImage(), QDeclarativeImage::updatePaintedGeometry(), QDeclarativeTextEdit::updateSize(), and QDeclarativeTextInput::updateSize().

3827 {
3829  bool changed = h != d->mImplicitHeight;
3830  d->mImplicitHeight = h;
3831  if (d->mHeight == h || heightValid()) {
3832  if (changed)
3833  d->implicitHeightChanged();
3834  return;
3835  }
3836 
3837  qreal oldHeight = d->mHeight;
3838 
3840  d->mHeight = h;
3841 
3842  geometryChanged(QRectF(x(), y(), width(), height()),
3843  QRectF(x(), y(), width(), oldHeight));
3844 
3845  if (changed)
3846  d->implicitHeightChanged();
3847 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
bool heightValid() const
Returns whether the height property has been set explicitly.
#define Q_D(Class)
Definition: qglobal.h:2482
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QDeclarativeItem class provides the most basic of all visual items in QML.
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
This function is called to handle this item&#39;s changes in geometry from oldGeometry to newGeometry...
qreal y() const
This convenience function is equivalent to calling pos().
void prepareGeometryChange()
Prepares the item for a geometry change.
qreal x() const
This convenience function is equivalent to calling pos().

◆ setImplicitWidth()

void QDeclarativeItem::setImplicitWidth ( qreal  w)
protected

Sets the implied width of the item to w.

This is the width implied by other properties that determine the content.

Definition at line 3660 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeBorderImage::load(), QDeclarativeImageBase::pixmapChange(), QDeclarativeBasePositioner::prePositioning(), QDeclarativeBorderImage::requestFinished(), QDeclarativeBorderImage::setGridScaledImage(), QDeclarativeImage::updatePaintedGeometry(), QDeclarativeTextEdit::updateSize(), and QDeclarativeTextInput::updateSize().

3661 {
3663  bool changed = w != d->mImplicitWidth;
3664  d->mImplicitWidth = w;
3665  if (d->mWidth == w || widthValid()) {
3666  if (changed)
3667  d->implicitWidthChanged();
3668  return;
3669  }
3670 
3671  qreal oldWidth = d->mWidth;
3672 
3674  d->mWidth = w;
3675 
3676  geometryChanged(QRectF(x(), y(), width(), height()),
3677  QRectF(x(), y(), oldWidth, height()));
3678 
3679  if (changed)
3680  d->implicitWidthChanged();
3681 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
bool widthValid() const
Returns whether the width property has been set explicitly.
#define Q_D(Class)
Definition: qglobal.h:2482
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QDeclarativeItem class provides the most basic of all visual items in QML.
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
This function is called to handle this item&#39;s changes in geometry from oldGeometry to newGeometry...
qreal y() const
This convenience function is equivalent to calling pos().
void prepareGeometryChange()
Prepares the item for a geometry change.
qreal x() const
This convenience function is equivalent to calling pos().

◆ setKeepMouseGrab()

void QDeclarativeItem::setKeepMouseGrab ( bool  keep)

The flag indicating whether the mouse should remain with this item is set to keep.

This is useful for items that wish to grab and keep mouse interaction following a predefined gesture. For example, an item that is interested in horizontal mouse movement may set keepMouseGrab to true once a threshold has been exceeded. Once keepMouseGrab has been set to true, filtering items will not react to mouse events.

If the item does not indicate that it wishes to retain mouse grab, a filtering item may steal the grab. For example, Flickable may attempt to steal a mouse grab if it detects that the user has begun to move the viewport.

See also
keepMouseGrab()

Definition at line 2820 of file qdeclarativeitem.cpp.

Referenced by QDeclarativePathView::mouseMoveEvent(), QDeclarativeMouseArea::mouseMoveEvent(), QDeclarativeTextInput::mouseMoveEvent(), QDeclarativeMouseArea::mousePressEvent(), QDeclarativeTextInput::mousePressEvent(), QDeclarativePinchArea::mousePressEvent(), QDeclarativeMouseArea::mouseReleaseEvent(), QDeclarativeTextInput::mouseReleaseEvent(), QDeclarativePinchArea::mouseReleaseEvent(), QDeclarativeMouseArea::sceneEvent(), QDeclarativeFlickable::sceneEvent(), QDeclarativeTextInput::sceneEvent(), QDeclarativePinchArea::sceneEvent(), QDeclarativePinchArea::sendMouseEvent(), QDeclarativeMouseArea::setPreventStealing(), QDeclarativeTextEdit::setSelectByMouse(), and QDeclarativePinchArea::updatePinch().

2821 {
2823  d->keepMouse = keep;
2824 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ setParentItem()

void QDeclarativeItem::setParentItem ( QDeclarativeItem parent)

◆ setSize()

void QDeclarativeItem::setSize ( const QSizeF size)
Warning
This function is not part of the public interface.

Definition at line 3859 of file qdeclarativeitem.cpp.

3860 {
3862  d->heightValid = true;
3863  d->widthValid = true;
3864 
3865  if (d->height() == size.height() && d->width() == size.width())
3866  return;
3867 
3868  qreal oldHeight = d->height();
3869  qreal oldWidth = d->width();
3870 
3872  d->setHeight(size.height());
3873  d->setWidth(size.width());
3874 
3875  geometryChanged(QRectF(x(), y(), width(), height()),
3876  QRectF(x(), y(), oldWidth, oldHeight));
3877 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
#define Q_D(Class)
Definition: qglobal.h:2482
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QDeclarativeItem class provides the most basic of all visual items in QML.
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
This function is called to handle this item&#39;s changes in geometry from oldGeometry to newGeometry...
qreal y() const
This convenience function is equivalent to calling pos().
void prepareGeometryChange()
Prepares the item for a geometry change.
qreal x() const
This convenience function is equivalent to calling pos().

◆ setSmooth()

void QDeclarativeItem::setSmooth ( bool  smooth)

Sets whether the item should be drawn with antialiasing and smooth pixmap filtering to smooth.

See also
smooth()

Definition at line 3465 of file qdeclarativeitem.cpp.

3466 {
3468  if (d->smooth == smooth)
3469  return;
3470  d->smooth = smooth;
3472  update();
3473 }
QDeclarativeParserStatus ** d
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
#define emit
Definition: qobjectdefs.h:76
void smoothChanged(bool)
bool smooth() const

◆ setTransformOrigin()

void QDeclarativeItem::setTransformOrigin ( TransformOrigin  origin)

Set the transform origin.

Definition at line 3409 of file qdeclarativeitem.cpp.

3410 {
3412  if (origin != d->origin) {
3413  d->origin = origin;
3414  if (d->transformData)
3415  QGraphicsItem::setTransformOriginPoint(d->computeTransformOrigin());
3416  else
3417  d->transformOriginDirty = true;
3418  emit transformOriginChanged(d->origin);
3419  }
3420 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
void transformOriginChanged(TransformOrigin)
#define emit
Definition: qobjectdefs.h:76
void setTransformOriginPoint(const QPointF &origin)
Sets the origin point for the transformation in item coordinates.

◆ setWidth()

void QDeclarativeItem::setWidth ( qreal  w)
Warning
This function is not part of the public interface. Set the width of the item

Definition at line 3579 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeLayoutItem::setGeometry(), and QDeclarativeParticlesPainter::updateSize().

3580 {
3582  d->setWidth(w);
3583 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ smooth()

bool QDeclarativeItem::smooth ( ) const

◆ smoothChanged

void QDeclarativeItem::smoothChanged ( bool  )
signal
Warning
This function is not part of the public interface.

Referenced by setSmooth().

◆ stateChanged

void QDeclarativeItem::stateChanged ( const QString state)
signal
Warning
This function is not part of the public interface.

Referenced by QDeclarativeItemPrivate::_states(), QDeclarativeAnimatedImage::load(), and QDeclarativeAnimatedImage::movieRequestFinished().

◆ transform()

QDeclarativeListProperty<QGraphicsTransform> QDeclarativeItem::transform ( )

◆ transformOrigin()

TransformOrigin QDeclarativeItem::transformOrigin ( ) const

Referenced by boundingRect(), and geometryChanged().

◆ transformOriginChanged

void QDeclarativeItem::transformOriginChanged ( TransformOrigin  )
signal
Warning
This function is not part of the public interface.

Referenced by setTransformOrigin().

◆ width()

qreal QDeclarativeItem::width ( ) const
Warning
This function is not part of the public interface. Return the width of the item

Definition at line 3569 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeContents::calcWidth(), FxGridItem::colPos(), QDeclarativeListView::createdItem(), QDeclarativeRow::doPositioning(), QDeclarativeGrid::doPositioning(), QDeclarativeFlow::doPositioning(), QDeclarativeRectangle::drawRect(), QDeclarativeFlickable::geometryChanged(), QDeclarativeFlickable::maxXExtent(), QDeclarativeGridView::maxXExtent(), QDeclarativeListView::maxXExtent(), operator<<(), QDeclarativeImage::paint(), QDeclarativeRectangle::paint(), QDeclarativeText::paint(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QDeclarativePinchArea::sendMouseEvent(), QDeclarativeFlickable::setContentWidth(), QDeclarativeItemPrivate::setHeight(), setImplicitHeight(), setImplicitWidth(), FxGridItem::setPosition(), setSize(), QDeclarativeImageBase::setSourceSize(), QDeclarativeItemPrivate::setWidth(), QDeclarativeParentAnimation::transition(), ShaderEffectSource::updateBackbuffer(), ShaderEffectItem::updateGeometry(), QDeclarativePathViewPrivate::updateItem(), QDeclarativeImage::updatePaintedGeometry(), QDeclarativeTextEdit::updateSize(), QDeclarativeTextInput::updateSize(), ShaderEffectSource::updateSizeAndTexture(), QDeclarativeGridViewPrivate::updateUnrequestedPositions(), QDeclarativeListViewPrivate::updateUnrequestedPositions(), QDeclarativeFlickableVisibleArea::updateVisible(), QDeclarativeFlickable::viewportMoved(), QDeclarativeListView::viewportMoved(), QDeclarativeFlickable::vWidth(), and QDeclarativeFlickable::xflick().

3570 {
3571  Q_D(const QDeclarativeItem);
3572  return d->width();
3573 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

◆ widthValid()

bool QDeclarativeItem::widthValid ( ) const
protected

Returns whether the width property has been set explicitly.

Definition at line 3686 of file qdeclarativeitem.cpp.

Referenced by QDeclarativeRow::doPositioning(), QDeclarativeGrid::doPositioning(), QDeclarativeFlow::doPositioning(), QDeclarativeText::geometryChanged(), QDeclarativeItemPrivate::resetWidth(), setImplicitWidth(), QDeclarativeItemPrivate::setWidth(), QDeclarativeImage::updatePaintedGeometry(), and QDeclarativeTextEdit::updateSize().

3687 {
3688  Q_D(const QDeclarativeItem);
3689  return d->widthValid;
3690 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.

Properties

◆ activeFocus

QDeclarativeItem::activeFocus
private
Warning
This function is not part of the public interface.

Definition at line 90 of file qdeclarativeitem.h.

◆ baselineOffset

qreal QDeclarativeItem::baselineOffset
private

The position of the item's baseline in local coordinates.

The baseline of a Text item is the imaginary line on which the text sits. Controls containing text usually set their baseline to the baseline of their text.

For non-text items, a default baseline offset of 0 is used.

Definition at line 87 of file qdeclarativeitem.h.

◆ childrenRect

QRectF QDeclarativeItem::childrenRect
private

The geometry of an item's children.

This property holds the (collective) position and size of the item's children.

Definition at line 72 of file qdeclarativeitem.h.

◆ clip

QDeclarativeItem::clip
private

This property holds whether clipping is enabled.

The default clip value is false.

If clipping is enabled, an item will clip its own painting, as well as the painting of its children, to its bounding rectangle. If you set clipping during an item's paint operation, remember to re-set it to prevent clipping the rest of your scene.

Non-rectangular clipping regions are not supported for performance reasons.

Definition at line 88 of file qdeclarativeitem.h.

◆ focus

QDeclarativeItem::focus
private
Warning
This function is not part of the public interface.

Definition at line 89 of file qdeclarativeitem.h.

◆ implicitHeight

qreal QDeclarativeItem::implicitHeight
private

Returns the height of the item that is implied by other properties that determine the content.

Definition at line 96 of file qdeclarativeitem.h.

◆ implicitWidth

qreal QDeclarativeItem::implicitWidth
private

Returns the width of the item that is implied by other properties that determine the content.

Definition at line 95 of file qdeclarativeitem.h.

◆ smooth

bool QDeclarativeItem::smooth
private

whether the item is smoothly transformed.

Returns true if the item should be drawn with antialiasing and smooth pixmap filtering, false otherwise.

This property is provided purely for the purpose of optimization. Turning smooth transforms off is faster, but looks worse; turning smooth transformations on is slower, but looks better.

By default smooth transformations are off.

The default is false.

See also
setSmooth()

Definition at line 94 of file qdeclarativeitem.h.

◆ transform

QDeclarativeItem::transform
private
Warning
This function is not part of the public interface.

Definition at line 91 of file qdeclarativeitem.h.

◆ transformOrigin

QDeclarativeItem::transformOrigin
private

Returns the current transform origin.

Warning
This function is not part of the public interface.

Definition at line 92 of file qdeclarativeitem.h.

Referenced by QDeclarativeParentChangePrivate::doChange(), and QDeclarativeParentAnimation::transition().

◆ transformOriginPoint

QDeclarativeItem::transformOriginPoint
private
Warning
This function is not part of the public interface.

Definition at line 93 of file qdeclarativeitem.h.

Referenced by QDeclarativeParentChangePrivate::doChange().


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