42 #include "private/qdeclarativepathview_p.h" 43 #include "private/qdeclarativepathview_p_p.h" 50 #include <QGraphicsSceneEvent> 59 #ifdef QT_USE_MATH_H_FLOATS 60 if(
sizeof(
qreal) ==
sizeof(
float))
61 return fmodf(
float(x),
float(y));
70 :
QObject(parent), m_percent(-1), m_view(0), m_onPath(false), m_isCurrent(false)
72 if (qPathViewAttachedType) {
100 q->setFiltersChildEvents(
true);
101 q->connect(&tl,
SIGNAL(updated()), q,
SLOT(ticked()));
102 lastPosTime.invalidate();
103 static int timelineCompletedIdx = -1;
104 static int movementEndingIdx = -1;
105 if (timelineCompletedIdx == -1) {
116 requestedIndex = modelIndex;
122 foreach(
const QString &attr, path->attributes())
123 attType->createProperty(attr.
toUtf8());
125 qPathViewAttachedType = attType;
127 qPathViewAttachedType = 0;
146 if (model->release(item) == 0) {
149 att->setOnPath(
false);
160 for (
int i=0; i<items.count(); i++){
170 if (model && pathItems != -1 && pathItems < modelCount)
171 mappedRange =
qreal(pathItems)/modelCount;
180 if (model && index >= 0 && index < modelCount) {
183 start = highlightRangeStart;
184 qreal globalPos = index + offset;
185 globalPos =
qmlMod(globalPos,
qreal(modelCount)) / modelCount;
186 if (pathItems != -1 && pathItems < modelCount) {
187 globalPos += start * mappedRange;
188 globalPos =
qmlMod(globalPos, 1.0);
189 if (globalPos < mappedRange)
190 pos = globalPos / mappedRange;
192 pos =
qmlMod(globalPos + start, 1.0);
202 if (!q->isComponentComplete())
205 bool changed =
false;
207 if (highlightItem->scene())
208 highlightItem->scene()->removeItem(highlightItem);
209 highlightItem->deleteLater();
215 if (highlightComponent) {
217 QObject *nobj = highlightComponent->create(highlightContext);
224 delete highlightContext;
232 highlightItem = item;
236 emit q->highlightItemChanged();
242 if (!q->isComponentComplete() || !isValid())
246 updateItem(highlightItem, highlightRangeStart);
248 qreal target = currentIndex;
250 offsetAdj =
qreal(0.0);
251 tl.reset(moveHighlight);
252 moveHighlight.setValue(highlightPosition);
254 const int duration = highlightMoveDuration;
256 if (target - highlightPosition > modelCount/2) {
260 tl.set(moveHighlight, modelCount-
qreal(0.01));
262 }
else if (target - highlightPosition <= -modelCount/2) {
266 tl.set(moveHighlight,
qreal(0.0));
269 highlightUp = highlightPosition - target < 0;
278 if (pos != highlightPosition) {
282 start = highlightRangeStart;
283 end = highlightRangeEnd;
288 qreal relativeHighlight =
qmlMod(pos + offset, range) / range;
290 if (!highlightUp && relativeHighlight > end * mappedRange) {
292 setOffset(offset + diff * range);
293 }
else if (highlightUp && relativeHighlight >= (end - start) * mappedRange) {
294 qreal diff = relativeHighlight - (end - start) * mappedRange;
295 setOffset(offset - diff * range -
qreal(0.00001));
298 highlightPosition = pos;
299 qreal pathPos = positionOfIndex(pos);
300 updateItem(highlightItem, pathPos);
302 att->setOnPath(pathPos !=
qreal(-1.0));
310 while (it !=
d->items.end()) {
324 att->m_percent = percent;
325 foreach(
const QString &attr, path->attributes())
326 att->setValue(attr.
toUtf8(), path->attributeAt(attr, percent));
328 QPointF pf = path->pointAt(percent);
336 if (!q->isComponentComplete())
429 d->attType->release();
499 return d->modelVariant;
505 if (
d->modelVariant == model)
520 if (
object && (vim = qobject_cast<QDeclarativeVisualModel *>(
object))) {
532 dataModel->setModel(model);
534 int oldModelCount =
d->modelCount;
542 d->modelCount =
d->model->count();
545 if (
d->currentIndex != 0) {
549 if (
d->offset != 0.0) {
555 if (
d->modelCount != oldModelCount)
570 return d->model ?
d->modelCount : 0;
599 d->attType->release();
617 return d->currentIndex;
624 if (idx !=
d->currentIndex) {
625 d->currentIndex = idx;
632 ? ((idx %
d->modelCount) +
d->modelCount) %
d->modelCount
634 if (
d->model && idx !=
d->currentIndex) {
636 int itemIndex = (
d->currentIndex -
d->firstIndex +
d->modelCount) %
d->modelCount;
637 if (itemIndex < d->items.count()) {
640 att->setIsCurrentItem(
false);
646 d->currentIndex = idx;
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);
655 att->setIsCurrentItem(
true);
657 d->currentItemOffset =
d->positionOfIndex(
d->currentIndex);
658 d->updateHighlight();
717 d->setOffset(offset);
725 if (isValid() && q->isComponentComplete()) {
733 emit q->offsetChanged();
772 return d->highlightComponent;
778 if (highlight !=
d->highlightComponent) {
780 d->createHighlight();
781 d->updateHighlight();
797 return d->highlightItem;
840 return d->highlightRangeStart;
846 if (
d->highlightRangeStart == start || start < 0 || start > 1.0)
848 d->highlightRangeStart = start;
849 d->haveHighlightRange =
d->highlightRangeMode !=
NoHighlightRange &&
d->highlightRangeStart <=
d->highlightRangeEnd;
857 return d->highlightRangeEnd;
863 if (
d->highlightRangeEnd == end || end < 0 || end > 1.0)
865 d->highlightRangeEnd =
end;
866 d->haveHighlightRange =
d->highlightRangeMode !=
NoHighlightRange &&
d->highlightRangeStart <=
d->highlightRangeEnd;
874 return d->highlightRangeMode;
880 if (
d->highlightRangeMode == mode)
882 d->highlightRangeMode = mode;
883 d->haveHighlightRange =
d->highlightRangeMode !=
NoHighlightRange &&
d->highlightRangeStart <=
d->highlightRangeEnd;
903 return d->highlightMoveDuration;
909 if (
d->highlightMoveDuration == duration)
911 d->highlightMoveDuration = duration;
929 return d->dragMargin;
935 if (
d->dragMargin == dragMargin)
953 return d->deceleration;
959 if (
d->deceleration == dec)
961 d->deceleration =
dec;
979 return d->interactive;
985 if (interactive !=
d->interactive) {
1092 return dataModel->delegate();
1108 int oldCount = dataModel->count();
1109 dataModel->setDelegate(delegate);
1110 d->modelCount = dataModel->count();
1112 if (oldCount != dataModel->count())
1128 return d->pathItems;
1134 if (i ==
d->pathItems)
1139 d->updateMappedRange();
1149 qreal mindist = 1e10;
1152 for (
qreal i=1; i < 1000; i++) {
1155 qreal dist = diff.
x()*diff.
x() + diff.
y()*diff.
y();
1156 if (dist < mindist) {
1164 *nearPercent = nearPc / 1000.0;
1172 if (
d->interactive) {
1173 d->handleMousePressEvent(event);
1185 QPointF scenePoint = q->mapToScene(event->
pos());
1187 for (; idx < items.count(); ++idx) {
1188 QRectF rect = items.at(idx)->boundingRect();
1189 rect = items.at(idx)->mapToScene(rect).boundingRect();
1193 if (idx == items.count() &&
dragMargin == 0.)
1196 startPoint = pointNear(event->
pos(), &startPc);
1197 if (idx == items.count()) {
1217 if (
d->interactive) {
1218 d->handleMouseMoveEvent(event);
1234 QPointF pathPoint = pointNear(event->
pos(), &newPc);
1236 QPointF delta = pathPoint - startPoint;
1245 qreal diff = (newPc - startPc)*modelCount*mappedRange;
1247 q->setOffset(
offset + diff);
1249 if (diff > modelCount/2)
1251 else if (diff < -modelCount/2)
1260 emit q->movingChanged();
1261 emit q->movementStarted();
1269 if (
d->interactive) {
1270 d->handleMouseReleaseEvent(event);
1282 q->setKeepMouseGrab(
false);
1287 qreal velocity = elapsed > 0. ? lastDist /
elapsed : 0;
1289 qreal count = pathItems == -1 ? modelCount : pathItems;
1290 if (
qAbs(velocity) > count * 2)
1291 velocity = (velocity > 0 ?
count : -
count) * 2;
1293 qreal v2 = velocity*velocity;
1294 qreal accel = deceleration/10;
1308 accel = v2 / (2.0f *
qAbs(dist));
1311 offsetAdj =
qreal(0.0);
1312 moveOffset.setValue(
offset);
1313 tl.accel(moveOffset, velocity, accel, dist);
1317 emit q->flickingChanged();
1318 emit q->flickStarted();
1324 lastPosTime.invalidate();
1326 q->movementEnding();
1336 bool stealThisEvent =
d->stealMouse;
1339 for (
int i = 0x1; i <= 0x10; i <<= 1) {
1356 stealThisEvent =
d->stealMouse;
1365 if (grabber && stealThisEvent && !grabber->
keepMouseGrab() && grabber !=
this)
1368 return d->stealMouse;
1369 }
else if (
d->lastPosTime.isValid()) {
1370 d->lastPosTime.invalidate();
1373 d->stealMouse =
false;
1383 switch (e->
type()) {
1387 return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
1411 d->modelCount =
d->model->count();
1412 if (
d->modelCount &&
d->currentIndex != 0)
1413 d->offset =
qmlMod(
d->modelCount -
d->currentIndex,
d->modelCount);
1416 d->createHighlight();
1418 d->updateHighlight();
1431 d->layoutScheduled =
false;
1432 bool currentVisible =
false;
1435 int idx =
d->firstIndex;
1437 while (it !=
d->items.end()) {
1441 d->updateItem(item, pos);
1442 if (idx ==
d->currentIndex) {
1443 currentVisible =
true;
1444 d->currentItemOffset =
pos;
1449 d->updateItem(item, 1.0);
1450 d->releaseItem(item);
1451 if (it ==
d->items.begin()) {
1452 if (++
d->firstIndex >=
d->modelCount)
1455 it =
d->items.erase(it);
1458 if (idx >=
d->modelCount)
1461 if (!
d->items.count())
1464 if (
d->modelCount) {
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;
1471 startPos =
d->highlightRangeStart;
1472 if (
d->firstIndex >= 0) {
1473 startPos =
d->positionOfIndex(
d->firstIndex);
1474 idx = (
d->firstIndex +
d->items.count()) %
d->modelCount;
1477 while ((pos > startPos || !
d->items.count()) &&
d->items.count() <
count) {
1480 if (
d->model->completePending())
1482 if (
d->currentIndex == idx) {
1485 att->setIsCurrentItem(
true);
1486 currentVisible =
true;
1487 d->currentItemOffset =
pos;
1488 d->currentItem = item;
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();
1497 if (idx >=
d->modelCount)
1499 pos =
d->positionOfIndex(idx);
1502 idx =
d->firstIndex - 1;
1504 idx =
d->modelCount - 1;
1505 pos =
d->positionOfIndex(idx);
1506 while (pos >= 0.0 && pos < startPos) {
1509 if (
d->model->completePending())
1511 if (
d->currentIndex == idx) {
1514 att->setIsCurrentItem(
true);
1515 currentVisible =
true;
1516 d->currentItemOffset =
pos;
1517 d->currentItem = item;
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;
1526 idx =
d->modelCount - 1;
1527 pos =
d->positionOfIndex(idx);
1532 if (!currentVisible)
1533 d->currentItemOffset = 1.0;
1536 d->updateItem(
d->highlightItem,
d->highlightRangeStart);
1538 att->setOnPath(
true);
1540 d->updateItem(
d->highlightItem,
d->currentItemOffset);
1542 att->setOnPath(currentVisible);
1544 while (
d->itemCache.count())
1545 d->releaseItem(
d->itemCache.takeLast());
1555 if (
d->modelCount) {
1556 d->itemCache +=
d->items;
1559 d->currentIndex +=
count;
1561 }
else if (
d->offset != 0) {
1567 if (
d->flicking ||
d->moving) {
1572 d->updateMappedRange();
1573 d->scheduleLayout();
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) {
1592 d->currentIndex =
qMin(modelIndex,
d->modelCount-count-1);
1593 if (
d->currentItem) {
1595 att->setIsCurrentItem(
true);
1597 currentChanged =
true;
1600 d->itemCache +=
d->items;
1603 bool changedOffset =
false;
1604 if (modelIndex >
d->currentIndex) {
1605 if (
d->offset >= count) {
1606 changedOffset =
true;
1614 if (
d->currentIndex == -1)
1615 d->currentIndex =
d->calcCurrentIndex();
1617 if (!
d->modelCount) {
1618 while (
d->itemCache.count())
1619 d->releaseItem(
d->itemCache.takeLast());
1621 changedOffset =
true;
1622 d->tl.reset(
d->moveOffset);
1643 int oldCurrent =
d->currentIndex;
1645 if (
d->currentIndex >= 0 &&
d->currentItem)
1646 d->currentIndex =
d->model->indexOf(
d->currentItem,
this);
1651 while (removedItems.
count())
1652 d->releaseItem(removedItems.
takeLast());
1654 if (oldCurrent !=
d->currentIndex)
1662 d->modelCount =
d->model->count();
1670 if (
d->requestedIndex != index) {
1674 foreach(
const QString &attr,
d->path->attributes())
1675 d->attType->createProperty(attr.
toUtf8());
1677 qPathViewAttachedType =
d->attType;
1679 qPathViewAttachedType = 0;
1685 d->updateItem(item, index < d->firstIndex ?
qreal(0.0) :
qreal(1.0));
1704 d->flicking =
false;
1708 if (
d->moving && !
d->stealMouse) {
1719 if (modelCount &&
model && items.count()) {
1724 current = current % modelCount;
1733 if (moveReason !=
Mouse)
1738 int idx = calcCurrentIndex();
1740 int itemIndex = (
currentIndex - firstIndex + modelCount) % modelCount;
1741 if (itemIndex < items.count()) {
1744 att->setIsCurrentItem(
false);
1750 itemIndex = (idx - firstIndex + modelCount) % modelCount;
1751 if (itemIndex < items.count()) {
1752 currentItem = items.at(itemIndex);
1753 currentItem->setFocus(
true);
1755 att->setIsCurrentItem(
true);
1758 emit q->currentIndexChanged();
1770 if (
model && items.count()) {
1772 int curr = calcCurrentIndex();
1774 q->setCurrentIndex(curr);
1783 if (!
model || modelCount <= 0)
1790 tl.reset(moveOffset);
1791 moveOffset.setValue(
offset);
1795 if (moveDirection == Positive || (moveDirection == Shortest && targetOffset -
offset > modelCount/2)) {
1797 if (targetOffset > moveOffset) {
1799 tl.set(moveOffset, modelCount);
1804 }
else if (moveDirection == Negative || targetOffset -
offset <= -modelCount/2) {
1806 if (targetOffset < moveOffset) {
1808 tl.set(moveOffset, 0.0);
1816 moveDirection = Shortest;
The QVariant class acts like a union for the most common Qt data types.
void setHighlightPosition(qreal pos)
void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
friend class QDeclarativePathViewAttached
void setHighlightRangeMode(HighlightRangeMode mode)
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
static double elapsed(qint64 after, qint64 before)
void preferredHighlightBeginChanged()
#define QT_END_NAMESPACE
This macro expands to.
static void fixOffsetCallback(void *)
static qint64 elapsed(QElapsedTimer &)
qreal flickDeceleration() const
QDeclarativeParserStatus ** d
The QEasingCurve class provides easing curves for controlling animation.
void setHighlightMoveDuration(int)
void incrementCurrentIndex()
#define it(className, varName)
bool sceneEventFilter(QGraphicsItem *, QEvent *)
Filters events for the item watched.
void setHighlight(QDeclarativeComponent *highlight)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
QVariant value(const QByteArray &name) const
void setInteractive(bool)
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
QDeclarativePathView(QDeclarativeItem *parent=0)
virtual bool event(QEvent *)
static QDeclarativePathViewAttached * qmlAttachedProperties(QObject *)
The QByteArray class provides an array of bytes.
The QPointF class defines a point in the plane using floating point precision.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
static void clear(QVariant::Private *d)
void setOffset(qreal offset)
void itemsRemoved(int index, int count)
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
void updateItem(QDeclarativeItem *, qreal)
bool sendMouseEvent(QGraphicsSceneMouseEvent *event)
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
void flickDecelerationChanged()
QPointF pos() const
Returns the position of the item in parent coordinates.
int count(const T &t) const
Returns the number of occurrences of value in the list.
void setPathItemCount(int)
void preferredHighlightEndChanged()
QDeclarativePath * path() const
void interactiveChanged()
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse...
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
void releaseItem(QDeclarativeItem *item)
QPointF pointAt(qreal) const
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QObject class is the base class of all Qt objects.
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
qreal preferredHighlightEnd() const
void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *)
Q_CORE_EXPORT QTextStream & dec(QTextStream &s)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...
qreal preferredHighlightBegin() const
QDeclarativePathView * m_view
qreal x() const
Returns the x-coordinate of this point.
void decrementCurrentIndex()
HighlightRangeMode highlightRangeMode() const
void highlightMoveDurationChanged()
void setModel(const QVariant &)
void setParentItem(QDeclarativeItem *parent)
bool contains(const QPointF &p) const
Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false...
virtual ~QDeclarativePathView()
QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const
QDeclarativeOpenMetaObject * m_metaobject
QPointF lastScenePos() const
Returns the last recorded mouse cursor position in scene coordinates.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setZValue(qreal z)
Sets the Z-value of the item to z.
The QRectF class defines a rectangle in the plane using floating point precision. ...
void destroyingItem(QDeclarativeItem *item)
bool event(QEvent *event)
The QDeclarativeComponent class encapsulates a QML component definition.
void setPath(QDeclarativePath *)
The QDeclarativeItem class provides the most basic of all visual items in QML.
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...
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...
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
QDeclarativeComponent * delegate() const
static QDeclarativeOpenMetaObjectType * qPathViewAttachedType
void setDragMargin(qreal margin)
void setValue(const QByteArray &name, const QVariant &val)
static int startDragDistance()
void pathItemCountChanged()
void setX(qreal x)
Set's the x coordinate of the item's position.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...
void currentIndexChanged()
void setAdjustedOffset(qreal offset)
void highlightRangeModeChanged()
int highlightMoveDuration() const
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 sy...
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
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.
void removeItemChangeListener(QDeclarativeItemChangeListener *, ChangeTypes types)
void itemsMoved(int, int, int)
static void start(QElapsedTimer &)
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
void setFlickDeceleration(qreal dec)
QPointF scenePos() const
Returns the mouse cursor position in scene coordinates.
void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
static qint64 restart(QElapsedTimer &)
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QObject * parent() const
Returns a pointer to the parent object.
void setY(qreal y)
Set's the y coordinate of the item's position.
bool isInteractive() const
virtual void componentComplete()
void setCurrentIndex(int idx)
void setPreferredHighlightEnd(qreal)
if(void) toggleToolbarShown
QDeclarativePathViewAttached * attached(QDeclarativeItem *item)
void itemsInserted(int index, int count)
void handleMousePressEvent(QGraphicsSceneMouseEvent *event)
T qvariant_cast(const QVariant &)
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
The QDeclarativeContext class defines a context within a QML engine.
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
QDeclarativeItem * getItem(int modelIndex)
qreal y() const
Returns the y-coordinate of this point.
bool keepMouseGrab() const
Returns a value indicating whether mouse input should remain with this item exclusively.
QPointF pos() const
Returns the mouse cursor position in item coordinates.
QPointF buttonDownPos(Qt::MouseButton button) const
Returns the mouse cursor position in item coordinates where the specified button was clicked...
T takeLast()
Removes the last item in the list and returns it.
QDeclarativeItem * highlightItem()
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
QDeclarativeComponent * highlight() const
void ungrabMouse()
Releases the mouse grab.
void setOffset(qreal offset)
void createdItem(int index, QDeclarativeItem *item)
static const KeyPair *const end
~QDeclarativePathViewAttached()
The QEvent class is the base class of all event classes.
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Filters events for the item watched.
Type type() const
Returns the event type.
int pathItemCount() const
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
qreal qmlMod(qreal x, qreal y)
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...
Q_DECL_CONSTEXPR int qRound(qreal d)
qreal positionOfIndex(qreal index) const
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...
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.
The QList class is a template class that provides lists.
void setPreferredHighlightBegin(qreal)
QDeclarativePathViewAttached(QObject *parent)
void setDelegate(QDeclarativeComponent *)