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

#include <qdeclarativepathview_p.h>

Inheritance diagram for QDeclarativePathView:
QDeclarativeItem QGraphicsObject QDeclarativeParserStatus QObject QGraphicsItem

Public Types

enum  HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange }
 
- 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 decrementCurrentIndex ()
 
void incrementCurrentIndex ()
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 

Signals

void countChanged ()
 
void currentIndexChanged ()
 
void delegateChanged ()
 
void dragMarginChanged ()
 
void flickDecelerationChanged ()
 
void flickEnded ()
 
void flickingChanged ()
 
void flickStarted ()
 
void highlightChanged ()
 
void highlightItemChanged ()
 
void highlightMoveDurationChanged ()
 
void highlightRangeModeChanged ()
 
void interactiveChanged ()
 
void modelChanged ()
 
void movementEnded ()
 
void movementStarted ()
 
void movingChanged ()
 
void offsetChanged ()
 
void pathChanged ()
 
void pathItemCountChanged ()
 
void preferredHighlightBeginChanged ()
 
void preferredHighlightEndChanged ()
 
void snapPositionChanged ()
 
- 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 count () const
 
int currentIndex () const
 
QDeclarativeComponentdelegate () const
 
qreal dragMargin () const
 
qreal flickDeceleration () const
 
QDeclarativeComponenthighlight () const
 
QDeclarativeItemhighlightItem ()
 
int highlightMoveDuration () const
 
HighlightRangeMode highlightRangeMode () const
 
bool isFlicking () const
 
bool isInteractive () const
 
bool isMoving () const
 
QVariant model () const
 
qreal offset () const
 
QDeclarativePathpath () const
 
int pathItemCount () const
 
qreal preferredHighlightBegin () const
 
qreal preferredHighlightEnd () const
 
 QDeclarativePathView (QDeclarativeItem *parent=0)
 
void setCurrentIndex (int idx)
 
void setDelegate (QDeclarativeComponent *)
 
void setDragMargin (qreal margin)
 
void setFlickDeceleration (qreal dec)
 
void setHighlight (QDeclarativeComponent *highlight)
 
void setHighlightMoveDuration (int)
 
void setHighlightRangeMode (HighlightRangeMode mode)
 
void setInteractive (bool)
 
void setModel (const QVariant &)
 
void setOffset (qreal offset)
 
void setPath (QDeclarativePath *)
 
void setPathItemCount (int)
 
void setPreferredHighlightBegin (qreal)
 
void setPreferredHighlightEnd (qreal)
 
virtual ~QDeclarativePathView ()
 
- 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 QDeclarativePathViewAttachedqmlAttachedProperties (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

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

Private Slots

void createdItem (int index, QDeclarativeItem *item)
 
void destroyingItem (QDeclarativeItem *item)
 
void itemsInserted (int index, int count)
 
void itemsMoved (int, int, int)
 
void itemsRemoved (int index, int count)
 
void modelReset ()
 
void movementEnding ()
 
void pathUpdated ()
 
void refill ()
 
void ticked ()
 

Properties

int count
 
int currentIndex
 
QDeclarativeComponentdelegate
 
qreal dragMargin
 
qreal flickDeceleration
 
bool flicking
 
QDeclarativeComponenthighlight
 
QDeclarativeItemhighlightItem
 
int highlightMoveDuration
 
HighlightRangeMode highlightRangeMode
 
bool interactive
 
QVariant model
 
bool moving
 
qreal offset
 
QDeclarativePathpath
 
int pathItemCount
 
qreal preferredHighlightBegin
 
qreal preferredHighlightEnd
 

Friends

class QDeclarativePathViewAttached
 

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 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 qdeclarativepathview_p.h.

Enumerations

◆ HighlightRangeMode

Constructors and Destructors

◆ QDeclarativePathView()

QDeclarativePathView::QDeclarativePathView ( QDeclarativeItem parent = 0)

Definition at line 417 of file qdeclarativepathview.cpp.

419 {
421  d->init();
422 }
QDeclarativeParserStatus ** d
QDeclarativeItem(QDeclarativeItem *parent=0)
Constructs a QDeclarativeItem with the given parent.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ ~QDeclarativePathView()

QDeclarativePathView::~QDeclarativePathView ( )
virtual

Definition at line 424 of file qdeclarativepathview.cpp.

425 {
427  d->clear();
428  if (d->attType)
429  d->attType->release();
430  if (d->ownModel)
431  delete d->model;
432 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

Functions

◆ componentComplete()

void QDeclarativePathView::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 1405 of file qdeclarativepathview.cpp.

1406 {
1409 
1410  if (d->model) {
1411  d->modelCount = d->model->count();
1412  if (d->modelCount && d->currentIndex != 0) // an initial value has been provided for currentIndex
1413  d->offset = qmlMod(d->modelCount - d->currentIndex, d->modelCount);
1414  }
1415 
1416  d->createHighlight();
1417  d->regenerate();
1418  d->updateHighlight();
1419  d->updateCurrent();
1420 
1421  if (d->modelCount)
1422  emit countChanged();
1423 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
virtual void componentComplete()
qreal qmlMod(qreal x, qreal y)

◆ count()

int QDeclarativePathView::count ( ) const

◆ countChanged

void QDeclarativePathView::countChanged ( )
signal

◆ createdItem

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

Definition at line 1667 of file qdeclarativepathview.cpp.

Referenced by setModel().

1668 {
1670  if (d->requestedIndex != index) {
1671  if (!d->attType) {
1672  // pre-create one metatype to share with all attached objects
1674  foreach(const QString &attr, d->path->attributes())
1675  d->attType->createProperty(attr.toUtf8());
1676  }
1677  qPathViewAttachedType = d->attType;
1678  QDeclarativePathViewAttached *att = static_cast<QDeclarativePathViewAttached *>(qmlAttachedPropertiesObject<QDeclarativePathView>(item));
1680  if (att) {
1681  att->m_view = this;
1682  att->setOnPath(false);
1683  }
1684  item->setParentItem(this);
1685  d->updateItem(item, index < d->firstIndex ? qreal(0.0) : qreal(1.0));
1686  }
1687 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
Definition: qstring.cpp:4074
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
Definition: qobject.h:128
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_D(Class)
Definition: qglobal.h:2482
void setParentItem(QDeclarativeItem *parent)
static QDeclarativeOpenMetaObjectType * qPathViewAttachedType
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
quint16 index

◆ currentIndex()

int QDeclarativePathView::currentIndex ( ) const

◆ currentIndexChanged

void QDeclarativePathView::currentIndexChanged ( )
signal

◆ decrementCurrentIndex

void QDeclarativePathView::decrementCurrentIndex ( )
slot

◆ delegate()

QDeclarativeComponent* QDeclarativePathView::delegate ( ) const

Referenced by isFlicking(), and setDelegate().

◆ delegateChanged

void QDeclarativePathView::delegateChanged ( )
signal

Referenced by setDelegate().

◆ destroyingItem

void QDeclarativePathView::destroyingItem ( QDeclarativeItem item)
privateslot

Definition at line 1689 of file qdeclarativepathview.cpp.

1690 {
1691  Q_UNUSED(item);
1692 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ dragMargin()

qreal QDeclarativePathView::dragMargin ( ) const

◆ dragMarginChanged

void QDeclarativePathView::dragMarginChanged ( )
signal

Referenced by setDragMargin().

◆ event()

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

Reimplemented from QDeclarativeItem.

Definition at line 1395 of file qdeclarativepathview.cpp.

1396 {
1397  if (event->type() == QEvent::User) {
1398  refill();
1399  return true;
1400  }
1401 
1403 }
virtual bool event(QEvent *)

◆ flickDeceleration()

qreal QDeclarativePathView::flickDeceleration ( ) const

Referenced by setDragMargin().

◆ flickDecelerationChanged

void QDeclarativePathView::flickDecelerationChanged ( )
signal

Referenced by setFlickDeceleration().

◆ flickEnded

void QDeclarativePathView::flickEnded ( )
signal

Referenced by movementEnding().

◆ flickingChanged

void QDeclarativePathView::flickingChanged ( )
signal

Referenced by movementEnding().

◆ flickStarted

void QDeclarativePathView::flickStarted ( )
signal

◆ highlight()

QDeclarativeComponent* QDeclarativePathView::highlight ( ) const

◆ highlightChanged

void QDeclarativePathView::highlightChanged ( )
signal

Referenced by setHighlight().

◆ highlightItem()

QDeclarativeItem* QDeclarativePathView::highlightItem ( )

Referenced by setHighlight().

◆ highlightItemChanged

void QDeclarativePathView::highlightItemChanged ( )
signal

◆ highlightMoveDuration()

int QDeclarativePathView::highlightMoveDuration ( ) const

◆ highlightMoveDurationChanged

void QDeclarativePathView::highlightMoveDurationChanged ( )
signal

◆ highlightRangeMode()

HighlightRangeMode QDeclarativePathView::highlightRangeMode ( ) const

◆ highlightRangeModeChanged

void QDeclarativePathView::highlightRangeModeChanged ( )
signal

Referenced by setHighlightRangeMode().

◆ incrementCurrentIndex

void QDeclarativePathView::incrementCurrentIndex ( )
slot

◆ interactiveChanged

void QDeclarativePathView::interactiveChanged ( )
signal

Referenced by setInteractive().

◆ isFlicking()

bool QDeclarativePathView::isFlicking ( ) const

Definition at line 1017 of file qdeclarativepathview.cpp.

1018 {
1019  Q_D(const QDeclarativePathView);
1020  return d->flicking;
1021 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isInteractive()

bool QDeclarativePathView::isInteractive ( ) const

Definition at line 976 of file qdeclarativepathview.cpp.

977 {
978  Q_D(const QDeclarativePathView);
979  return d->interactive;
980 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isMoving()

bool QDeclarativePathView::isMoving ( ) const

Definition at line 1002 of file qdeclarativepathview.cpp.

1003 {
1004  Q_D(const QDeclarativePathView);
1005  return d->moving;
1006 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ itemsInserted

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

Definition at line 1548 of file qdeclarativepathview.cpp.

Referenced by setModel().

1549 {
1550  //XXX support animated insertion
1552  if (!d->isValid() || !isComponentComplete())
1553  return;
1554 
1555  if (d->modelCount) {
1556  d->itemCache += d->items;
1557  d->items.clear();
1558  if (modelIndex <= d->currentIndex) {
1559  d->currentIndex += count;
1561  } else if (d->offset != 0) {
1562  d->offset += count;
1563  d->offsetAdj += count;
1564  }
1565  }
1566  d->modelCount += count;
1567  if (d->flicking || d->moving) {
1568  d->regenerate();
1569  d->updateCurrent();
1570  } else {
1571  d->firstIndex = -1;
1572  d->updateMappedRange();
1573  d->scheduleLayout();
1574  }
1575  emit countChanged();
1576 }
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
int currentIndex() const
#define emit
Definition: qobjectdefs.h:76

◆ itemsMoved

void QDeclarativePathView::itemsMoved ( int  ,
int  ,
int   
)
privateslot

Definition at line 1637 of file qdeclarativepathview.cpp.

Referenced by setModel().

1638 {
1640  if (!d->isValid() || !isComponentComplete())
1641  return;
1642 
1643  int oldCurrent = d->currentIndex;
1644  // Fix current index
1645  if (d->currentIndex >= 0 && d->currentItem)
1646  d->currentIndex = d->model->indexOf(d->currentItem, this);
1647 
1648  QList<QDeclarativeItem *> removedItems = d->items;
1649  d->items.clear();
1650  d->regenerate();
1651  while (removedItems.count())
1652  d->releaseItem(removedItems.takeLast());
1653 
1654  if (oldCurrent != d->currentIndex)
1656  d->updateCurrent();
1657 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
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
#define emit
Definition: qobjectdefs.h:76
T takeLast()
Removes the last item in the list and returns it.
Definition: qlist.h:492
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ itemsRemoved

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

Definition at line 1578 of file qdeclarativepathview.cpp.

Referenced by setModel().

1579 {
1580  //XXX support animated removal
1582  if (!d->model || !d->modelCount || !d->model->isValid() || !d->path || !isComponentComplete())
1583  return;
1584 
1585  // fix current
1586  bool currentChanged = false;
1587  if (d->currentIndex >= modelIndex + count) {
1588  d->currentIndex -= count;
1589  currentChanged = true;
1590  } else if (d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count) {
1591  // current item has been removed.
1592  d->currentIndex = qMin(modelIndex, d->modelCount-count-1);
1593  if (d->currentItem) {
1594  if (QDeclarativePathViewAttached *att = d->attached(d->currentItem))
1595  att->setIsCurrentItem(true);
1596  }
1597  currentChanged = true;
1598  }
1599 
1600  d->itemCache += d->items;
1601  d->items.clear();
1602 
1603  bool changedOffset = false;
1604  if (modelIndex > d->currentIndex) {
1605  if (d->offset >= count) {
1606  changedOffset = true;
1607  d->offset -= count;
1608  d->offsetAdj -= count;
1609  }
1610  }
1611 
1612  d->modelCount -= count;
1613 
1614  if (d->currentIndex == -1)
1615  d->currentIndex = d->calcCurrentIndex();
1616 
1617  if (!d->modelCount) {
1618  while (d->itemCache.count())
1619  d->releaseItem(d->itemCache.takeLast());
1620  d->offset = 0;
1621  changedOffset = true;
1622  d->tl.reset(d->moveOffset);
1623  update();
1624  } else {
1625  d->regenerate();
1626  d->updateCurrent();
1627  if (!d->flicking && !d->moving && d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange)
1628  d->snapToCurrent();
1629  }
1630  if (changedOffset)
1631  emit offsetChanged();
1632  if (currentChanged)
1634  emit countChanged();
1635 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
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 emit
Definition: qobjectdefs.h:76

◆ model()

QVariant QDeclarativePathView::model ( ) const

◆ modelChanged

void QDeclarativePathView::modelChanged ( )
signal

Referenced by setModel().

◆ modelReset

void QDeclarativePathView::modelReset ( )
privateslot

Definition at line 1659 of file qdeclarativepathview.cpp.

Referenced by setModel().

1660 {
1662  d->modelCount = d->model->count();
1663  d->regenerate();
1664  emit countChanged();
1665 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ mouseMoveEvent()

void QDeclarativePathView::mouseMoveEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse move events for this item.

If you do receive this event, you can be certain that this item also received a mouse press event, and that this item is the current mouse grabber.

Calling QEvent::ignore() or QEvent::accept() on event has no effect.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseMoveEvent() in your reimplementation.

Please note that mousePressEvent() decides which graphics item it is that receives mouse events. See the mousePressEvent() description for details.

See also
mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 1214 of file qdeclarativepathview.cpp.

1215 {
1217  if (d->interactive) {
1218  d->handleMouseMoveEvent(event);
1219  if (d->stealMouse)
1220  setKeepMouseGrab(true);
1221  event->accept();
1222  } else {
1224  }
1225 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.

◆ mousePressEvent()

void QDeclarativePathView::mousePressEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse press events for this item.

Mouse press events are only delivered to items that accept the mouse button that is pressed. By default, an item accepts all mouse buttons, but you can change this by calling setAcceptedMouseButtons().

The mouse press event decides which item should become the mouse grabber (see QGraphicsScene::mouseGrabberItem()). If you do not reimplement this function, the press event will propagate to any topmost item beneath this item, and no other mouse events will be delivered to this item.

If you do reimplement this function, event will by default be accepted (see QEvent::accept()), and this item is then the mouse grabber. This allows the item to receive future move, release and doubleclick events. If you call QEvent::ignore() on event, this item will lose the mouse grab, and event will propagate to any topmost item beneath. No further mouse events will be delivered to this item unless a new mouse press event is received.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mousePressEvent() in your reimplementation.

The event is for items that are neither QGraphicsItem::ItemIsMovable "movable" nor QGraphicsItem::ItemIsSelectable "selectable". mouseMoveEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 1169 of file qdeclarativepathview.cpp.

1170 {
1172  if (d->interactive) {
1173  d->handleMousePressEvent(event);
1174  event->accept();
1175  } else {
1177  }
1178 }
QDeclarativeParserStatus ** d
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
#define Q_D(Class)
Definition: qglobal.h:2482

◆ mouseReleaseEvent()

void QDeclarativePathView::mouseReleaseEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse release events for this item.

Calling QEvent::ignore() or QEvent::accept() on event has no effect.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseReleaseEvent() in your reimplementation.

Please note that mousePressEvent() decides which graphics item it is that receives mouse events. See the mousePressEvent() description for details.

See also
mousePressEvent(), mouseMoveEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 1266 of file qdeclarativepathview.cpp.

1267 {
1269  if (d->interactive) {
1270  d->handleMouseReleaseEvent(event);
1271  event->accept();
1272  ungrabMouse();
1273  } else {
1275  }
1276 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void ungrabMouse()
Releases the mouse grab.
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...

◆ movementEnded

void QDeclarativePathView::movementEnded ( )
signal

Referenced by movementEnding().

◆ movementEnding

void QDeclarativePathView::movementEnding ( )
privateslot

Definition at line 1700 of file qdeclarativepathview.cpp.

1701 {
1703  if (d->flicking) {
1704  d->flicking = false;
1706  emit flickEnded();
1707  }
1708  if (d->moving && !d->stealMouse) {
1709  d->moving = false;
1710  emit movingChanged();
1711  emit movementEnded();
1712  }
1713 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ movementStarted

void QDeclarativePathView::movementStarted ( )
signal

◆ movingChanged

void QDeclarativePathView::movingChanged ( )
signal

Referenced by movementEnding().

◆ offset()

qreal QDeclarativePathView::offset ( ) const

◆ offsetChanged

void QDeclarativePathView::offsetChanged ( )
signal

Referenced by itemsRemoved(), and setModel().

◆ path()

QDeclarativePath* QDeclarativePathView::path ( ) const

◆ pathChanged

void QDeclarativePathView::pathChanged ( )
signal

Referenced by setPath().

◆ pathItemCount()

int QDeclarativePathView::pathItemCount ( ) const

Referenced by setDelegate().

◆ pathItemCountChanged

void QDeclarativePathView::pathItemCountChanged ( )
signal

Referenced by setPathItemCount().

◆ pathUpdated

void QDeclarativePathView::pathUpdated ( )
privateslot

Definition at line 306 of file qdeclarativepathview.cpp.

Referenced by setPath().

307 {
309  QList<QDeclarativeItem*>::iterator it = d->items.begin();
310  while (it != d->items.end()) {
311  QDeclarativeItem *item = *it;
312  if (QDeclarativePathViewAttached *att = d->attached(item))
313  att->m_percent = -1;
314  ++it;
315  }
316  refill();
317 }
QDeclarativeParserStatus ** d
#define it(className, varName)
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181

◆ preferredHighlightBegin()

qreal QDeclarativePathView::preferredHighlightBegin ( ) const

Referenced by setHighlight().

◆ preferredHighlightBeginChanged

void QDeclarativePathView::preferredHighlightBeginChanged ( )
signal

◆ preferredHighlightEnd()

qreal QDeclarativePathView::preferredHighlightEnd ( ) const

◆ preferredHighlightEndChanged

void QDeclarativePathView::preferredHighlightEndChanged ( )
signal

◆ qmlAttachedProperties()

QDeclarativePathViewAttached * QDeclarativePathView::qmlAttachedProperties ( QObject obj)
static

Definition at line 1819 of file qdeclarativepathview.cpp.

1820 {
1821  return new QDeclarativePathViewAttached(obj);
1822 }
friend class QDeclarativePathViewAttached

◆ refill

void QDeclarativePathView::refill ( )
privateslot

Definition at line 1425 of file qdeclarativepathview.cpp.

Referenced by event(), setPreferredHighlightBegin(), and setPreferredHighlightEnd().

1426 {
1428  if (!d->isValid() || !isComponentComplete())
1429  return;
1430 
1431  d->layoutScheduled = false;
1432  bool currentVisible = false;
1433 
1434  // first move existing items and remove items off path
1435  int idx = d->firstIndex;
1436  QList<QDeclarativeItem*>::iterator it = d->items.begin();
1437  while (it != d->items.end()) {
1438  qreal pos = d->positionOfIndex(idx);
1439  QDeclarativeItem *item = *it;
1440  if (pos >= 0.0) {
1441  d->updateItem(item, pos);
1442  if (idx == d->currentIndex) {
1443  currentVisible = true;
1444  d->currentItemOffset = pos;
1445  }
1446  ++it;
1447  } else {
1448 // qDebug() << "release";
1449  d->updateItem(item, 1.0);
1450  d->releaseItem(item);
1451  if (it == d->items.begin()) {
1452  if (++d->firstIndex >= d->modelCount)
1453  d->firstIndex = 0;
1454  }
1455  it = d->items.erase(it);
1456  }
1457  ++idx;
1458  if (idx >= d->modelCount)
1459  idx = 0;
1460  }
1461  if (!d->items.count())
1462  d->firstIndex = -1;
1463 
1464  if (d->modelCount) {
1465  // add items to beginning and end
1466  int count = d->pathItems == -1 ? d->modelCount : qMin(d->pathItems, d->modelCount);
1467  if (d->items.count() < count) {
1468  int idx = qRound(d->modelCount - d->offset) % d->modelCount;
1469  qreal startPos = 0.0;
1470  if (d->haveHighlightRange && d->highlightRangeMode != QDeclarativePathView::NoHighlightRange)
1471  startPos = d->highlightRangeStart;
1472  if (d->firstIndex >= 0) {
1473  startPos = d->positionOfIndex(d->firstIndex);
1474  idx = (d->firstIndex + d->items.count()) % d->modelCount;
1475  }
1476  qreal pos = d->positionOfIndex(idx);
1477  while ((pos > startPos || !d->items.count()) && d->items.count() < count) {
1478  // qDebug() << "append" << idx;
1479  QDeclarativeItem *item = d->getItem(idx);
1480  if (d->model->completePending())
1481  item->setZValue(idx+1);
1482  if (d->currentIndex == idx) {
1483  item->setFocus(true);
1484  if (QDeclarativePathViewAttached *att = d->attached(item))
1485  att->setIsCurrentItem(true);
1486  currentVisible = true;
1487  d->currentItemOffset = pos;
1488  d->currentItem = item;
1489  }
1490  if (d->items.count() == 0)
1491  d->firstIndex = idx;
1492  d->items.append(item);
1493  d->updateItem(item, pos);
1494  if (d->model->completePending())
1495  d->model->completeItem();
1496  ++idx;
1497  if (idx >= d->modelCount)
1498  idx = 0;
1499  pos = d->positionOfIndex(idx);
1500  }
1501 
1502  idx = d->firstIndex - 1;
1503  if (idx < 0)
1504  idx = d->modelCount - 1;
1505  pos = d->positionOfIndex(idx);
1506  while (pos >= 0.0 && pos < startPos) {
1507  // qDebug() << "prepend" << idx;
1508  QDeclarativeItem *item = d->getItem(idx);
1509  if (d->model->completePending())
1510  item->setZValue(idx+1);
1511  if (d->currentIndex == idx) {
1512  item->setFocus(true);
1513  if (QDeclarativePathViewAttached *att = d->attached(item))
1514  att->setIsCurrentItem(true);
1515  currentVisible = true;
1516  d->currentItemOffset = pos;
1517  d->currentItem = item;
1518  }
1519  d->items.prepend(item);
1520  d->updateItem(item, pos);
1521  if (d->model->completePending())
1522  d->model->completeItem();
1523  d->firstIndex = idx;
1524  idx = d->firstIndex - 1;
1525  if (idx < 0)
1526  idx = d->modelCount - 1;
1527  pos = d->positionOfIndex(idx);
1528  }
1529  }
1530  }
1531 
1532  if (!currentVisible)
1533  d->currentItemOffset = 1.0;
1534 
1535  if (d->highlightItem && d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange) {
1536  d->updateItem(d->highlightItem, d->highlightRangeStart);
1537  if (QDeclarativePathViewAttached *att = d->attached(d->highlightItem))
1538  att->setOnPath(true);
1539  } else if (d->highlightItem && d->moveReason != QDeclarativePathViewPrivate::SetIndex) {
1540  d->updateItem(d->highlightItem, d->currentItemOffset);
1541  if (QDeclarativePathViewAttached *att = d->attached(d->highlightItem))
1542  att->setOnPath(currentVisible);
1543  }
1544  while (d->itemCache.count())
1545  d->releaseItem(d->itemCache.takeLast());
1546 }
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 it(className, varName)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
void setZValue(qreal z)
Sets the Z-value of the item to z.
The QDeclarativeItem class provides the most basic of all visual items in QML.
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181
if(void) toggleToolbarShown
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ sceneEventFilter()

bool QDeclarativePathView::sceneEventFilter ( QGraphicsItem watched,
QEvent event 
)
protectedvirtual

Filters events for the item watched.

event is the filtered event.

Reimplementing this function in a subclass makes it possible for the item to be used as an event filter for other items, intercepting all the events send to those items before they are able to respond.

Reimplementations must return true to prevent further processing of a given event, ensuring that it will not be delivered to the watched item, or return false to indicate that the event should be propagated further by the event system.

See also
installSceneEventFilter()

Reimplemented from QGraphicsItem.

Definition at line 1377 of file qdeclarativepathview.cpp.

1378 {
1380  if (!isVisible() || !d->interactive)
1382 
1383  switch (e->type()) {
1387  return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
1388  default:
1389  break;
1390  }
1391 
1393 }
QDeclarativeParserStatus ** d
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
bool sendMouseEvent(QGraphicsSceneMouseEvent *event)
#define Q_D(Class)
Definition: qglobal.h:2482
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Filters events for the item watched.

◆ sendMouseEvent()

bool QDeclarativePathView::sendMouseEvent ( QGraphicsSceneMouseEvent event)
protected

Definition at line 1329 of file qdeclarativepathview.cpp.

Referenced by sceneEventFilter().

1330 {
1333  QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
1334  QGraphicsScene *s = scene();
1336  bool stealThisEvent = d->stealMouse;
1337  if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
1338  mouseEvent.setAccepted(false);
1339  for (int i = 0x1; i <= 0x10; i <<= 1) {
1340  if (event->buttons() & i) {
1341  Qt::MouseButton button = Qt::MouseButton(i);
1342  mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
1343  }
1344  }
1345  mouseEvent.setScenePos(event->scenePos());
1346  mouseEvent.setLastScenePos(event->lastScenePos());
1347  mouseEvent.setPos(mapFromScene(event->scenePos()));
1348  mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
1349 
1350  switch(mouseEvent.type()) {
1352  d->handleMouseMoveEvent(&mouseEvent);
1353  break;
1355  d->handleMousePressEvent(&mouseEvent);
1356  stealThisEvent = d->stealMouse; // Update stealThisEvent in case changed by function call above
1357  break;
1359  d->handleMouseReleaseEvent(&mouseEvent);
1360  break;
1361  default:
1362  break;
1363  }
1365  if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
1366  grabMouse();
1367 
1368  return d->stealMouse;
1369  } else if (d->lastPosTime.isValid()) {
1370  d->lastPosTime.invalidate();
1371  }
1373  d->stealMouse = false;
1374  return false;
1375 }
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
QDeclarativeParserStatus ** d
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
T * qobject_cast(QObject *object)
Definition: qobject.h:375
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse...
#define Q_D(Class)
Definition: qglobal.h:2482
QPointF lastScenePos() const
Returns the last recorded mouse cursor position in scene coordinates.
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QDeclarativeItem class provides the most basic of all visual items in QML.
QPointF mapFromScene(const QPointF &point) const
Maps the point point, which is in this item&#39;s scene&#39;s coordinate system, to this item&#39;s coordinate sy...
QPointF scenePos() const
Returns the mouse cursor position in scene coordinates.
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition: qpoint.h:376
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
Definition: qtestmouse.h:71
bool keepMouseGrab() const
Returns a value indicating whether mouse input should remain with this item exclusively.
QPointF buttonDownPos(Qt::MouseButton button) const
Returns the mouse cursor position in item coordinates where the specified button was clicked...
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item&#39;s coordinate system, to the scene&#39;s coordinate system...
void grabMouse()
Grabs the mouse input.
Qt::MouseButtons buttons() const
Returns the combination of mouse buttons that were pressed at the time the event was sent...
MouseButton
Definition: qnamespace.h:150

◆ setCurrentIndex()

void QDeclarativePathView::setCurrentIndex ( int  idx)

Definition at line 620 of file qdeclarativepathview.cpp.

Referenced by decrementCurrentIndex(), and incrementCurrentIndex().

621 {
623  if (!isComponentComplete()) {
624  if (idx != d->currentIndex) {
625  d->currentIndex = idx;
627  }
628  return;
629  }
630 
631  idx = d->modelCount
632  ? ((idx % d->modelCount) + d->modelCount) % d->modelCount
633  : 0;
634  if (d->model && idx != d->currentIndex) {
635  if (d->modelCount) {
636  int itemIndex = (d->currentIndex - d->firstIndex + d->modelCount) % d->modelCount;
637  if (itemIndex < d->items.count()) {
638  if (QDeclarativeItem *item = d->items.at(itemIndex)) {
639  if (QDeclarativePathViewAttached *att = d->attached(item))
640  att->setIsCurrentItem(false);
641  }
642  }
643  }
644  d->currentItem = 0;
646  d->currentIndex = idx;
647  if (d->modelCount) {
648  if (d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange)
649  d->snapToCurrent();
650  int itemIndex = (idx - d->firstIndex + d->modelCount) % d->modelCount;
651  if (itemIndex < d->items.count()) {
652  d->currentItem = d->items.at(itemIndex);
653  d->currentItem->setFocus(true);
654  if (QDeclarativePathViewAttached *att = d->attached(d->currentItem))
655  att->setIsCurrentItem(true);
656  }
657  d->currentItemOffset = d->positionOfIndex(d->currentIndex);
658  d->updateHighlight();
659  }
661  }
662 }
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
The QDeclarativeItem class provides the most basic of all visual items in QML.
#define emit
Definition: qobjectdefs.h:76
if(void) toggleToolbarShown

◆ setDelegate()

void QDeclarativePathView::setDelegate ( QDeclarativeComponent delegate)

Definition at line 1098 of file qdeclarativepathview.cpp.

1099 {
1101  if (delegate == this->delegate())
1102  return;
1103  if (!d->ownModel) {
1104  d->model = new QDeclarativeVisualDataModel(qmlContext(this));
1105  d->ownModel = true;
1106  }
1107  if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
1108  int oldCount = dataModel->count();
1109  dataModel->setDelegate(delegate);
1110  d->modelCount = dataModel->count();
1111  d->regenerate();
1112  if (oldCount != dataModel->count())
1113  emit countChanged();
1115  }
1116 }
QDeclarativeParserStatus ** d
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeComponent * delegate() const
#define emit
Definition: qobjectdefs.h:76

◆ setDragMargin()

void QDeclarativePathView::setDragMargin ( qreal  margin)

Definition at line 932 of file qdeclarativepathview.cpp.

933 {
935  if (d->dragMargin == dragMargin)
936  return;
937  d->dragMargin = dragMargin;
939 }
QDeclarativeParserStatus ** d
qreal dragMargin() const
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setFlickDeceleration()

void QDeclarativePathView::setFlickDeceleration ( qreal  dec)

Definition at line 956 of file qdeclarativepathview.cpp.

957 {
959  if (d->deceleration == dec)
960  return;
961  d->deceleration = dec;
963 }
QDeclarativeParserStatus ** d
void flickDecelerationChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
Q_CORE_EXPORT QTextStream & dec(QTextStream &s)
#define emit
Definition: qobjectdefs.h:76

◆ setHighlight()

void QDeclarativePathView::setHighlight ( QDeclarativeComponent highlight)

Definition at line 775 of file qdeclarativepathview.cpp.

776 {
778  if (highlight != d->highlightComponent) {
779  d->highlightComponent = highlight;
780  d->createHighlight();
781  d->updateHighlight();
783  }
784 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
QDeclarativeComponent * highlight() const

◆ setHighlightMoveDuration()

void QDeclarativePathView::setHighlightMoveDuration ( int  duration)

Definition at line 906 of file qdeclarativepathview.cpp.

907 {
909  if (d->highlightMoveDuration == duration)
910  return;
911  d->highlightMoveDuration = duration;
913 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void highlightMoveDurationChanged()
#define emit
Definition: qobjectdefs.h:76

◆ setHighlightRangeMode()

void QDeclarativePathView::setHighlightRangeMode ( HighlightRangeMode  mode)

Definition at line 877 of file qdeclarativepathview.cpp.

878 {
880  if (d->highlightRangeMode == mode)
881  return;
882  d->highlightRangeMode = mode;
883  d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
885 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void highlightRangeModeChanged()

◆ setInteractive()

void QDeclarativePathView::setInteractive ( bool  interactive)

Definition at line 982 of file qdeclarativepathview.cpp.

983 {
985  if (interactive != d->interactive) {
986  d->interactive = interactive;
987  if (!interactive)
988  d->tl.clear();
990  }
991 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setModel()

void QDeclarativePathView::setModel ( const QVariant model)

Definition at line 502 of file qdeclarativepathview.cpp.

503 {
505  if (d->modelVariant == model)
506  return;
507 
508  if (d->model) {
509  disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
510  disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
511  disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
512  disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
514  d->clear();
515  }
516 
517  d->modelVariant = model;
518  QObject *object = qvariant_cast<QObject*>(model);
519  QDeclarativeVisualModel *vim = 0;
520  if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
521  if (d->ownModel) {
522  delete d->model;
523  d->ownModel = false;
524  }
525  d->model = vim;
526  } else {
527  if (!d->ownModel) {
528  d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
529  d->ownModel = true;
530  }
531  if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
532  dataModel->setModel(model);
533  }
534  int oldModelCount = d->modelCount;
535  d->modelCount = 0;
536  if (d->model) {
537  connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
538  connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
539  connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
540  connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
542  d->modelCount = d->model->count();
543  }
544  if (isComponentComplete()) {
545  if (d->currentIndex != 0) {
546  d->currentIndex = 0;
548  }
549  if (d->offset != 0.0) {
550  d->offset = 0;
552  }
553  }
554  d->regenerate();
555  if (d->modelCount != oldModelCount)
556  emit countChanged();
557  emit modelChanged();
558 }
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 itemsRemoved(int index, int count)
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
#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
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
void itemsMoved(int, int, int)
QVariant model() const
void itemsInserted(int index, int count)
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
void createdItem(int index, QDeclarativeItem *item)

◆ setOffset()

void QDeclarativePathView::setOffset ( qreal  offset)

Definition at line 714 of file qdeclarativepathview.cpp.

Referenced by QDeclarativePathViewPrivate::setAdjustedOffset().

715 {
717  d->setOffset(offset);
718  d->updateCurrent();
719 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
qreal offset() const

◆ setPath()

void QDeclarativePathView::setPath ( QDeclarativePath path)

Definition at line 587 of file qdeclarativepathview.cpp.

588 {
590  if (d->path == path)
591  return;
592  if (d->path)
593  disconnect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated()));
594  d->path = path;
595  connect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated()));
596  if (d->isValid() && isComponentComplete()) {
597  d->clear();
598  if (d->attType) {
599  d->attType->release();
600  d->attType = 0;
601  }
602  d->regenerate();
603  }
604  emit pathChanged();
605 }
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
QDeclarativePath * path() const
#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
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

◆ setPathItemCount()

void QDeclarativePathView::setPathItemCount ( int  i)

Definition at line 1131 of file qdeclarativepathview.cpp.

1132 {
1134  if (i == d->pathItems)
1135  return;
1136  if (i < 1)
1137  i = 1;
1138  d->pathItems = i;
1139  d->updateMappedRange();
1140  if (d->isValid() && isComponentComplete()) {
1141  d->regenerate();
1142  }
1144 }
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

◆ setPreferredHighlightBegin()

void QDeclarativePathView::setPreferredHighlightBegin ( qreal  start)

Definition at line 843 of file qdeclarativepathview.cpp.

844 {
846  if (d->highlightRangeStart == start || start < 0 || start > 1.0)
847  return;
848  d->highlightRangeStart = start;
849  d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
850  refill();
852 }
void preferredHighlightBeginChanged()
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setPreferredHighlightEnd()

void QDeclarativePathView::setPreferredHighlightEnd ( qreal  end)

Definition at line 860 of file qdeclarativepathview.cpp.

861 {
863  if (d->highlightRangeEnd == end || end < 0 || end > 1.0)
864  return;
865  d->highlightRangeEnd = end;
866  d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
867  refill();
869 }
QDeclarativeParserStatus ** d
void preferredHighlightEndChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
static const KeyPair *const end

◆ snapPositionChanged

void QDeclarativePathView::snapPositionChanged ( )
signal

◆ ticked

void QDeclarativePathView::ticked ( )
privateslot

Definition at line 1694 of file qdeclarativepathview.cpp.

1695 {
1697  d->updateCurrent();
1698 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

Friends and Related Functions

◆ QDeclarativePathViewAttached

Definition at line 192 of file qdeclarativepathview_p.h.

Referenced by qmlAttachedProperties().

Properties

◆ count

int QDeclarativePathView::count
private

Definition at line 80 of file qdeclarativepathview_p.h.

◆ currentIndex

int QDeclarativePathView::currentIndex
private

Definition at line 62 of file qdeclarativepathview_p.h.

◆ delegate

QDeclarativeComponent * QDeclarativePathView::delegate
private

Definition at line 81 of file qdeclarativepathview_p.h.

◆ dragMargin

qreal QDeclarativePathView::dragMargin
private

Definition at line 73 of file qdeclarativepathview_p.h.

◆ flickDeceleration

qreal QDeclarativePathView::flickDeceleration
private

Definition at line 74 of file qdeclarativepathview_p.h.

◆ flicking

bool QDeclarativePathView::flicking
private

◆ highlight

QDeclarativeComponent * QDeclarativePathView::highlight
private

Definition at line 65 of file qdeclarativepathview_p.h.

◆ highlightItem

QDeclarativeItem * QDeclarativePathView::highlightItem
private

Definition at line 66 of file qdeclarativepathview_p.h.

◆ highlightMoveDuration

int QDeclarativePathView::highlightMoveDuration
private

Definition at line 71 of file qdeclarativepathview_p.h.

◆ highlightRangeMode

QDeclarativePathView::HighlightRangeMode QDeclarativePathView::highlightRangeMode
private

Definition at line 70 of file qdeclarativepathview_p.h.

◆ interactive

bool QDeclarativePathView::interactive
private

◆ model

QVariant QDeclarativePathView::model
private

Definition at line 60 of file qdeclarativepathview_p.h.

◆ moving

bool QDeclarativePathView::moving
private

◆ offset

qreal QDeclarativePathView::offset
private

Definition at line 63 of file qdeclarativepathview_p.h.

◆ path

QDeclarativePath * QDeclarativePathView::path
private

Definition at line 61 of file qdeclarativepathview_p.h.

◆ pathItemCount

int QDeclarativePathView::pathItemCount
private

Definition at line 82 of file qdeclarativepathview_p.h.

◆ preferredHighlightBegin

qreal QDeclarativePathView::preferredHighlightBegin
private

Definition at line 68 of file qdeclarativepathview_p.h.

◆ preferredHighlightEnd

qreal QDeclarativePathView::preferredHighlightEnd
private

Definition at line 69 of file qdeclarativepathview_p.h.


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