Qt 4.8
Public Types | Public Slots | Signals | Public Functions | Static Public Functions | Protected Functions | Private Slots | Private Functions | Properties | List of all members
QDeclarativeGridView Class Reference

#include <qdeclarativegridview_p.h>

Inheritance diagram for QDeclarativeGridView:
QDeclarativeFlickable QDeclarativeItem QGraphicsObject QDeclarativeParserStatus QObject QGraphicsItem

Public Types

enum  Flow { LeftToRight, TopToBottom }
 
enum  HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange }
 
enum  PositionMode {
  Beginning, Center, End, Visible,
  Contain
}
 
enum  SnapMode { NoSnap, SnapToRow, SnapOneRow }
 
- Public Types inherited from QDeclarativeFlickable
enum  BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds }
 
enum  FlickableDirection { AutoFlickDirection =0x00, HorizontalFlick =0x01, VerticalFlick =0x02, HorizontalAndVerticalFlick =0x03 }
 
- Public Types inherited from QDeclarativeItem
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...
 

Public Slots

void moveCurrentIndexDown ()
 
void moveCurrentIndexLeft ()
 
void moveCurrentIndexRight ()
 
void moveCurrentIndexUp ()
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 

Signals

void cacheBufferChanged ()
 
void cellHeightChanged ()
 
void cellWidthChanged ()
 
void countChanged ()
 
void currentIndexChanged ()
 
void delegateChanged ()
 
void flowChanged ()
 
void footerChanged ()
 
void headerChanged ()
 
void highlightChanged ()
 
void highlightItemChanged ()
 
void highlightMoveDurationChanged ()
 
void highlightRangeModeChanged ()
 
void keyNavigationWrapsChanged ()
 
void layoutDirectionChanged ()
 
void modelChanged ()
 
void preferredHighlightBeginChanged ()
 
void preferredHighlightEndChanged ()
 
void snapModeChanged ()
 
- Signals inherited from QDeclarativeFlickable
void boundsBehaviorChanged ()
 
void contentHeightChanged ()
 
void contentWidthChanged ()
 
void contentXChanged ()
 
void contentYChanged ()
 
void flickableDirectionChanged ()
 
void flickDecelerationChanged ()
 
void flickEnded ()
 
void flickingChanged ()
 
void flickingHorizontallyChanged ()
 
void flickingVerticallyChanged ()
 
void flickStarted ()
 
void horizontalVelocityChanged ()
 
void interactiveChanged ()
 
void isAtBoundaryChanged ()
 
void maximumFlickVelocityChanged ()
 
void movementEnded ()
 
void movementStarted ()
 
void movingChanged ()
 
void movingHorizontallyChanged ()
 
void movingVerticallyChanged ()
 
void pressDelayChanged ()
 
void verticalVelocityChanged ()
 
- Signals inherited from QDeclarativeItem
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

int cacheBuffer () const
 
int cellHeight () const
 
int cellWidth () const
 
int count () const
 
int currentIndex () const
 
QDeclarativeItemcurrentItem ()
 
QDeclarativeComponentdelegate () const
 
Qt::LayoutDirection effectiveLayoutDirection () const
 
Flow flow () const
 
QDeclarativeComponentfooter () const
 
QDeclarativeComponentheader () const
 
QDeclarativeComponenthighlight () const
 
bool highlightFollowsCurrentItem () const
 
QDeclarativeItemhighlightItem ()
 
int highlightMoveDuration () const
 
HighlightRangeMode highlightRangeMode () const
 
Q_INVOKABLE int indexAt (qreal x, qreal y) const
 
bool isWrapEnabled () const
 
Qt::LayoutDirection layoutDirection () const
 
QVariant model () const
 
int modelCount () const
 
Q_INVOKABLE void positionViewAtBeginning ()
 
Q_INVOKABLE void positionViewAtEnd ()
 
Q_INVOKABLE void positionViewAtIndex (int index, int mode)
 
qreal preferredHighlightBegin () const
 
qreal preferredHighlightEnd () const
 
 QDeclarativeGridView (QDeclarativeItem *parent=0)
 
void resetPreferredHighlightBegin ()
 
void resetPreferredHighlightEnd ()
 
void setCacheBuffer (int)
 
void setCellHeight (int)
 
void setCellWidth (int)
 
virtual void setContentX (qreal pos)
 
virtual void setContentY (qreal pos)
 
void setCurrentIndex (int idx)
 
void setDelegate (QDeclarativeComponent *)
 
void setFlow (Flow)
 
void setFooter (QDeclarativeComponent *)
 
void setHeader (QDeclarativeComponent *)
 
void setHighlight (QDeclarativeComponent *highlight)
 
void setHighlightFollowsCurrentItem (bool)
 
void setHighlightMoveDuration (int)
 
void setHighlightRangeMode (HighlightRangeMode mode)
 
void setLayoutDirection (Qt::LayoutDirection)
 
void setModel (const QVariant &)
 
void setPreferredHighlightBegin (qreal)
 
void setPreferredHighlightEnd (qreal)
 
void setSnapMode (SnapMode mode)
 
void setWrapEnabled (bool)
 
SnapMode snapMode () const
 
 ~QDeclarativeGridView ()
 
- Public Functions inherited from QDeclarativeFlickable
BoundsBehavior boundsBehavior () const
 
qreal contentHeight () const
 
QDeclarativeItemcontentItem ()
 
qreal contentWidth () const
 
qreal contentX () const
 
qreal contentY () const
 
QDeclarativeListProperty< QGraphicsObjectflickableChildren ()
 
QDeclarativeListProperty< QObjectflickableData ()
 
FlickableDirection flickableDirection () const
 
qreal flickDeceleration () const
 
qreal horizontalVelocity () const
 
bool isAtXBeginning () const
 
bool isAtXEnd () const
 
bool isAtYBeginning () const
 
bool isAtYEnd () const
 
bool isFlicking () const
 
bool isFlickingHorizontally () const
 
bool isFlickingVertically () const
 
bool isInteractive () const
 
bool isMoving () const
 
bool isMovingHorizontally () const
 
bool isMovingVertically () const
 
qreal maximumFlickVelocity () const
 
int pressDelay () const
 
 QDeclarativeFlickable (QDeclarativeItem *parent=0)
 
Q_INVOKABLE void resizeContent (qreal w, qreal h, QPointF center)
 
Q_INVOKABLE void returnToBounds ()
 
void setBoundsBehavior (BoundsBehavior)
 
void setContentHeight (qreal)
 
void setContentWidth (qreal)
 
void setFlickableDirection (FlickableDirection)
 
void setFlickDeceleration (qreal)
 
void setInteractive (bool)
 
void setMaximumFlickVelocity (qreal)
 
void setPressDelay (int delay)
 
qreal verticalVelocity () const
 
 ~QDeclarativeFlickable ()
 
- Public Functions inherited from QDeclarativeItem
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 ()
 

Static Public Functions

static QDeclarativeGridViewAttachedqmlAttachedProperties (QObject *)
 
- 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)
 

Protected Functions

virtual void componentComplete ()
 
virtual bool event (QEvent *event)
 
virtual void keyPressEvent (QKeyEvent *)
 
virtual qreal maxXExtent () const
 
virtual qreal maxYExtent () const
 
virtual qreal minXExtent () const
 
virtual qreal minYExtent () const
 
virtual void viewportMoved ()
 
- Protected Functions inherited from QDeclarativeFlickable
void cancelFlick ()
 
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...
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse move events for this item. More...
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse press events for this item. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse release events for this item. More...
 
void movementXEnding ()
 
void movementYEnding ()
 
 QDeclarativeFlickable (QDeclarativeFlickablePrivate &dd, QDeclarativeItem *parent)
 
bool sceneEvent (QEvent *event)
 
virtual bool sceneEventFilter (QGraphicsItem *, QEvent *)
 Filters events for the item watched. More...
 
bool sendMouseEvent (QGraphicsSceneMouseEvent *event)
 
void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
qreal vHeight () const
 
QDeclarativeFlickableVisibleAreavisibleArea ()
 
qreal vWidth () const
 
void wheelEvent (QGraphicsSceneWheelEvent *event)
 This event handler, for event event, can be reimplemented to receive wheel events for this item. More...
 
bool xflick () const
 
bool yflick () const
 
- Protected Functions inherited from QDeclarativeItem
virtual void classBegin ()
 
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...
 
void keyPressPreHandler (QKeyEvent *)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
void keyReleasePreHandler (QKeyEvent *)
 
 QDeclarativeItem (QDeclarativeItemPrivate &dd, QDeclarativeItem *parent=0)
 
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
 
- 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...
 
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 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...
 

Private Slots

void animStopped ()
 
void createdItem (int index, QDeclarativeItem *item)
 
void destroyingItem (QDeclarativeItem *item)
 
void destroyRemoved ()
 
void itemsInserted (int index, int count)
 
void itemsMoved (int from, int to, int count)
 
void itemsRemoved (int index, int count)
 
void modelReset ()
 
void trackedPositionChanged ()
 

Private Functions

void refill ()
 

Properties

int cacheBuffer
 
int cellHeight
 
int cellWidth
 
int count
 
int currentIndex
 
QDeclarativeItemcurrentItem
 
QDeclarativeComponentdelegate
 
Flow flow
 
QDeclarativeComponentfooter
 
QDeclarativeComponentheader
 
QDeclarativeComponenthighlight
 
bool highlightFollowsCurrentItem
 
QDeclarativeItemhighlightItem
 
int highlightMoveDuration
 
HighlightRangeMode highlightRangeMode
 
bool keyNavigationWraps
 
Qt::LayoutDirection layoutDirection
 
QVariant model
 
qreal preferredHighlightBegin
 
qreal preferredHighlightEnd
 
SnapMode snapMode
 

Additional Inherited Members

- 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 QDeclarativeFlickable
void movementEnding ()
 
void movementStarting ()
 
virtual void ticked ()
 
- 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

Definition at line 56 of file qdeclarativegridview_p.h.

Enumerations

◆ Flow

◆ HighlightRangeMode

◆ PositionMode

◆ SnapMode

Constructors and Destructors

◆ QDeclarativeGridView()

QDeclarativeGridView::QDeclarativeGridView ( QDeclarativeItem parent = 0)

Definition at line 1349 of file qdeclarativegridview.cpp.

1351 {
1353  d->init();
1354 }
QDeclarativeParserStatus ** d
QDeclarativeFlickable(QDeclarativeItem *parent=0)
#define Q_D(Class)
Definition: qglobal.h:2482

◆ ~QDeclarativeGridView()

QDeclarativeGridView::~QDeclarativeGridView ( )

Definition at line 1356 of file qdeclarativegridview.cpp.

1357 {
1359  d->clear();
1360  if (d->ownModel)
1361  delete d->model;
1362  delete d->header;
1363  delete d->footer;
1364 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

Functions

◆ animStopped

void QDeclarativeGridView::animStopped ( )
privateslot

Definition at line 3230 of file qdeclarativegridview.cpp.

3231 {
3234  if (d->haveHighlightRange && d->highlightRange == QDeclarativeGridView::StrictlyEnforceRange)
3235  d->updateHighlight();
3236 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ cacheBuffer()

int QDeclarativeGridView::cacheBuffer ( ) const

Referenced by setWrapEnabled().

◆ cacheBufferChanged

void QDeclarativeGridView::cacheBufferChanged ( )
signal

Referenced by setCacheBuffer().

◆ cellHeight()

int QDeclarativeGridView::cellHeight ( ) const

Referenced by setCellWidth().

◆ cellHeightChanged

void QDeclarativeGridView::cellHeightChanged ( )
signal

Referenced by setCellHeight().

◆ cellWidth()

int QDeclarativeGridView::cellWidth ( ) const

Referenced by setCacheBuffer().

◆ cellWidthChanged

void QDeclarativeGridView::cellWidthChanged ( )
signal

Referenced by setCellWidth().

◆ componentComplete()

void QDeclarativeGridView::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.

Reimplemented from QDeclarativeItem.

Definition at line 2766 of file qdeclarativegridview.cpp.

2767 {
2770  d->updateHeader();
2771  d->updateFooter();
2772  d->updateGrid();
2773  if (d->isValid()) {
2774  refill();
2776  if (d->currentIndex < 0 && !d->currentIndexCleared)
2777  d->updateCurrent(0);
2778  else
2779  d->updateCurrent(d->currentIndex);
2780  if (d->highlight && d->currentItem) {
2781  if (d->autoHighlight)
2782  d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
2783  d->updateTrackedItem();
2784  }
2785  d->moveReason = QDeclarativeGridViewPrivate::Other;
2786  d->fixupPosition();
2787  }
2788 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void componentComplete()

◆ count()

int QDeclarativeGridView::count ( ) const

◆ countChanged

void QDeclarativeGridView::countChanged ( )
signal

◆ createdItem

void QDeclarativeGridView::createdItem ( int  index,
QDeclarativeItem item 
)
privateslot

Definition at line 3210 of file qdeclarativegridview.cpp.

Referenced by setModel().

3211 {
3213  if (d->requestedIndex != index) {
3214  item->setParentItem(this);
3215  d->unrequestedItems.insert(item, index);
3216  if (d->flow == QDeclarativeGridView::LeftToRight) {
3217  item->setPos(QPointF(d->colPosAt(index), d->rowPosAt(index)));
3218  } else {
3219  item->setPos(QPointF(d->rowPosAt(index), d->colPosAt(index)));
3220  }
3221  }
3222 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
void setPos(const QPointF &pos)
Sets the position of the item to pos, which is in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
void setParentItem(QDeclarativeItem *parent)
quint16 index

◆ currentIndex()

int QDeclarativeGridView::currentIndex ( ) const

◆ currentIndexChanged

void QDeclarativeGridView::currentIndexChanged ( )
signal

◆ currentItem()

QDeclarativeItem* QDeclarativeGridView::currentItem ( )

◆ delegate()

QDeclarativeComponent* QDeclarativeGridView::delegate ( ) const

Referenced by setDelegate(), and setModel().

◆ delegateChanged

void QDeclarativeGridView::delegateChanged ( )
signal

Referenced by setDelegate().

◆ destroyingItem

void QDeclarativeGridView::destroyingItem ( QDeclarativeItem item)
privateslot

Definition at line 3224 of file qdeclarativegridview.cpp.

Referenced by setModel().

3225 {
3227  d->unrequestedItems.remove(item);
3228 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ destroyRemoved

void QDeclarativeGridView::destroyRemoved ( )
privateslot

Definition at line 3078 of file qdeclarativegridview.cpp.

Referenced by itemsRemoved().

3079 {
3081  for (QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
3082  it != d->visibleItems.end();) {
3083  FxGridItem *listItem = *it;
3084  if (listItem->index == -1 && listItem->attached->delayRemove() == false) {
3085  d->releaseItem(listItem);
3086  it = d->visibleItems.erase(it);
3087  } else {
3088  ++it;
3089  }
3090  }
3091 
3092  // Correct the positioning of the items
3093  d->layout();
3094 }
QDeclarativeParserStatus ** d
#define it(className, varName)
QDeclarativeGridViewAttached * attached
#define Q_D(Class)
Definition: qglobal.h:2482
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181

◆ effectiveLayoutDirection()

Qt::LayoutDirection QDeclarativeGridView::effectiveLayoutDirection ( ) const

Definition at line 1905 of file qdeclarativegridview.cpp.

Referenced by FxGridItem::colPos(), FxGridItem::endRowPos(), moveCurrentIndexLeft(), moveCurrentIndexRight(), FxGridItem::rowPos(), and FxGridItem::setPosition().

1906 {
1907  Q_D(const QDeclarativeGridView);
1908  if (d->effectiveLayoutMirror)
1909  return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
1910  else
1911  return d->layoutDirection;
1912 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ event()

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

Reimplemented from QDeclarativeItem.

Definition at line 2193 of file qdeclarativegridview.cpp.

2194 {
2196  if (event->type() == QEvent::User) {
2197  if (d->layoutScheduled)
2198  d->layout();
2199  return true;
2200  }
2201 
2203 }
QDeclarativeParserStatus ** d
virtual bool event(QEvent *)
#define Q_D(Class)
Definition: qglobal.h:2482
virtual bool event(QEvent *event)

◆ flow()

Flow QDeclarativeGridView::flow ( ) const

◆ flowChanged

void QDeclarativeGridView::flowChanged ( )
signal

Referenced by setFlow().

◆ footer()

QDeclarativeComponent* QDeclarativeGridView::footer ( ) const

◆ footerChanged

void QDeclarativeGridView::footerChanged ( )
signal

Referenced by setFooter().

◆ header()

QDeclarativeComponent* QDeclarativeGridView::header ( ) const

◆ headerChanged

void QDeclarativeGridView::headerChanged ( )
signal

Referenced by setHeader().

◆ highlight()

QDeclarativeComponent* QDeclarativeGridView::highlight ( ) const

Referenced by setCurrentIndex(), and setHighlight().

◆ highlightChanged

void QDeclarativeGridView::highlightChanged ( )
signal

Referenced by setHighlight().

◆ highlightFollowsCurrentItem()

bool QDeclarativeGridView::highlightFollowsCurrentItem ( ) const

Referenced by setHighlight().

◆ highlightItem()

QDeclarativeItem* QDeclarativeGridView::highlightItem ( )

Referenced by setCurrentIndex().

◆ highlightItemChanged

void QDeclarativeGridView::highlightItemChanged ( )
signal

◆ highlightMoveDuration()

int QDeclarativeGridView::highlightMoveDuration ( ) const

◆ highlightMoveDurationChanged

void QDeclarativeGridView::highlightMoveDurationChanged ( )
signal

◆ highlightRangeMode()

HighlightRangeMode QDeclarativeGridView::highlightRangeMode ( ) const

◆ highlightRangeModeChanged

void QDeclarativeGridView::highlightRangeModeChanged ( )
signal

Referenced by setHighlightRangeMode().

◆ indexAt()

int QDeclarativeGridView::indexAt ( qreal  x,
qreal  y 
) const

Definition at line 2754 of file qdeclarativegridview.cpp.

2755 {
2756  Q_D(const QDeclarativeGridView);
2757  for (int i = 0; i < d->visibleItems.count(); ++i) {
2758  const FxGridItem *listItem = d->visibleItems.at(i);
2759  if(listItem->contains(x, y))
2760  return listItem->index;
2761  }
2762 
2763  return -1;
2764 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().
bool contains(qreal x, qreal y) const

◆ isWrapEnabled()

bool QDeclarativeGridView::isWrapEnabled ( ) const

Definition at line 1966 of file qdeclarativegridview.cpp.

1967 {
1968  Q_D(const QDeclarativeGridView);
1969  return d->wrap;
1970 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ itemsInserted

void QDeclarativeGridView::itemsInserted ( int  index,
int  count 
)
privateslot

Definition at line 2856 of file qdeclarativegridview.cpp.

Referenced by setModel().

2857 {
2859  if (!isComponentComplete())
2860  return;
2861 
2862  int index = d->visibleItems.count() ? d->mapFromModel(modelIndex) : 0;
2863  if (index < 0) {
2864  int i = d->visibleItems.count() - 1;
2865  while (i > 0 && d->visibleItems.at(i)->index == -1)
2866  --i;
2867  if (d->visibleItems.at(i)->index + 1 == modelIndex) {
2868  // Special case of appending an item to the model.
2869  index = d->visibleIndex + d->visibleItems.count();
2870  } else {
2871  if (modelIndex <= d->visibleIndex) {
2872  // Insert before visible items
2873  d->visibleIndex += count;
2874  for (int i = 0; i < d->visibleItems.count(); ++i) {
2875  FxGridItem *listItem = d->visibleItems.at(i);
2876  if (listItem->index != -1 && listItem->index >= modelIndex)
2877  listItem->index += count;
2878  }
2879  }
2880  if (d->currentIndex >= modelIndex) {
2881  // adjust current item index
2882  d->currentIndex += count;
2883  if (d->currentItem)
2884  d->currentItem->index = d->currentIndex;
2886  }
2887  d->scheduleLayout();
2888  d->itemCount += count;
2889  emit countChanged();
2890  return;
2891  }
2892  }
2893 
2894  int insertCount = count;
2895  if (index < d->visibleIndex && d->visibleItems.count()) {
2896  insertCount -= d->visibleIndex - index;
2897  index = d->visibleIndex;
2898  modelIndex = d->visibleIndex;
2899  }
2900 
2901  qreal tempPos = d->isRightToLeftTopToBottom() ? -d->position()-d->size()+d->width()+1 : d->position();
2902  int to = d->buffer+tempPos+d->size()-1;
2903  int colPos = 0;
2904  int rowPos = 0;
2905  if (d->visibleItems.count()) {
2906  index -= d->visibleIndex;
2907  if (index < d->visibleItems.count()) {
2908  colPos = d->visibleItems.at(index)->colPos();
2909  rowPos = d->visibleItems.at(index)->rowPos();
2910  } else {
2911  // appending items to visible list
2912  colPos = d->visibleItems.at(index-1)->colPos() + d->colSize();
2913  rowPos = d->visibleItems.at(index-1)->rowPos();
2914  if (colPos > d->colSize() * (d->columns-1)) {
2915  colPos = 0;
2916  rowPos += d->rowSize();
2917  }
2918  }
2919  } else if (d->itemCount == 0 && d->header) {
2920  rowPos = d->headerSize();
2921  }
2922 
2923  // Update the indexes of the following visible items.
2924  for (int i = 0; i < d->visibleItems.count(); ++i) {
2925  FxGridItem *listItem = d->visibleItems.at(i);
2926  if (listItem->index != -1 && listItem->index >= modelIndex)
2927  listItem->index += count;
2928  }
2929 
2930  bool addedVisible = false;
2931  QList<FxGridItem*> added;
2932  int i = 0;
2933  while (i < insertCount && rowPos <= to + d->rowSize()*(d->columns - (colPos/d->colSize()))/qreal(d->columns+1)) {
2934  if (!addedVisible) {
2935  d->scheduleLayout();
2936  addedVisible = true;
2937  }
2938  FxGridItem *item = d->createItem(modelIndex + i);
2939  if (!item) {
2940  // broken or no delegate
2941  d->clear();
2942  return;
2943  }
2944  d->visibleItems.insert(index, item);
2945  item->setPosition(colPos, rowPos);
2946  added.append(item);
2947  colPos += d->colSize();
2948  if (colPos > d->colSize() * (d->columns-1)) {
2949  colPos = 0;
2950  rowPos += d->rowSize();
2951  }
2952  ++index;
2953  ++i;
2954  }
2955  if (i < insertCount) {
2956  // We didn't insert all our new items, which means anything
2957  // beyond the current index is not visible - remove it.
2958  while (d->visibleItems.count() > index) {
2959  d->releaseItem(d->visibleItems.takeLast());
2960  }
2961  }
2962 
2963  // update visibleIndex
2964  d->visibleIndex = 0;
2965  for (QList<FxGridItem*>::Iterator it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
2966  if ((*it)->index != -1) {
2967  d->visibleIndex = (*it)->index;
2968  break;
2969  }
2970  }
2971 
2972  if (d->itemCount && d->currentIndex >= modelIndex) {
2973  // adjust current item index
2974  d->currentIndex += count;
2975  if (d->currentItem) {
2976  d->currentItem->index = d->currentIndex;
2977  d->currentItem->setPosition(d->colPosAt(d->currentIndex), d->rowPosAt(d->currentIndex));
2978  }
2980  } else if (d->itemCount == 0 && (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared))) {
2981  setCurrentIndex(0);
2982  }
2983 
2984  // everything is in order now - emit add() signal
2985  for (int j = 0; j < added.count(); ++j)
2986  added.at(j)->attached->emitAdd();
2987 
2988  d->itemCount += count;
2989  emit countChanged();
2990 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
#define it(className, varName)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
QDeclarativeGridViewAttached * attached
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_D(Class)
Definition: qglobal.h:2482
void setPosition(qreal col, qreal row)
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181
quint16 index
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ itemsMoved

void QDeclarativeGridView::itemsMoved ( int  from,
int  to,
int  count 
)
privateslot

Definition at line 3096 of file qdeclarativegridview.cpp.

Referenced by setModel().

3097 {
3099  if (!isComponentComplete())
3100  return;
3101  QHash<int,FxGridItem*> moved;
3102 
3103  FxGridItem *firstItem = d->firstVisibleItem();
3104 
3105  QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
3106  while (it != d->visibleItems.end()) {
3107  FxGridItem *item = *it;
3108  if (item->index >= from && item->index < from + count) {
3109  // take the items that are moving
3110  item->index += (to-from);
3111  moved.insert(item->index, item);
3112  it = d->visibleItems.erase(it);
3113  } else {
3114  if (item->index > from && item->index != -1) {
3115  // move everything after the moved items.
3116  item->index -= count;
3117  if (item->index < d->visibleIndex)
3118  d->visibleIndex = item->index;
3119  }
3120  ++it;
3121  }
3122  }
3123 
3124  int remaining = count;
3125  int endIndex = d->visibleIndex;
3126  it = d->visibleItems.begin();
3127  while (it != d->visibleItems.end()) {
3128  FxGridItem *item = *it;
3129  if (remaining && item->index >= to && item->index < to + count) {
3130  // place items in the target position, reusing any existing items
3131  FxGridItem *movedItem = moved.take(item->index);
3132  if (!movedItem)
3133  movedItem = d->createItem(item->index);
3134  if (!movedItem) {
3135  // broken or no delegate
3136  d->clear();
3137  return;
3138  }
3139  it = d->visibleItems.insert(it, movedItem);
3140  if (it == d->visibleItems.begin() && firstItem)
3141  movedItem->setPosition(firstItem->colPos(), firstItem->rowPos());
3142  ++it;
3143  --remaining;
3144  } else {
3145  if (item->index != -1) {
3146  if (item->index >= to) {
3147  // update everything after the moved items.
3148  item->index += count;
3149  }
3150  endIndex = item->index;
3151  }
3152  ++it;
3153  }
3154  }
3155 
3156  // If we have moved items to the end of the visible items
3157  // then add any existing moved items that we have
3158  while (FxGridItem *item = moved.take(endIndex+1)) {
3159  d->visibleItems.append(item);
3160  ++endIndex;
3161  }
3162 
3163  // update visibleIndex
3164  for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
3165  if ((*it)->index != -1) {
3166  d->visibleIndex = (*it)->index;
3167  break;
3168  }
3169  }
3170 
3171  // Fix current index
3172  if (d->currentIndex >= 0 && d->currentItem) {
3173  int oldCurrent = d->currentIndex;
3174  d->currentIndex = d->model->indexOf(d->currentItem->item, this);
3175  if (oldCurrent != d->currentIndex) {
3176  d->currentItem->index = d->currentIndex;
3178  }
3179  }
3180 
3181  // Whatever moved items remain are no longer visible items.
3182  while (moved.count()) {
3183  int idx = moved.begin().key();
3184  FxGridItem *item = moved.take(idx);
3185  if (d->currentItem && item->item == d->currentItem->item)
3186  item->setPosition(d->colPosAt(idx), d->rowPosAt(idx));
3187  d->releaseItem(item);
3188  }
3189 
3190  d->layout();
3191 }
QDeclarativeParserStatus ** d
#define it(className, varName)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it...
Definition: qhash.h:807
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define Q_D(Class)
Definition: qglobal.h:2482
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
void setPosition(qreal col, qreal row)
#define emit
Definition: qobjectdefs.h:76
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181
qreal colPos() const
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464
int count(const Key &key) const
Returns the number of items associated with the key.
Definition: qhash.h:719
qreal rowPos() const
QDeclarativeItem * item

◆ itemsRemoved

void QDeclarativeGridView::itemsRemoved ( int  index,
int  count 
)
privateslot

Definition at line 2992 of file qdeclarativegridview.cpp.

Referenced by setModel().

2993 {
2995  if (!isComponentComplete())
2996  return;
2997 
2998  d->itemCount -= count;
2999  bool currentRemoved = d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count;
3000  bool removedVisible = false;
3001  // Remove the items from the visible list, skipping anything already marked for removal
3002  QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
3003  while (it != d->visibleItems.end()) {
3004  FxGridItem *item = *it;
3005  if (item->index == -1 || item->index < modelIndex) {
3006  // already removed, or before removed items
3007  if (item->index < modelIndex && !removedVisible) {
3008  d->scheduleLayout();
3009  removedVisible = true;
3010  }
3011  ++it;
3012  } else if (item->index >= modelIndex + count) {
3013  // after removed items
3014  item->index -= count;
3015  ++it;
3016  } else {
3017  // removed item
3018  if (!removedVisible) {
3019  d->scheduleLayout();
3020  removedVisible = true;
3021  }
3022  item->attached->emitRemove();
3023  if (item->attached->delayRemove()) {
3024  item->index = -1;
3025  connect(item->attached, SIGNAL(delayRemoveChanged()), this, SLOT(destroyRemoved()), Qt::QueuedConnection);
3026  ++it;
3027  } else {
3028  it = d->visibleItems.erase(it);
3029  d->releaseItem(item);
3030  }
3031  }
3032  }
3033 
3034  // If we removed items before visible items a layout may be
3035  // required to ensure item 0 is in the first column.
3036  if (!removedVisible && modelIndex < d->visibleIndex)
3037  d->scheduleLayout();
3038 
3039  // fix current
3040  if (d->currentIndex >= modelIndex + count) {
3041  d->currentIndex -= count;
3042  if (d->currentItem)
3043  d->currentItem->index -= count;
3045  } else if (currentRemoved) {
3046  // current item has been removed.
3047  d->releaseItem(d->currentItem);
3048  d->currentItem = 0;
3049  d->currentIndex = -1;
3050  if (d->itemCount)
3051  d->updateCurrent(qMin(modelIndex, d->itemCount-1));
3052  else
3054  }
3055 
3056  // update visibleIndex
3057  d->visibleIndex = 0;
3058  for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
3059  if ((*it)->index != -1) {
3060  d->visibleIndex = (*it)->index;
3061  break;
3062  }
3063  }
3064 
3065  if (removedVisible && d->visibleItems.isEmpty()) {
3066  d->timeline.clear();
3067  if (d->itemCount == 0) {
3068  d->setPosition(0);
3069  d->updateHeader();
3070  d->updateFooter();
3071  update();
3072  }
3073  }
3074 
3075  emit countChanged();
3076 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
#define it(className, varName)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
QDeclarativeGridViewAttached * attached
#define SLOT(a)
Definition: qobjectdefs.h:226
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
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
#define emit
Definition: qobjectdefs.h:76
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181

◆ keyNavigationWrapsChanged

void QDeclarativeGridView::keyNavigationWrapsChanged ( )
signal

Referenced by setWrapEnabled().

◆ keyPressEvent()

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

Reimplemented from QDeclarativeItem.

Definition at line 2383 of file qdeclarativegridview.cpp.

2384 {
2386  keyPressPreHandler(event);
2387  if (event->isAccepted())
2388  return;
2389  if (d->model && d->model->count() && d->interactive) {
2391  int oldCurrent = currentIndex();
2392  switch (event->key()) {
2393  case Qt::Key_Up:
2395  break;
2396  case Qt::Key_Down:
2398  break;
2399  case Qt::Key_Left:
2401  break;
2402  case Qt::Key_Right:
2404  break;
2405  default:
2406  break;
2407  }
2408  if (oldCurrent != currentIndex()) {
2409  event->accept();
2410  return;
2411  }
2412  }
2413  d->moveReason = QDeclarativeGridViewPrivate::Other;
2414  event->ignore();
2416 }
QDeclarativeParserStatus ** d
virtual void keyPressEvent(QKeyEvent *event)
#define Q_D(Class)
Definition: qglobal.h:2482
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
int currentIndex() const
void keyPressPreHandler(QKeyEvent *)

◆ layoutDirection()

Qt::LayoutDirection QDeclarativeGridView::layoutDirection ( ) const

◆ layoutDirectionChanged

void QDeclarativeGridView::layoutDirectionChanged ( )
signal

Referenced by setLayoutDirection().

◆ maxXExtent()

qreal QDeclarativeGridView::maxXExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2338 of file qdeclarativegridview.cpp.

2339 {
2340  Q_D(const QDeclarativeGridView);
2341  if (d->flow == QDeclarativeGridView::LeftToRight)
2343  qreal extent;
2344  qreal highlightStart;
2345  qreal highlightEnd;
2346  qreal lastItemPosition = 0;
2347  if (d->isRightToLeftTopToBottom()){
2348  highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
2349  highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
2350  lastItemPosition = d->endPosition();
2351  } else {
2352  highlightStart = d->highlightRangeStart;
2353  highlightEnd = d->highlightRangeEnd;
2354  lastItemPosition = 0;
2355  if (d->model && d->model->count())
2356  lastItemPosition = d->rowPosAt(d->model->count()-1);
2357  }
2358  if (!d->model || !d->model->count()) {
2359  extent = 0;
2360  } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2361  extent = -(lastItemPosition - highlightStart);
2362  if (highlightEnd != highlightStart)
2363  extent = d->isRightToLeftTopToBottom()
2364  ? qMax(extent, -(d->endPosition() - highlightEnd + 1))
2365  : qMin(extent, -(d->endPosition() - highlightEnd + 1));
2366  } else {
2367  extent = -(d->endPosition() - width());
2368  }
2369  if (d->isRightToLeftTopToBottom()) {
2370  if (d->header)
2371  extent -= d->header->item->width();
2372  } else {
2373  if (d->footer)
2374  extent -= d->footer->item->width();
2375  }
2376 
2377  const qreal minX = minXExtent();
2378  if (extent > minX)
2379  extent = minX;
2380  return extent;
2381 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual qreal maxXExtent() const
virtual qreal minXExtent() const

◆ maxYExtent()

qreal QDeclarativeGridView::maxYExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2283 of file qdeclarativegridview.cpp.

2284 {
2285  Q_D(const QDeclarativeGridView);
2286  if (d->flow == QDeclarativeGridView::TopToBottom)
2288  qreal extent;
2289  if (!d->model || !d->model->count()) {
2290  extent = 0;
2291  } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2292  extent = -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart);
2293  if (d->highlightRangeEnd != d->highlightRangeStart)
2294  extent = qMin(extent, -(d->endPosition() - d->highlightRangeEnd + 1));
2295  } else {
2296  extent = -(d->endPosition() - height());
2297  }
2298  if (d->footer)
2299  extent -= d->footer->item->height();
2300  const qreal minY = minYExtent();
2301  if (extent > minY)
2302  extent = minY;
2303  return extent;
2304 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
virtual qreal maxYExtent() const
virtual qreal minYExtent() const
#define Q_D(Class)
Definition: qglobal.h:2482

◆ minXExtent()

qreal QDeclarativeGridView::minXExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2306 of file qdeclarativegridview.cpp.

Referenced by maxXExtent().

2307 {
2308  Q_D(const QDeclarativeGridView);
2309  if (d->flow == QDeclarativeGridView::LeftToRight)
2311  qreal extent = -d->startPosition();
2312  qreal highlightStart;
2313  qreal highlightEnd;
2314  qreal endPositionFirstItem = 0;
2315  if (d->isRightToLeftTopToBottom()) {
2316  if (d->model && d->model->count())
2317  endPositionFirstItem = d->rowPosAt(d->model->count()-1);
2318  highlightStart = d->highlightRangeStartValid
2319  ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
2320  : d->size() - (d->lastPosition()-endPositionFirstItem);
2321  highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
2322  if (d->footer && d->visibleItems.count())
2323  extent += d->footer->item->width();
2324  } else {
2325  endPositionFirstItem = d->rowPosAt(0)+d->rowSize();
2326  highlightStart = d->highlightRangeStart;
2327  highlightEnd = d->highlightRangeEnd;
2328  if (d->header && d->visibleItems.count())
2329  extent += d->header->item->width();
2330  }
2331  if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2332  extent += d->isRightToLeftTopToBottom() ? -highlightStart : highlightStart;
2333  extent = qMax(extent, -(endPositionFirstItem - highlightEnd));
2334  }
2335  return extent;
2336 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual qreal minXExtent() const

◆ minYExtent()

qreal QDeclarativeGridView::minYExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2268 of file qdeclarativegridview.cpp.

Referenced by maxYExtent().

2269 {
2270  Q_D(const QDeclarativeGridView);
2271  if (d->flow == QDeclarativeGridView::TopToBottom)
2273  qreal extent = -d->startPosition();
2274  if (d->header && d->visibleItems.count())
2275  extent += d->header->item->height();
2276  if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2277  extent += d->highlightRangeStart;
2278  extent = qMax(extent, -(d->rowPosAt(0) + d->rowSize() - d->highlightRangeEnd));
2279  }
2280  return extent;
2281 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual qreal minYExtent() const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217

◆ model()

QVariant QDeclarativeGridView::model ( ) const

◆ modelChanged

void QDeclarativeGridView::modelChanged ( )
signal

Referenced by setModel().

◆ modelCount()

int QDeclarativeGridView::modelCount ( ) const

Definition at line 1444 of file qdeclarativegridview.cpp.

1445 {
1446  Q_D(const QDeclarativeGridView);
1447  return d->model->count();
1448 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ modelReset

void QDeclarativeGridView::modelReset ( )
privateslot

Definition at line 3193 of file qdeclarativegridview.cpp.

Referenced by setModel().

3194 {
3196  d->clear();
3197  refill();
3199  d->updateCurrent(d->currentIndex);
3200  if (d->highlight && d->currentItem) {
3201  if (d->autoHighlight)
3202  d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
3203  d->updateTrackedItem();
3204  }
3205  d->moveReason = QDeclarativeGridViewPrivate::Other;
3206 
3207  emit countChanged();
3208 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ moveCurrentIndexDown

void QDeclarativeGridView::moveCurrentIndexDown ( )
slot

Definition at line 2461 of file qdeclarativegridview.cpp.

Referenced by keyPressEvent().

2462 {
2464  const int count = d->model ? d->model->count() : 0;
2465  if (!count)
2466  return;
2467  if (d->flow == QDeclarativeGridView::LeftToRight) {
2468  if (currentIndex() < count - d->columns || d->wrap) {
2469  int index = currentIndex()+d->columns;
2470  setCurrentIndex((index >= 0 && index < count) ? index : 0);
2471  }
2472  } else {
2473  if (currentIndex() < count - 1 || d->wrap) {
2474  int index = currentIndex() + 1;
2475  setCurrentIndex((index >= 0 && index < count) ? index : 0);
2476  }
2477  }
2478 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
int currentIndex() const
quint16 index

◆ moveCurrentIndexLeft

void QDeclarativeGridView::moveCurrentIndexLeft ( )
slot

Definition at line 2492 of file qdeclarativegridview.cpp.

Referenced by keyPressEvent().

2493 {
2495  const int count = d->model ? d->model->count() : 0;
2496  if (!count)
2497  return;
2498 
2500  if (d->flow == QDeclarativeGridView::LeftToRight) {
2501  if (currentIndex() > 0 || d->wrap) {
2502  int index = currentIndex() - 1;
2503  setCurrentIndex((index >= 0 && index < count) ? index : count-1);
2504  }
2505  } else {
2506  if (currentIndex() >= d->columns || d->wrap) {
2507  int index = currentIndex() - d->columns;
2508  setCurrentIndex((index >= 0 && index < count) ? index : count-1);
2509  }
2510  }
2511  } else {
2512  if (d->flow == QDeclarativeGridView::LeftToRight) {
2513  if (currentIndex() < count - 1 || d->wrap) {
2514  int index = currentIndex() + 1;
2515  setCurrentIndex((index >= 0 && index < count) ? index : 0);
2516  }
2517  } else {
2518  if (currentIndex() < count - d->columns || d->wrap) {
2519  int index = currentIndex() + d->columns;
2520  setCurrentIndex((index >= 0 && index < count) ? index : 0);
2521  }
2522  }
2523  }
2524 }
Qt::LayoutDirection effectiveLayoutDirection() const
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
int currentIndex() const
quint16 index

◆ moveCurrentIndexRight

void QDeclarativeGridView::moveCurrentIndexRight ( )
slot

Definition at line 2538 of file qdeclarativegridview.cpp.

Referenced by keyPressEvent().

2539 {
2541  const int count = d->model ? d->model->count() : 0;
2542  if (!count)
2543  return;
2544 
2546  if (d->flow == QDeclarativeGridView::LeftToRight) {
2547  if (currentIndex() < count - 1 || d->wrap) {
2548  int index = currentIndex() + 1;
2549  setCurrentIndex((index >= 0 && index < count) ? index : 0);
2550  }
2551  } else {
2552  if (currentIndex() < count - d->columns || d->wrap) {
2553  int index = currentIndex()+d->columns;
2554  setCurrentIndex((index >= 0 && index < count) ? index : 0);
2555  }
2556  }
2557  } else {
2558  if (d->flow == QDeclarativeGridView::LeftToRight) {
2559  if (currentIndex() > 0 || d->wrap) {
2560  int index = currentIndex() - 1;
2561  setCurrentIndex((index >= 0 && index < count) ? index : count-1);
2562  }
2563  } else {
2564  if (currentIndex() >= d->columns || d->wrap) {
2565  int index = currentIndex() - d->columns;
2566  setCurrentIndex((index >= 0 && index < count) ? index : count-1);
2567  }
2568  }
2569  }
2570 }
Qt::LayoutDirection effectiveLayoutDirection() const
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
int currentIndex() const
quint16 index

◆ moveCurrentIndexUp

void QDeclarativeGridView::moveCurrentIndexUp ( )
slot

Definition at line 2430 of file qdeclarativegridview.cpp.

Referenced by keyPressEvent().

2431 {
2433  const int count = d->model ? d->model->count() : 0;
2434  if (!count)
2435  return;
2436  if (d->flow == QDeclarativeGridView::LeftToRight) {
2437  if (currentIndex() >= d->columns || d->wrap) {
2438  int index = currentIndex() - d->columns;
2439  setCurrentIndex((index >= 0 && index < count) ? index : count-1);
2440  }
2441  } else {
2442  if (currentIndex() > 0 || d->wrap) {
2443  int index = currentIndex() - 1;
2444  setCurrentIndex((index >= 0 && index < count) ? index : count-1);
2445  }
2446  }
2447 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
int currentIndex() const
quint16 index

◆ positionViewAtBeginning()

void QDeclarativeGridView::positionViewAtBeginning ( )

Definition at line 2723 of file qdeclarativegridview.cpp.

2724 {
2726  if (!d->isValid())
2727  return;
2728  d->positionViewAtIndex(-1, Beginning);
2729 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ positionViewAtEnd()

void QDeclarativeGridView::positionViewAtEnd ( )

Definition at line 2731 of file qdeclarativegridview.cpp.

2732 {
2734  if (!d->isValid())
2735  return;
2736  d->positionViewAtIndex(d->model->count(), End);
2737 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ positionViewAtIndex()

void QDeclarativeGridView::positionViewAtIndex ( int  index,
int  mode 
)

Definition at line 2692 of file qdeclarativegridview.cpp.

2693 {
2695  if (!d->isValid() || index < 0 || index >= d->model->count())
2696  return;
2697  d->positionViewAtIndex(index, mode);
2698 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
quint16 index

◆ preferredHighlightBegin()

qreal QDeclarativeGridView::preferredHighlightBegin ( ) const

◆ preferredHighlightBeginChanged

void QDeclarativeGridView::preferredHighlightBeginChanged ( )
signal

◆ preferredHighlightEnd()

qreal QDeclarativeGridView::preferredHighlightEnd ( ) const

◆ preferredHighlightEndChanged

void QDeclarativeGridView::preferredHighlightEndChanged ( )
signal

◆ qmlAttachedProperties()

QDeclarativeGridViewAttached * QDeclarativeGridView::qmlAttachedProperties ( QObject obj)
static

Definition at line 3248 of file qdeclarativegridview.cpp.

◆ refill()

void QDeclarativeGridView::refill ( )
private

Definition at line 3238 of file qdeclarativegridview.cpp.

Referenced by componentComplete(), modelReset(), setCacheBuffer(), setDelegate(), setModel(), and viewportMoved().

3239 {
3241  if (d->isRightToLeftTopToBottom())
3242  d->refill(-d->position()-d->size()+1, -d->position());
3243  else
3244  d->refill(d->position(), d->position()+d->size()-1);
3245 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ resetPreferredHighlightBegin()

void QDeclarativeGridView::resetPreferredHighlightBegin ( )

Definition at line 1812 of file qdeclarativegridview.cpp.

1813 {
1815  d->highlightRangeStartValid = false;
1816  if (d->highlightRangeStart == 0)
1817  return;
1818  d->highlightRangeStart = 0;
1820 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void preferredHighlightBeginChanged()

◆ resetPreferredHighlightEnd()

void QDeclarativeGridView::resetPreferredHighlightEnd ( )

Definition at line 1839 of file qdeclarativegridview.cpp.

1840 {
1842  d->highlightRangeEndValid = false;
1843  if (d->highlightRangeEnd == 0)
1844  return;
1845  d->highlightRangeEnd = 0;
1847 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void preferredHighlightEndChanged()

◆ setCacheBuffer()

void QDeclarativeGridView::setCacheBuffer ( int  buffer)

Definition at line 2009 of file qdeclarativegridview.cpp.

2010 {
2012  if (d->buffer != buffer) {
2013  d->buffer = buffer;
2014  if (isComponentComplete())
2015  refill();
2017  }
2018 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setCellHeight()

void QDeclarativeGridView::setCellHeight ( int  cellHeight)

Definition at line 2054 of file qdeclarativegridview.cpp.

2055 {
2057  if (cellHeight != d->cellHeight && cellHeight > 0) {
2058  d->cellHeight = qMax(1, cellHeight);
2059  d->updateGrid();
2061  d->layout();
2062  }
2063 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define emit
Definition: qobjectdefs.h:76
int cellHeight() const

◆ setCellWidth()

void QDeclarativeGridView::setCellWidth ( int  cellWidth)

Definition at line 2037 of file qdeclarativegridview.cpp.

2038 {
2040  if (cellWidth != d->cellWidth && cellWidth > 0) {
2041  d->cellWidth = qMax(1, cellWidth);
2042  d->updateGrid();
2044  d->layout();
2045  }
2046 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define emit
Definition: qobjectdefs.h:76
int cellWidth() const

◆ setContentX()

void QDeclarativeGridView::setContentX ( qreal  pos)
virtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2177 of file qdeclarativegridview.cpp.

Referenced by setFlow().

2178 {
2180  // Positioning the view manually should override any current movement state
2181  d->moveReason = QDeclarativeGridViewPrivate::Other;
2183 }
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void setContentX(qreal pos)

◆ setContentY()

void QDeclarativeGridView::setContentY ( qreal  pos)
virtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2185 of file qdeclarativegridview.cpp.

Referenced by setFlow().

2186 {
2188  // Positioning the view manually should override any current movement state
2189  d->moveReason = QDeclarativeGridViewPrivate::Other;
2191 }
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void setContentY(qreal pos)

◆ setCurrentIndex()

void QDeclarativeGridView::setCurrentIndex ( int  idx)

Definition at line 1600 of file qdeclarativegridview.cpp.

Referenced by itemsInserted(), moveCurrentIndexDown(), moveCurrentIndexLeft(), moveCurrentIndexRight(), moveCurrentIndexUp(), and setModel().

1601 {
1603  if (d->requestedIndex >= 0) // currently creating item
1604  return;
1605  d->currentIndexCleared = (index == -1);
1606  if (index == d->currentIndex)
1607  return;
1608  if (isComponentComplete() && d->isValid()) {
1609  if (d->layoutScheduled)
1610  d->layout();
1612  d->updateCurrent(index);
1613  } else {
1614  d->currentIndex = index;
1616  }
1617 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
quint16 index

◆ setDelegate()

void QDeclarativeGridView::setDelegate ( QDeclarativeComponent delegate)

Definition at line 1541 of file qdeclarativegridview.cpp.

1542 {
1544  if (delegate == this->delegate())
1545  return;
1546 
1547  if (!d->ownModel) {
1548  d->model = new QDeclarativeVisualDataModel(qmlContext(this));
1549  d->ownModel = true;
1550  }
1551  if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
1552  int oldCount = dataModel->count();
1553  dataModel->setDelegate(delegate);
1554  if (isComponentComplete()) {
1555  for (int i = 0; i < d->visibleItems.count(); ++i)
1556  d->releaseItem(d->visibleItems.at(i));
1557  d->visibleItems.clear();
1558  d->releaseItem(d->currentItem);
1559  d->currentItem = 0;
1560  refill();
1562  d->updateCurrent(d->currentIndex);
1563  if (d->highlight && d->currentItem) {
1564  if (d->autoHighlight)
1565  d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
1566  d->updateTrackedItem();
1567  }
1568  d->moveReason = QDeclarativeGridViewPrivate::Other;
1569  }
1570  if (oldCount != dataModel->count())
1571  emit countChanged();
1573  }
1574 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
QDeclarativeComponent * delegate() const

◆ setFlow()

void QDeclarativeGridView::setFlow ( Flow  flow)

Definition at line 1934 of file qdeclarativegridview.cpp.

1935 {
1937  if (d->flow != flow) {
1938  d->flow = flow;
1939  if (d->flow == LeftToRight) {
1940  setContentWidth(-1);
1942  } else {
1943  setContentHeight(-1);
1945  }
1946  setContentX(0);
1947  setContentY(0);
1948  d->regenerate();
1949  emit flowChanged();
1950  }
1951 }
void setFlickableDirection(FlickableDirection)
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
virtual void setContentY(qreal pos)
virtual void setContentX(qreal pos)

◆ setFooter()

void QDeclarativeGridView::setFooter ( QDeclarativeComponent footer)

Definition at line 2116 of file qdeclarativegridview.cpp.

2117 {
2119  if (d->footerComponent != footer) {
2120  if (d->footer) {
2121  if (scene())
2122  scene()->removeItem(d->footer->item);
2123  d->footer->item->deleteLater();
2124  delete d->footer;
2125  d->footer = 0;
2126  }
2127  d->footerComponent = footer;
2128  if (isComponentComplete()) {
2129  d->updateFooter();
2130  d->updateGrid();
2131  d->fixupPosition();
2132  }
2133  emit footerChanged();
2134  }
2135 }
QDeclarativeParserStatus ** d
QDeclarativeComponent * footer() const
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
#define emit
Definition: qobjectdefs.h:76
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.

◆ setHeader()

void QDeclarativeGridView::setHeader ( QDeclarativeComponent header)

Definition at line 2155 of file qdeclarativegridview.cpp.

2156 {
2158  if (d->headerComponent != header) {
2159  if (d->header) {
2160  if (scene())
2161  scene()->removeItem(d->header->item);
2162  d->header->item->deleteLater();
2163  delete d->header;
2164  d->header = 0;
2165  }
2166  d->headerComponent = header;
2167  if (isComponentComplete()) {
2168  d->updateHeader();
2169  d->updateFooter();
2170  d->updateGrid();
2171  d->fixupPosition();
2172  }
2173  emit headerChanged();
2174  }
2175 }
QDeclarativeComponent * header() const
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
#define emit
Definition: qobjectdefs.h:76
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.

◆ setHighlight()

void QDeclarativeGridView::setHighlight ( QDeclarativeComponent highlight)

Definition at line 1682 of file qdeclarativegridview.cpp.

1683 {
1685  if (highlight != d->highlightComponent) {
1686  d->highlightComponent = highlight;
1687  d->updateCurrent(d->currentIndex);
1689  }
1690 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeComponent * highlight() const
#define emit
Definition: qobjectdefs.h:76

◆ setHighlightFollowsCurrentItem()

void QDeclarativeGridView::setHighlightFollowsCurrentItem ( bool  autoHighlight)

Definition at line 1714 of file qdeclarativegridview.cpp.

1715 {
1717  if (d->autoHighlight != autoHighlight) {
1718  d->autoHighlight = autoHighlight;
1719  if (autoHighlight) {
1720  d->updateHighlight();
1721  } else if (d->highlightXAnimator) {
1722  d->highlightXAnimator->stop();
1723  d->highlightYAnimator->stop();
1724  }
1725  }
1726 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setHighlightMoveDuration()

void QDeclarativeGridView::setHighlightMoveDuration ( int  duration)

Definition at line 1748 of file qdeclarativegridview.cpp.

1749 {
1751  if (d->highlightMoveDuration != duration) {
1752  d->highlightMoveDuration = duration;
1753  if (d->highlightYAnimator) {
1754  d->highlightXAnimator->userDuration = d->highlightMoveDuration;
1755  d->highlightYAnimator->userDuration = d->highlightMoveDuration;
1756  }
1758  }
1759 }
void highlightMoveDurationChanged()
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setHighlightRangeMode()

void QDeclarativeGridView::setHighlightRangeMode ( HighlightRangeMode  mode)

Definition at line 1855 of file qdeclarativegridview.cpp.

1856 {
1858  if (d->highlightRange == mode)
1859  return;
1860  d->highlightRange = mode;
1861  d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
1863 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void highlightRangeModeChanged()

◆ setLayoutDirection()

void QDeclarativeGridView::setLayoutDirection ( Qt::LayoutDirection  layoutDirection)

Definition at line 1895 of file qdeclarativegridview.cpp.

1896 {
1898  if (d->layoutDirection != layoutDirection) {
1899  d->layoutDirection = layoutDirection;
1900  d->regenerate();
1902  }
1903 }
Qt::LayoutDirection layoutDirection() const
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setModel()

void QDeclarativeGridView::setModel ( const QVariant model)

Definition at line 1450 of file qdeclarativegridview.cpp.

1451 {
1453  if (d->modelVariant == model)
1454  return;
1455  if (d->model) {
1456  disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
1457  disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
1458  disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
1459  disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
1462  }
1463  d->clear();
1464  d->modelVariant = model;
1465  QObject *object = qvariant_cast<QObject*>(model);
1466  QDeclarativeVisualModel *vim = 0;
1467  if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
1468  if (d->ownModel) {
1469  delete d->model;
1470  d->ownModel = false;
1471  }
1472  d->model = vim;
1473  } else {
1474  if (!d->ownModel) {
1475  d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
1476  d->ownModel = true;
1477  }
1478  if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
1479  dataModel->setModel(model);
1480  }
1481  if (d->model) {
1483  if (isComponentComplete()) {
1484  refill();
1485  if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexCleared) {
1486  setCurrentIndex(0);
1487  } else {
1489  d->updateCurrent(d->currentIndex);
1490  if (d->highlight && d->currentItem) {
1491  if (d->autoHighlight)
1492  d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
1493  d->updateTrackedItem();
1494  }
1495  d->moveReason = QDeclarativeGridViewPrivate::Other;
1496  }
1497  }
1498  connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
1499  connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
1500  connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
1501  connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
1504  emit countChanged();
1505  }
1506  emit modelChanged();
1507 }
void itemsMoved(int from, int to, int count)
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define SLOT(a)
Definition: qobjectdefs.h:226
void createdItem(int index, QDeclarativeItem *item)
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
#define Q_D(Class)
Definition: qglobal.h:2482
void itemsRemoved(int index, int count)
#define SIGNAL(a)
Definition: qobjectdefs.h:227
The QDeclarativeItem class provides the most basic of all visual items in QML.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
#define emit
Definition: qobjectdefs.h:76
void destroyingItem(QDeclarativeItem *item)
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.
Definition: qobject.cpp:2895
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
QVariant model() const
void itemsInserted(int index, int count)

◆ setPreferredHighlightBegin()

void QDeclarativeGridView::setPreferredHighlightBegin ( qreal  start)

Definition at line 1801 of file qdeclarativegridview.cpp.

1802 {
1804  d->highlightRangeStartValid = true;
1805  if (d->highlightRangeStart == start)
1806  return;
1807  d->highlightRangeStart = start;
1808  d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
1810 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void preferredHighlightBeginChanged()

◆ setPreferredHighlightEnd()

void QDeclarativeGridView::setPreferredHighlightEnd ( qreal  end)

Definition at line 1828 of file qdeclarativegridview.cpp.

1829 {
1831  d->highlightRangeEndValid = true;
1832  if (d->highlightRangeEnd == end)
1833  return;
1834  d->highlightRangeEnd = end;
1835  d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
1837 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void preferredHighlightEndChanged()
static const KeyPair *const end

◆ setSnapMode()

void QDeclarativeGridView::setSnapMode ( SnapMode  mode)

Definition at line 2089 of file qdeclarativegridview.cpp.

2090 {
2092  if (d->snapMode != mode) {
2093  d->snapMode = mode;
2095  }
2096 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setWrapEnabled()

void QDeclarativeGridView::setWrapEnabled ( bool  wrap)

Definition at line 1972 of file qdeclarativegridview.cpp.

1973 {
1975  if (d->wrap == wrap)
1976  return;
1977  d->wrap = wrap;
1979 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void keyNavigationWrapsChanged()

◆ snapMode()

SnapMode QDeclarativeGridView::snapMode ( ) const

Referenced by setCellHeight().

◆ snapModeChanged

void QDeclarativeGridView::snapModeChanged ( )
signal

Referenced by setSnapMode().

◆ trackedPositionChanged

void QDeclarativeGridView::trackedPositionChanged ( )
privateslot

Definition at line 2790 of file qdeclarativegridview.cpp.

2791 {
2793  if (!d->trackedItem || !d->currentItem)
2794  return;
2795  if (d->moveReason == QDeclarativeGridViewPrivate::SetIndex) {
2796  const qreal trackedPos = d->trackedItem->rowPos();
2797  qreal viewPos;
2798  qreal highlightStart;
2799  qreal highlightEnd;
2800  if (d->isRightToLeftTopToBottom()) {
2801  viewPos = -d->position()-d->size();
2802  highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
2803  highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
2804  } else {
2805  viewPos = d->position();
2806  highlightStart = d->highlightRangeStart;
2807  highlightEnd = d->highlightRangeEnd;
2808  }
2809  qreal pos = viewPos;
2810  if (d->haveHighlightRange) {
2811  if (d->highlightRange == StrictlyEnforceRange) {
2812  if (trackedPos > pos + highlightEnd - d->rowSize())
2813  pos = trackedPos - highlightEnd + d->rowSize();
2814  if (trackedPos < pos + highlightStart)
2815  pos = trackedPos - highlightStart;
2816  } else {
2817  if (trackedPos < d->startPosition() + highlightStart) {
2818  pos = d->startPosition();
2819  } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + highlightEnd) {
2820  pos = d->endPosition() - d->size() + 1;
2821  if (pos < d->startPosition())
2822  pos = d->startPosition();
2823  } else {
2824  if (trackedPos < viewPos + highlightStart) {
2825  pos = trackedPos - highlightStart;
2826  } else if (trackedPos > viewPos + highlightEnd - d->rowSize()) {
2827  pos = trackedPos - highlightEnd + d->rowSize();
2828  }
2829  }
2830  }
2831  } else {
2832  if (trackedPos < viewPos && d->currentItem->rowPos() < viewPos) {
2833  pos = qMax(trackedPos, d->currentItem->rowPos());
2834  } else if (d->trackedItem->endRowPos() >= viewPos + d->size()
2835  && d->currentItem->endRowPos() >= viewPos + d->size()) {
2836  if (d->trackedItem->endRowPos() <= d->currentItem->endRowPos()) {
2837  pos = d->trackedItem->endRowPos() - d->size() + 1;
2838  if (d->rowSize() > d->size())
2839  pos = trackedPos;
2840  } else {
2841  pos = d->currentItem->endRowPos() - d->size() + 1;
2842  if (d->rowSize() > d->size())
2843  pos = d->currentItem->rowPos();
2844  }
2845  }
2846  }
2847  if (viewPos != pos) {
2848  cancelFlick();
2849  d->calcVelocity = true;
2850  d->setPosition(pos);
2851  d->calcVelocity = false;
2852  }
2853  }
2854 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
QDeclarativeItem * currentItem()
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217

◆ viewportMoved()

void QDeclarativeGridView::viewportMoved ( )
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2205 of file qdeclarativegridview.cpp.

2206 {
2209  if (!d->itemCount)
2210  return;
2211  d->lazyRelease = true;
2212  if (d->hData.flicking || d->vData.flicking) {
2213  if (yflick()) {
2214  if (d->vData.velocity > 0)
2216  else if (d->vData.velocity < 0)
2218  }
2219 
2220  if (xflick()) {
2221  if (d->hData.velocity > 0)
2223  else if (d->hData.velocity < 0)
2225  }
2226  }
2227  refill();
2228  if (d->hData.flicking || d->vData.flicking || d->hData.moving || d->vData.moving)
2229  d->moveReason = QDeclarativeGridViewPrivate::Mouse;
2230  if (d->moveReason != QDeclarativeGridViewPrivate::SetIndex) {
2231  if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
2232  // reposition highlight
2233  qreal pos = d->highlight->rowPos();
2234  qreal viewPos;
2235  qreal highlightStart;
2236  qreal highlightEnd;
2237  if (d->isRightToLeftTopToBottom()) {
2238  highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
2239  highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
2240  viewPos = -d->position()-d->size();
2241  } else {
2242  highlightStart = d->highlightRangeStart;
2243  highlightEnd = d->highlightRangeEnd;
2244  viewPos = d->position();
2245  }
2246  if (pos > viewPos + highlightEnd - d->rowSize())
2247  pos = viewPos + highlightEnd - d->rowSize();
2248  if (pos < viewPos + highlightStart)
2249  pos = viewPos + highlightStart;
2250 
2251  d->highlight->setPosition(d->highlight->colPos(), qRound(pos));
2252 
2253  // update current index
2254  int idx = d->snapIndex();
2255  if (idx >= 0 && idx != d->currentIndex) {
2256  d->updateCurrent(idx);
2257  if (d->currentItem && d->currentItem->colPos() != d->highlight->colPos() && d->autoHighlight) {
2258  if (d->flow == LeftToRight)
2259  d->highlightXAnimator->to = d->currentItem->item->x();
2260  else
2261  d->highlightYAnimator->to = d->currentItem->item->y();
2262  }
2263  }
2264  }
2265  }
2266 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

Properties

◆ cacheBuffer

int QDeclarativeGridView::cacheBuffer
private

Definition at line 79 of file qdeclarativegridview_p.h.

◆ cellHeight

int QDeclarativeGridView::cellHeight
private

Definition at line 81 of file qdeclarativegridview_p.h.

Referenced by FxGridItem::contains(), and FxGridItem::endRowPos().

◆ cellWidth

int QDeclarativeGridView::cellWidth
private

◆ count

int QDeclarativeGridView::count
private

Definition at line 65 of file qdeclarativegridview_p.h.

◆ currentIndex

int QDeclarativeGridView::currentIndex
private

Definition at line 63 of file qdeclarativegridview_p.h.

◆ currentItem

QDeclarativeItem * QDeclarativeGridView::currentItem
private

Definition at line 64 of file qdeclarativegridview_p.h.

◆ delegate

QDeclarativeComponent * QDeclarativeGridView::delegate
private

Definition at line 62 of file qdeclarativegridview_p.h.

◆ flow

QDeclarativeGridView::Flow QDeclarativeGridView::flow
private

◆ footer

QDeclarativeComponent * QDeclarativeGridView::footer
private

Definition at line 86 of file qdeclarativegridview_p.h.

◆ header

QDeclarativeComponent * QDeclarativeGridView::header
private

Definition at line 85 of file qdeclarativegridview_p.h.

◆ highlight

QDeclarativeComponent * QDeclarativeGridView::highlight
private

Definition at line 67 of file qdeclarativegridview_p.h.

◆ highlightFollowsCurrentItem

bool QDeclarativeGridView::highlightFollowsCurrentItem
private

Definition at line 69 of file qdeclarativegridview_p.h.

◆ highlightItem

QDeclarativeItem * QDeclarativeGridView::highlightItem
private

Definition at line 68 of file qdeclarativegridview_p.h.

◆ highlightMoveDuration

int QDeclarativeGridView::highlightMoveDuration
private

Definition at line 70 of file qdeclarativegridview_p.h.

◆ highlightRangeMode

QDeclarativeGridView::HighlightRangeMode QDeclarativeGridView::highlightRangeMode
private

Definition at line 74 of file qdeclarativegridview_p.h.

◆ keyNavigationWraps

bool QDeclarativeGridView::keyNavigationWraps
private

Definition at line 78 of file qdeclarativegridview_p.h.

◆ layoutDirection

Qt::LayoutDirection QDeclarativeGridView::layoutDirection
private

Definition at line 77 of file qdeclarativegridview_p.h.

◆ model

QVariant QDeclarativeGridView::model
private

Definition at line 61 of file qdeclarativegridview_p.h.

◆ preferredHighlightBegin

qreal QDeclarativeGridView::preferredHighlightBegin
private

Definition at line 72 of file qdeclarativegridview_p.h.

◆ preferredHighlightEnd

qreal QDeclarativeGridView::preferredHighlightEnd
private

Definition at line 73 of file qdeclarativegridview_p.h.

◆ snapMode

QDeclarativeGridView::SnapMode QDeclarativeGridView::snapMode
private

Definition at line 83 of file qdeclarativegridview_p.h.


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