42 #include "private/qdeclarativegridview_p.h" 44 #include "private/qdeclarativevisualitemmodel_p.h" 45 #include "private/qdeclarativeflickable_p_p.h" 47 #include "private/qdeclarativesmoothedanimation_p_p.h" 55 #include "qplatformdefs.h" 59 #ifndef QML_FLICK_SNAPONETHRESHOLD 60 #define QML_FLICK_SNAPONETHRESHOLD 30 93 colPos = colSize * (columns-1) -
item->
x();
109 return -
item->
x() - 1;
150 , visibleIndex(0) , currentIndex(-1)
151 , cellWidth(100), cellHeight(100), columns(1), requestedIndex(-1), itemCount(0)
152 , highlightRangeStart(0), highlightRangeEnd(0)
153 , highlightRangeStartValid(false), highlightRangeEndValid(false)
155 , highlightComponent(0), highlight(0), trackedItem(0)
156 , moveReason(Other), buffer(0), highlightXAnimator(0), highlightYAnimator(0)
157 , highlightMoveDuration(150)
158 , footerComponent(0), footer(0), headerComponent(0), header(0)
160 , ownModel(false), wrap(false), autoHighlight(true)
161 , fixCurrentVisibility(false), lazyRelease(false), layoutScheduled(false)
162 , deferredRelease(false), haveHighlightRange(false), currentIndexCleared(false) {}
169 void refill(
qreal from,
qreal to,
bool doBuffer=
false);
172 void scheduleLayout();
174 void updateUnrequestedIndexes();
175 void updateUnrequestedPositions();
176 void updateTrackedItem();
177 void createHighlight();
178 void updateHighlight();
179 void updateCurrent(
int modelIndex);
182 void fixupPosition();
185 if (modelIndex >= visibleIndex && modelIndex < visibleIndex + visibleItems.count()) {
186 for (
int i = modelIndex - visibleIndex; i < visibleItems.count(); ++i) {
188 if (item->
index == modelIndex)
202 if (q->isComponentComplete()) {
207 updateCurrent(currentIndex);
222 q->QDeclarativeFlickable::setContentY(pos);
223 q->QDeclarativeFlickable::setContentX(0);
226 q->QDeclarativeFlickable::setContentX(pos);
228 q->QDeclarativeFlickable::setContentX(-pos-size());
229 q->QDeclarativeFlickable::setContentY(0);
238 if (!visibleItems.isEmpty())
239 pos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
245 if (model && model->count())
246 pos = rowPosAt(model->count() - 1) + rowSize();
251 return isRightToLeftTopToBottom() ? -lastPosition()+1 : originPosition();
255 return isRightToLeftTopToBottom() ? -originPosition()+1 : lastPosition();
260 return model && model->count() && model->isValid();
271 if (
FxGridItem *item = visibleItem(modelIndex))
273 if (!visibleItems.isEmpty()) {
274 if (modelIndex < visibleIndex) {
275 int count = (visibleIndex - modelIndex) % columns;
276 int col = visibleItems.first()->colPos() / colSize();
277 col = (columns - count + col) % columns;
278 return col * colSize();
280 int count = columns - 1 - (modelIndex - visibleItems.last()->index - 1) % columns;
281 return visibleItems.last()->colPos() - count * colSize();
284 return (modelIndex % columns) * colSize();
289 if (
FxGridItem *item = visibleItem(modelIndex))
291 if (!visibleItems.isEmpty()) {
292 if (modelIndex < visibleIndex) {
293 int firstCol = visibleItems.first()->colPos() / colSize();
294 int col = visibleIndex - modelIndex + (columns - firstCol - 1);
295 int rows = col / columns;
296 return visibleItems.first()->rowPos() - rows * rowSize();
298 int count = modelIndex - visibleItems.last()->index;
299 int col = visibleItems.last()->colPos() + count * colSize();
300 int rows = col / (columns * colSize());
301 return visibleItems.last()->rowPos() + rows * rowSize();
304 qreal pos = (modelIndex / columns) * rowSize();
314 for (
int i = 0; i < visibleItems.count(); ++i) {
319 return visibleItems.count() ? visibleItems.first() : 0;
323 for (
int i = 0; i < visibleItems.count(); ++i) {
325 if (item->
index != -1)
335 if (modelIndex < visibleIndex || modelIndex >= visibleIndex + visibleItems.count())
337 for (
int i = 0; i < visibleItems.count(); ++i) {
339 if (listItem->
index == modelIndex)
340 return i + visibleIndex;
341 if (listItem->
index > modelIndex)
350 if (!visibleItems.isEmpty()) {
351 qreal highlightStart = isRightToLeftTopToBottom() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
352 pos += highlightStart;
354 snapPos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
355 snapPos = pos - fmodf(pos - snapPos,
qreal(rowSize()));
356 snapPos -= highlightStart;
359 if (isRightToLeftTopToBottom()) {
360 maxExtent = q->minXExtent();
361 minExtent = q->maxXExtent();
366 if (snapPos > maxExtent)
368 if (snapPos < minExtent)
375 for (
int i = 0; i < visibleItems.count(); ++i) {
377 if (item->
index == -1)
380 if (itemTop+rowSize()/2 >= pos && itemTop - rowSize()/2 <= pos)
387 int index = currentIndex;
388 for (
int i = 0; i < visibleItems.count(); ++i) {
390 if (item->
index == -1)
393 if (itemTop >= highlight->rowPos()-rowSize()/2 && itemTop < highlight->rowPos()+rowSize()/2) {
395 if (item->
colPos() >= highlight->colPos()-colSize()/2 && item->
colPos() < highlight->colPos()+colSize()/2)
407 ? header->item->height()
408 : header->item->width();
417 || newGeometry.
width() != oldGeometry.
width()) {
418 if (q->isComponentComplete()) {
423 }
else if ((header && header->item == item) || (footer && footer->item == item)) {
431 void positionViewAtIndex(
int index,
int mode);
439 for (
int i = 0; i < visibleItems.count(); ++i) {
441 if (listItem->
index == -1) {
443 }
else if (listItem->
index != visibleIndex + i - skip) {
444 for (
int j = 0; j < visibleItems.count(); j++)
445 qDebug() <<
" index" << j <<
"item index" << visibleItems.at(j)->index;
446 qFatal(
"index %d %d %d", visibleIndex, i, listItem->
index);
483 enum BufferMode { NoBuffer = 0x00, BufferBefore = 0x01, BufferAfter = 0x02 };
504 addItemChangeListener(
this, Geometry);
509 for (
int i = 0; i < visibleItems.count(); ++i)
510 releaseItem(visibleItems.at(i));
511 visibleItems.clear();
513 releaseItem(currentItem);
524 requestedIndex = modelIndex;
528 listItem->
index = modelIndex;
529 if (model->completePending()) {
533 model->completeItem();
537 unrequestedItems.remove(listItem->
item);
549 if (trackedItem == item) {
554 if (model->release(item->
item) == 0) {
556 unrequestedItems.insert(item->
item, model->indexOf(item->
item, q));
567 creationContext ? creationContext :
qmlContext(q));
584 if (!isValid() || !q->isComponentComplete())
586 itemCount = model->count();
587 qreal bufferFrom = from - buffer;
588 qreal bufferTo = to + buffer;
589 qreal fillFrom = from;
591 if (doBuffer && (bufferMode & BufferAfter))
593 if (doBuffer && (bufferMode & BufferBefore))
594 fillFrom = bufferFrom;
596 bool changed =
false;
598 int colPos = colPosAt(visibleIndex);
599 int rowPos = rowPosAt(visibleIndex);
600 int modelIndex = visibleIndex;
601 if (visibleItems.count()) {
602 rowPos = visibleItems.last()->rowPos();
603 colPos = visibleItems.last()->colPos() + colSize();
604 if (colPos > colSize() * (columns-1)) {
608 int i = visibleItems.count() - 1;
609 while (i > 0 && visibleItems.at(i)->index == -1)
611 modelIndex = visibleItems.at(i)->index + 1;
614 if (visibleItems.count() && (fillFrom > rowPos + rowSize()*2
615 || fillTo < rowPosAt(visibleIndex) - rowSize())) {
618 int count = (fillFrom - (rowPos + rowSize())) / (rowSize()) * columns;
619 for (
int i = 0; i < visibleItems.count(); ++i)
620 releaseItem(visibleItems.at(i));
621 visibleItems.clear();
623 if (modelIndex >= model->count())
624 modelIndex = model->count() - 1;
625 else if (modelIndex < 0)
627 modelIndex = modelIndex / columns * columns;
628 visibleIndex = modelIndex;
629 colPos = colPosAt(visibleIndex);
630 rowPos = rowPosAt(visibleIndex);
633 int colNum = colPos / colSize();
640 while (modelIndex < model->count() && rowPos <= fillTo + rowSize()*(columns - colNum)/(columns+1)) {
642 if (!(item = createItem(modelIndex)))
645 visibleItems.append(item);
648 if (colPos > colSize() * (columns-1)) {
659 if (visibleItems.count()) {
660 rowPos = visibleItems.first()->rowPos();
661 colPos = visibleItems.first()->colPos() - colSize();
663 colPos = colSize() * (columns - 1);
667 colNum = colPos / colSize();
668 while (visibleIndex > 0 && rowPos + rowSize() - 1 >= fillFrom - rowSize()*(colNum+1)/(columns+1)){
670 if (!(item = createItem(visibleIndex-1)))
674 visibleItems.prepend(item);
678 colPos = colSize() * (columns - 1);
687 if (!lazyRelease || !changed || deferredRelease) {
688 while (visibleItems.count() > 1
689 && (item = visibleItems.first())
690 && item->
rowPos()+rowSize()-1 < bufferFrom - rowSize()*(item->
colPos()/colSize()+1)/(columns+1)) {
694 if (item->
index != -1)
696 visibleItems.removeFirst();
700 while (visibleItems.count() > 1
701 && (item = visibleItems.last())
702 && item->
rowPos() > bufferTo + rowSize()*(columns - item->
colPos()/colSize())/(columns+1)) {
706 visibleItems.removeLast();
710 deferredRelease =
false;
712 deferredRelease =
true;
720 q->setContentHeight(endPosition() - startPosition());
722 q->setContentWidth(endPosition() - startPosition());
723 }
else if (!doBuffer && buffer && bufferMode != NoBuffer) {
724 refill(from, to,
true);
736 q->setContentHeight(endPosition() - startPosition());
738 q->setContentWidth(lastPosition() - originPosition());
745 if (!layoutScheduled) {
746 layoutScheduled =
true;
754 layoutScheduled =
false;
755 if (!isValid() && !visibleItems.count()) {
759 if (visibleItems.count()) {
762 int col = visibleIndex % columns;
763 if (colPos != col * colSize()) {
764 colPos = col * colSize();
765 visibleItems.first()->setPosition(colPos, rowPos);
767 for (
int i = 1; i < visibleItems.count(); ++i) {
770 if (colPos > colSize() * (columns-1)) {
785 q->setContentHeight(endPosition() - startPosition());
788 q->setContentWidth(endPosition() - startPosition());
791 updateUnrequestedPositions();
798 for (it = unrequestedItems.
begin(); it != unrequestedItems.
end(); ++
it)
799 *it = model->indexOf(it.
key(), q);
805 for (it = unrequestedItems.
begin(); it != unrequestedItems.
end(); ++
it) {
810 if (isRightToLeftTopToBottom())
825 if (trackedItem && item != trackedItem) {
831 if (!trackedItem && item) {
837 q->trackedPositionChanged();
843 bool changed =
false;
845 if (trackedItem == highlight)
847 if (highlight->item->scene())
848 highlight->item->scene()->removeItem(highlight->item);
849 highlight->item->deleteLater();
852 delete highlightXAnimator;
853 delete highlightYAnimator;
854 highlightXAnimator = 0;
855 highlightYAnimator = 0;
861 if (highlightComponent) {
862 item = createComponentItem(highlightComponent);
872 if (currentItem && autoHighlight)
873 highlight->setPosition(currentItem->colPos(), currentItem->rowPos());
876 highlightXAnimator->userDuration = highlightMoveDuration;
879 highlightYAnimator->userDuration = highlightMoveDuration;
881 highlightXAnimator->restart();
882 highlightYAnimator->restart();
888 emit q->highlightItemChanged();
893 if ((!currentItem && highlight) || (currentItem && !highlight))
895 if (currentItem && autoHighlight && highlight && !hData.moving && !vData.moving) {
897 highlightXAnimator->to = currentItem->item->x();
898 highlightYAnimator->to = currentItem->item->y();
899 highlight->item->setWidth(currentItem->item->width());
900 highlight->item->setHeight(currentItem->item->height());
901 highlightXAnimator->restart();
902 highlightYAnimator->restart();
910 if (!q->isComponentComplete() || !isValid() || modelIndex < 0 || modelIndex >= model->count()) {
912 currentItem->attached->setIsCurrentItem(
false);
913 releaseItem(currentItem);
915 currentIndex = modelIndex;
916 emit q->currentIndexChanged();
918 }
else if (currentIndex != modelIndex) {
919 currentIndex = modelIndex;
920 emit q->currentIndexChanged();
925 if (currentItem && currentIndex == modelIndex) {
931 currentIndex = modelIndex;
932 currentItem = createItem(modelIndex);
933 fixCurrentVisibility =
true;
934 if (oldCurrentItem && (!currentItem || oldCurrentItem->
item != currentItem->item))
937 currentItem->setPosition(colPosAt(modelIndex), rowPosAt(modelIndex));
938 currentItem->item->setFocus(
true);
939 currentItem->attached->setIsCurrentItem(
true);
942 emit q->currentIndexChanged();
943 releaseItem(oldCurrentItem);
949 if (!footer && footerComponent) {
963 if (isRightToLeftTopToBottom()) {
964 rowOffset = footer->item->width()-cellWidth;
968 colOffset = footer->item->width()-cellWidth;
970 if (visibleItems.count()) {
971 qreal endPos = lastPosition();
972 if (lastVisibleIndex() == model->count()-1) {
973 footer->setPosition(colOffset, endPos + rowOffset);
976 if (endPos <= visiblePos || footer->
endRowPos() < endPos + rowOffset)
977 footer->setPosition(colOffset, endPos + rowOffset);
984 footer->setPosition(colOffset, endPos);
992 if (!header && headerComponent) {
1004 qreal colOffset = 0;
1006 if (isRightToLeftTopToBottom()) {
1007 rowOffset = -cellWidth;
1009 rowOffset = -headerSize();
1011 colOffset = header->item->width()-cellWidth;
1013 if (visibleItems.count()) {
1014 qreal startPos = originPosition();
1015 if (visibleIndex == 0) {
1016 header->setPosition(colOffset, startPos + rowOffset);
1019 qreal headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
1020 if (tempPos <= startPos || headerPos > startPos + rowOffset)
1021 header->setPosition(colOffset, startPos + rowOffset);
1024 header->setPosition(colOffset, 0);
1044 fixupMode = moveReason ==
Mouse ? fixupMode : Immediate;
1046 qreal highlightStart;
1049 if (isRightToLeftTopToBottom()) {
1052 highlightStart = highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
1053 highlightEnd = highlightRangeEndValid ? size()-highlightRangeStart : highlightRangeEnd;
1056 highlightStart = highlightRangeStart;
1057 highlightEnd = highlightRangeEnd;
1070 else if (data.
velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -rowSize()/2)
1071 bias = -rowSize()/2;
1072 if (isRightToLeftTopToBottom())
1074 tempPosition -= bias;
1076 FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
1077 if (!topItem && strictHighlightRange && currentItem) {
1080 topItem = currentItem;
1082 FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
1083 if (!bottomItem && strictHighlightRange && currentItem) {
1086 bottomItem = currentItem;
1090 if (topItem && (isInBounds || strictHighlightRange)) {
1091 if (topItem->
index == 0 && header && tempPosition+highlightStart < header->
rowPos()+headerSize()/2 && !strictHighlightRange) {
1092 pos = isRightToLeftTopToBottom() ? - header->rowPos() + highlightStart - size() : header->rowPos() - highlightStart;
1094 if (isRightToLeftTopToBottom())
1095 pos =
qMax(
qMin(-topItem->
rowPos() + highlightStart - size(), -maxExtent), -minExtent);
1097 pos =
qMax(
qMin(topItem->
rowPos() - highlightStart, -maxExtent), -minExtent);
1099 }
else if (bottomItem && isInBounds) {
1100 if (isRightToLeftTopToBottom())
1101 pos =
qMax(
qMin(-bottomItem->
rowPos() + highlightEnd - size(), -maxExtent), -minExtent);
1103 pos =
qMax(
qMin(bottomItem->
rowPos() - highlightEnd, -maxExtent), -minExtent);
1110 timeline.reset(data.
move);
1111 if (fixupMode != Immediate) {
1115 timeline.set(data.
move, -pos);
1117 vTime = timeline.time();
1122 qreal pos = currentItem->rowPos();
1123 if (viewPos < pos + rowSize() - highlightEnd)
1124 viewPos = pos + rowSize() - highlightEnd;
1125 if (viewPos > pos - highlightStart)
1126 viewPos = pos - highlightStart;
1127 if (isRightToLeftTopToBottom())
1128 viewPos = -viewPos-size();
1129 timeline.reset(data.
move);
1131 if (fixupMode != Immediate) {
1135 timeline.set(data.
move, -viewPos);
1138 vTime = timeline.time();
1158 qreal maxDistance = 0;
1166 qreal bias = dist < rowSize()/2 ? rowSize()/2 : 0;
1167 if (isRightToLeftTopToBottom())
1171 velocity = maxVelocity;
1183 qreal bias = -dist < rowSize()/2 ? rowSize()/2 : 0;
1184 if (isRightToLeftTopToBottom())
1188 velocity = -maxVelocity;
1199 if (maxDistance > 0 || overShoot) {
1202 if (maxVelocity != -1 && maxVelocity <
qAbs(v)) {
1208 qreal accel = deceleration;
1213 qreal dist = v2 / (accel *
qreal(2.0)) + rowSize()/4;
1214 dist =
qMin(dist, maxDistance);
1218 qreal distTemp = isRightToLeftTopToBottom() ? -dist : dist;
1219 data.
flickTarget = -snapPosAt(-dataValue + distTemp);
1224 overshootDist = overShootDistance(vSize);
1227 overshootDist = overShootDistance(vSize);
1234 qreal adjv2 = accel * 2.0f *
qAbs(adjDist);
1243 accel = v2 / (2.0f *
qAbs(dist));
1245 data.
flickTarget = velocity > 0 ? minExtent : maxExtent;
1246 overshootDist = overShoot ? overShootDistance(vSize) : 0;
1248 timeline.reset(data.
move);
1249 timeline.accel(data.
move, v, accel, maxDistance + overshootDist);
1251 if (!hData.flicking && q->xflick()) {
1252 hData.flicking =
true;
1253 emit q->flickingChanged();
1254 emit q->flickingHorizontallyChanged();
1255 emit q->flickStarted();
1257 if (!vData.flicking && q->yflick()) {
1258 vData.flicking =
true;
1259 emit q->flickingChanged();
1260 emit q->flickingVerticallyChanged();
1261 emit q->flickStarted();
1264 timeline.reset(data.
move);
1265 fixup(data, minExtent, maxExtent);
1440 return d->modelVariant;
1447 return d->model->count();
1453 if (
d->modelVariant == model)
1467 if (
object && (vim = qobject_cast<QDeclarativeVisualModel *>(
object))) {
1470 d->ownModel =
false;
1479 dataModel->setModel(model);
1485 if ((
d->currentIndex >=
d->model->count() ||
d->currentIndex < 0) && !
d->currentIndexCleared) {
1489 d->updateCurrent(
d->currentIndex);
1490 if (
d->highlight &&
d->currentItem) {
1491 if (
d->autoHighlight)
1492 d->highlight->setPosition(
d->currentItem->colPos(),
d->currentItem->rowPos());
1493 d->updateTrackedItem();
1535 return dataModel->delegate();
1552 int oldCount = dataModel->count();
1553 dataModel->setDelegate(delegate);
1555 for (
int i = 0; i <
d->visibleItems.count(); ++i)
1556 d->releaseItem(
d->visibleItems.at(i));
1557 d->visibleItems.clear();
1558 d->releaseItem(
d->currentItem);
1562 d->updateCurrent(
d->currentIndex);
1563 if (
d->highlight &&
d->currentItem) {
1564 if (
d->autoHighlight)
1565 d->highlight->setPosition(
d->currentItem->colPos(),
d->currentItem->rowPos());
1566 d->updateTrackedItem();
1570 if (oldCount != dataModel->count())
1597 return d->currentIndex;
1603 if (
d->requestedIndex >= 0)
1605 d->currentIndexCleared = (index == -1);
1606 if (index ==
d->currentIndex)
1609 if (
d->layoutScheduled)
1612 d->updateCurrent(index);
1622 if (!
d->currentItem)
1624 return d->currentItem->item;
1645 return d->highlight->item;
1659 return d->model->count();
1679 return d->highlightComponent;
1685 if (highlight !=
d->highlightComponent) {
1687 d->updateCurrent(
d->currentIndex);
1711 return d->autoHighlight;
1717 if (
d->autoHighlight != autoHighlight) {
1718 d->autoHighlight = autoHighlight;
1719 if (autoHighlight) {
1720 d->updateHighlight();
1721 }
else if (
d->highlightXAnimator) {
1722 d->highlightXAnimator->stop();
1723 d->highlightYAnimator->stop();
1745 return d->highlightMoveDuration;
1751 if (
d->highlightMoveDuration != duration) {
1752 d->highlightMoveDuration = duration;
1753 if (
d->highlightYAnimator) {
1754 d->highlightXAnimator->userDuration =
d->highlightMoveDuration;
1755 d->highlightYAnimator->userDuration =
d->highlightMoveDuration;
1798 return d->highlightRangeStart;
1804 d->highlightRangeStartValid =
true;
1805 if (
d->highlightRangeStart == start)
1807 d->highlightRangeStart = start;
1808 d->haveHighlightRange =
d->highlightRange !=
NoHighlightRange &&
d->highlightRangeStart <=
d->highlightRangeEnd;
1815 d->highlightRangeStartValid =
false;
1816 if (
d->highlightRangeStart == 0)
1818 d->highlightRangeStart = 0;
1825 return d->highlightRangeEnd;
1831 d->highlightRangeEndValid =
true;
1832 if (
d->highlightRangeEnd == end)
1834 d->highlightRangeEnd =
end;
1835 d->haveHighlightRange =
d->highlightRange !=
NoHighlightRange &&
d->highlightRangeStart <=
d->highlightRangeEnd;
1842 d->highlightRangeEndValid =
false;
1843 if (
d->highlightRangeEnd == 0)
1845 d->highlightRangeEnd = 0;
1852 return d->highlightRange;
1858 if (
d->highlightRange == mode)
1860 d->highlightRange = mode;
1861 d->haveHighlightRange =
d->highlightRange !=
NoHighlightRange &&
d->highlightRangeStart <=
d->highlightRangeEnd;
1892 return d->layoutDirection;
1898 if (
d->layoutDirection != layoutDirection) {
1908 if (
d->effectiveLayoutMirror)
1911 return d->layoutDirection;
1937 if (
d->flow != flow) {
1975 if (
d->wrap == wrap)
2012 if (
d->buffer != buffer) {
2034 return d->cellWidth;
2040 if (cellWidth !=
d->cellWidth && cellWidth > 0) {
2041 d->cellWidth =
qMax(1, cellWidth);
2051 return d->cellHeight;
2057 if (cellHeight !=
d->cellHeight && cellHeight > 0) {
2058 d->cellHeight =
qMax(1, cellHeight);
2092 if (
d->snapMode != mode) {
2113 return d->footerComponent;
2119 if (
d->footerComponent != footer) {
2123 d->footer->item->deleteLater();
2152 return d->headerComponent;
2158 if (
d->headerComponent != header) {
2162 d->header->item->deleteLater();
2197 if (
d->layoutScheduled)
2211 d->lazyRelease =
true;
2212 if (
d->hData.flicking ||
d->vData.flicking) {
2214 if (
d->vData.velocity > 0)
2216 else if (
d->vData.velocity < 0)
2221 if (
d->hData.velocity > 0)
2223 else if (
d->hData.velocity < 0)
2228 if (
d->hData.flicking ||
d->vData.flicking ||
d->hData.moving ||
d->vData.moving)
2235 qreal highlightStart;
2237 if (
d->isRightToLeftTopToBottom()) {
2238 highlightStart =
d->highlightRangeStartValid ?
d->size()-
d->highlightRangeEnd :
d->highlightRangeStart;
2239 highlightEnd =
d->highlightRangeEndValid ?
d->size()-
d->highlightRangeStart :
d->highlightRangeEnd;
2240 viewPos = -
d->position()-
d->size();
2242 highlightStart =
d->highlightRangeStart;
2243 highlightEnd =
d->highlightRangeEnd;
2244 viewPos =
d->position();
2246 if (pos > viewPos + highlightEnd -
d->rowSize())
2247 pos = viewPos + highlightEnd -
d->rowSize();
2248 if (pos < viewPos + highlightStart)
2249 pos = viewPos + highlightStart;
2251 d->highlight->setPosition(
d->highlight->colPos(),
qRound(pos));
2254 int idx =
d->snapIndex();
2255 if (idx >= 0 && idx !=
d->currentIndex) {
2256 d->updateCurrent(idx);
2257 if (
d->currentItem &&
d->currentItem->colPos() !=
d->highlight->colPos() &&
d->autoHighlight) {
2259 d->highlightXAnimator->to =
d->currentItem->item->x();
2261 d->highlightYAnimator->to =
d->currentItem->item->y();
2273 qreal extent = -
d->startPosition();
2274 if (
d->header &&
d->visibleItems.count())
2275 extent +=
d->header->item->height();
2277 extent +=
d->highlightRangeStart;
2278 extent =
qMax(extent, -(
d->rowPosAt(0) +
d->rowSize() -
d->highlightRangeEnd));
2289 if (!
d->model || !
d->model->count()) {
2292 extent = -(
d->rowPosAt(
d->model->count()-1) -
d->highlightRangeStart);
2293 if (
d->highlightRangeEnd !=
d->highlightRangeStart)
2294 extent =
qMin(extent, -(
d->endPosition() -
d->highlightRangeEnd + 1));
2296 extent = -(
d->endPosition() -
height());
2299 extent -=
d->footer->item->height();
2311 qreal extent = -
d->startPosition();
2312 qreal highlightStart;
2314 qreal endPositionFirstItem = 0;
2315 if (
d->isRightToLeftTopToBottom()) {
2316 if (
d->model &&
d->model->count())
2317 endPositionFirstItem =
d->rowPosAt(
d->model->count()-1);
2318 highlightStart =
d->highlightRangeStartValid
2319 ?
d->highlightRangeStart - (
d->lastPosition()-endPositionFirstItem)
2320 :
d->size() - (
d->lastPosition()-endPositionFirstItem);
2321 highlightEnd =
d->highlightRangeEndValid ?
d->highlightRangeEnd :
d->size();
2322 if (
d->footer &&
d->visibleItems.count())
2323 extent +=
d->footer->item->width();
2325 endPositionFirstItem =
d->rowPosAt(0)+
d->rowSize();
2326 highlightStart =
d->highlightRangeStart;
2327 highlightEnd =
d->highlightRangeEnd;
2328 if (
d->header &&
d->visibleItems.count())
2329 extent +=
d->header->item->width();
2332 extent +=
d->isRightToLeftTopToBottom() ? -highlightStart : highlightStart;
2333 extent =
qMax(extent, -(endPositionFirstItem - highlightEnd));
2344 qreal highlightStart;
2346 qreal lastItemPosition = 0;
2347 if (
d->isRightToLeftTopToBottom()){
2348 highlightStart =
d->highlightRangeStartValid ?
d->highlightRangeEnd :
d->size();
2349 highlightEnd =
d->highlightRangeEndValid ?
d->highlightRangeStart :
d->size();
2350 lastItemPosition =
d->endPosition();
2352 highlightStart =
d->highlightRangeStart;
2353 highlightEnd =
d->highlightRangeEnd;
2354 lastItemPosition = 0;
2355 if (
d->model &&
d->model->count())
2356 lastItemPosition =
d->rowPosAt(
d->model->count()-1);
2358 if (!
d->model || !
d->model->count()) {
2361 extent = -(lastItemPosition - highlightStart);
2362 if (highlightEnd != highlightStart)
2363 extent =
d->isRightToLeftTopToBottom()
2364 ?
qMax(extent, -(
d->endPosition() - highlightEnd + 1))
2365 :
qMin(extent, -(
d->endPosition() - highlightEnd + 1));
2367 extent = -(
d->endPosition() -
width());
2369 if (
d->isRightToLeftTopToBottom()) {
2371 extent -=
d->header->item->width();
2374 extent -=
d->footer->item->width();
2389 if (
d->model &&
d->model->count() &&
d->interactive) {
2392 switch (event->
key()) {
2433 const int count =
d->model ?
d->model->count() : 0;
2464 const int count =
d->model ?
d->model->count() : 0;
2495 const int count =
d->model ?
d->model->count() : 0;
2541 const int count =
d->model ?
d->model->count() : 0;
2582 if (layoutScheduled)
2588 maxExtent = -q->maxYExtent();
2590 maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
2593 int itemPos = rowPosAt(idx);
2596 visibleItems.
clear();
2597 visibleIndex = idx - idx % columns;
2599 maxExtent = -q->maxYExtent();
2601 maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
2602 setPosition(
qMin(
qreal(itemPos), maxExtent));
2604 for (
int i = 0; i < oldVisible.
count(); ++i)
2605 releaseItem(oldVisible.
at(i));
2606 item = visibleItem(idx);
2613 if (index < 0 &&
header) {
2620 pos = itemPos - (size() - rowSize())/2;
2623 pos = itemPos - size() + rowSize();
2631 if (itemPos > pos + size())
2632 pos = itemPos - size() + rowSize();
2638 pos = itemPos - size() + rowSize();
2643 pos =
qMin(pos, maxExtent);
2646 minExtent = -q->minYExtent();
2648 minExtent = isRightToLeftTopToBottom() ? q->maxXExtent()-size() : -q->minXExtent();
2649 pos =
qMax(pos, minExtent);
2695 if (!
d->isValid() || index < 0 || index >=
d->model->count())
2697 d->positionViewAtIndex(index, mode);
2736 d->positionViewAtIndex(
d->model->count(),
End);
2757 for (
int i = 0; i <
d->visibleItems.count(); ++i) {
2758 const FxGridItem *listItem =
d->visibleItems.at(i);
2760 return listItem->
index;
2776 if (
d->currentIndex < 0 && !
d->currentIndexCleared)
2777 d->updateCurrent(0);
2779 d->updateCurrent(
d->currentIndex);
2780 if (
d->highlight &&
d->currentItem) {
2781 if (
d->autoHighlight)
2782 d->highlight->setPosition(
d->currentItem->colPos(),
d->currentItem->rowPos());
2783 d->updateTrackedItem();
2793 if (!
d->trackedItem || !
d->currentItem)
2796 const qreal trackedPos =
d->trackedItem->rowPos();
2798 qreal highlightStart;
2800 if (
d->isRightToLeftTopToBottom()) {
2801 viewPos = -
d->position()-
d->size();
2802 highlightStart =
d->highlightRangeStartValid ?
d->size()-
d->highlightRangeEnd :
d->highlightRangeStart;
2803 highlightEnd =
d->highlightRangeEndValid ?
d->size()-
d->highlightRangeStart :
d->highlightRangeEnd;
2805 viewPos =
d->position();
2806 highlightStart =
d->highlightRangeStart;
2807 highlightEnd =
d->highlightRangeEnd;
2810 if (
d->haveHighlightRange) {
2812 if (trackedPos > pos + highlightEnd -
d->rowSize())
2813 pos = trackedPos - highlightEnd +
d->rowSize();
2814 if (trackedPos < pos + highlightStart)
2815 pos = trackedPos - highlightStart;
2817 if (trackedPos < d->startPosition() + highlightStart) {
2818 pos =
d->startPosition();
2819 }
else if (
d->trackedItem->endRowPos() >
d->endPosition() -
d->size() + highlightEnd) {
2820 pos =
d->endPosition() -
d->size() + 1;
2821 if (pos < d->startPosition())
2822 pos =
d->startPosition();
2824 if (trackedPos < viewPos + highlightStart) {
2825 pos = trackedPos - highlightStart;
2826 }
else if (trackedPos > viewPos + highlightEnd -
d->rowSize()) {
2827 pos = trackedPos - highlightEnd +
d->rowSize();
2832 if (trackedPos < viewPos && d->
currentItem->rowPos() < viewPos) {
2833 pos =
qMax(trackedPos,
d->currentItem->rowPos());
2834 }
else if (
d->trackedItem->endRowPos() >= viewPos +
d->size()
2835 &&
d->currentItem->endRowPos() >= viewPos +
d->size()) {
2836 if (
d->trackedItem->endRowPos() <=
d->currentItem->endRowPos()) {
2837 pos =
d->trackedItem->endRowPos() -
d->size() + 1;
2838 if (
d->rowSize() >
d->size())
2841 pos =
d->currentItem->endRowPos() -
d->size() + 1;
2842 if (
d->rowSize() >
d->size())
2843 pos =
d->currentItem->rowPos();
2847 if (viewPos != pos) {
2849 d->calcVelocity =
true;
2850 d->setPosition(pos);
2851 d->calcVelocity =
false;
2862 int index =
d->visibleItems.count() ?
d->mapFromModel(modelIndex) : 0;
2864 int i =
d->visibleItems.count() - 1;
2865 while (i > 0 &&
d->visibleItems.at(i)->index == -1)
2867 if (
d->visibleItems.at(i)->index + 1 == modelIndex) {
2869 index =
d->visibleIndex +
d->visibleItems.count();
2871 if (modelIndex <= d->visibleIndex) {
2873 d->visibleIndex +=
count;
2874 for (
int i = 0; i <
d->visibleItems.count(); ++i) {
2876 if (listItem->
index != -1 && listItem->
index >= modelIndex)
2880 if (
d->currentIndex >= modelIndex) {
2882 d->currentIndex +=
count;
2884 d->currentItem->index =
d->currentIndex;
2887 d->scheduleLayout();
2894 int insertCount =
count;
2895 if (index < d->visibleIndex &&
d->visibleItems.count()) {
2896 insertCount -=
d->visibleIndex -
index;
2897 index =
d->visibleIndex;
2898 modelIndex =
d->visibleIndex;
2901 qreal tempPos =
d->isRightToLeftTopToBottom() ? -
d->position()-
d->size()+
d->width()+1 :
d->position();
2902 int to =
d->buffer+tempPos+
d->size()-1;
2905 if (
d->visibleItems.count()) {
2906 index -=
d->visibleIndex;
2907 if (index < d->visibleItems.count()) {
2908 colPos =
d->visibleItems.at(index)->colPos();
2909 rowPos =
d->visibleItems.at(index)->rowPos();
2912 colPos =
d->visibleItems.at(index-1)->colPos() +
d->colSize();
2913 rowPos =
d->visibleItems.at(index-1)->rowPos();
2914 if (colPos >
d->colSize() * (
d->columns-1)) {
2916 rowPos +=
d->rowSize();
2919 }
else if (
d->itemCount == 0 &&
d->header) {
2920 rowPos =
d->headerSize();
2924 for (
int i = 0; i <
d->visibleItems.count(); ++i) {
2926 if (listItem->
index != -1 && listItem->
index >= modelIndex)
2930 bool addedVisible =
false;
2933 while (i < insertCount && rowPos <= to + d->rowSize()*(
d->columns - (colPos/
d->colSize()))/
qreal(
d->columns+1)) {
2934 if (!addedVisible) {
2935 d->scheduleLayout();
2936 addedVisible =
true;
2944 d->visibleItems.insert(index, item);
2947 colPos +=
d->colSize();
2948 if (colPos >
d->colSize() * (
d->columns-1)) {
2950 rowPos +=
d->rowSize();
2955 if (i < insertCount) {
2958 while (
d->visibleItems.count() >
index) {
2959 d->releaseItem(
d->visibleItems.takeLast());
2964 d->visibleIndex = 0;
2966 if ((*it)->index != -1) {
2967 d->visibleIndex = (*it)->index;
2972 if (
d->itemCount &&
d->currentIndex >= modelIndex) {
2974 d->currentIndex +=
count;
2975 if (
d->currentItem) {
2976 d->currentItem->index =
d->currentIndex;
2977 d->currentItem->setPosition(
d->colPosAt(
d->currentIndex),
d->rowPosAt(
d->currentIndex));
2980 }
else if (
d->itemCount == 0 && (!
d->currentIndex || (
d->currentIndex < 0 && !
d->currentIndexCleared))) {
2985 for (
int j = 0; j < added.
count(); ++j)
2999 bool currentRemoved =
d->currentIndex >= modelIndex &&
d->currentIndex < modelIndex +
count;
3000 bool removedVisible =
false;
3003 while (it !=
d->visibleItems.end()) {
3005 if (item->
index == -1 || item->
index < modelIndex) {
3007 if (item->
index < modelIndex && !removedVisible) {
3008 d->scheduleLayout();
3009 removedVisible =
true;
3012 }
else if (item->
index >= modelIndex + count) {
3018 if (!removedVisible) {
3019 d->scheduleLayout();
3020 removedVisible =
true;
3028 it =
d->visibleItems.erase(it);
3029 d->releaseItem(item);
3036 if (!removedVisible && modelIndex < d->visibleIndex)
3037 d->scheduleLayout();
3040 if (
d->currentIndex >= modelIndex + count) {
3041 d->currentIndex -=
count;
3043 d->currentItem->index -=
count;
3045 }
else if (currentRemoved) {
3047 d->releaseItem(
d->currentItem);
3049 d->currentIndex = -1;
3051 d->updateCurrent(
qMin(modelIndex,
d->itemCount-1));
3057 d->visibleIndex = 0;
3058 for (it =
d->visibleItems.begin(); it !=
d->visibleItems.end(); ++
it) {
3059 if ((*it)->index != -1) {
3060 d->visibleIndex = (*it)->index;
3065 if (removedVisible &&
d->visibleItems.isEmpty()) {
3066 d->timeline.clear();
3067 if (
d->itemCount == 0) {
3082 it !=
d->visibleItems.end();) {
3085 d->releaseItem(listItem);
3086 it =
d->visibleItems.erase(
it);
3106 while (it !=
d->visibleItems.end()) {
3108 if (item->
index >= from && item->
index < from + count) {
3110 item->
index += (to-from);
3112 it =
d->visibleItems.erase(it);
3114 if (item->
index > from && item->
index != -1) {
3117 if (item->
index <
d->visibleIndex)
3118 d->visibleIndex = item->
index;
3124 int remaining =
count;
3125 int endIndex =
d->visibleIndex;
3126 it =
d->visibleItems.begin();
3127 while (it !=
d->visibleItems.end()) {
3129 if (remaining && item->
index >= to && item->
index < to + count) {
3133 movedItem =
d->createItem(item->
index);
3139 it =
d->visibleItems.insert(it, movedItem);
3140 if (it ==
d->visibleItems.begin() && firstItem)
3145 if (item->
index != -1) {
3146 if (item->
index >= to) {
3150 endIndex = item->
index;
3159 d->visibleItems.append(item);
3164 for (it =
d->visibleItems.begin(); it !=
d->visibleItems.end(); ++
it) {
3165 if ((*it)->index != -1) {
3166 d->visibleIndex = (*it)->index;
3172 if (
d->currentIndex >= 0 &&
d->currentItem) {
3173 int oldCurrent =
d->currentIndex;
3174 d->currentIndex =
d->model->indexOf(
d->currentItem->item,
this);
3175 if (oldCurrent !=
d->currentIndex) {
3176 d->currentItem->index =
d->currentIndex;
3182 while (moved.
count()) {
3183 int idx = moved.
begin().key();
3185 if (
d->currentItem && item->
item ==
d->currentItem->item)
3187 d->releaseItem(item);
3199 d->updateCurrent(
d->currentIndex);
3200 if (
d->highlight &&
d->currentItem) {
3201 if (
d->autoHighlight)
3202 d->highlight->setPosition(
d->currentItem->colPos(),
d->currentItem->rowPos());
3203 d->updateTrackedItem();
3213 if (
d->requestedIndex != index) {
3215 d->unrequestedItems.insert(item, index);
3227 d->unrequestedItems.remove(item);
3235 d->updateHighlight();
3241 if (
d->isRightToLeftTopToBottom())
3242 d->refill(-
d->position()-
d->size()+1, -
d->position());
3244 d->refill(
d->position(),
d->position()+
d->size()-1);
The QVariant class acts like a union for the most common Qt data types.
Qt::LayoutDirection layoutDirection() const
T qobject_cast(QObject *object)
void setFlickableDirection(FlickableDirection)
virtual void componentComplete()
FxGridItem * firstVisibleItem() const
FxGridItem * createItem(int modelIndex)
Qt::LayoutDirection layoutDirection
The QKeyEvent class describes a key event.
QDeclarativeComponent * header() const
QDeclarativeGridViewPrivate()
void cacheBufferChanged()
QDeclarativeGridView::HighlightRangeMode highlightRange
void itemsMoved(int from, int to, int count)
Qt::LayoutDirection effectiveLayoutDirection() const
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
void highlightMoveDurationChanged()
QDeclarativeParserStatus ** d
virtual qreal maxYExtent() const
The QEasingCurve class provides easing curves for controlling animation.
void setLayoutDirection(Qt::LayoutDirection)
void setCurrentIndex(int idx)
void setIsCurrentItem(bool c)
void setDelegate(QDeclarativeComponent *)
#define it(className, varName)
QDeclarativeComponent * footer() const
int highlightMoveDuration
QDeclarativeComponent * headerComponent
void updateCurrent(int modelIndex)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
qreal startPosition() const
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
void releaseItem(FxGridItem *item)
QDeclarativeGridViewAttached * attached
virtual bool event(QEvent *)
void setSnapMode(SnapMode mode)
HighlightRangeMode highlightRangeMode() const
The QPointF class defines a point in the plane using floating point precision.
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
static void clear(QVariant::Private *d)
virtual void keyPressEvent(QKeyEvent *event)
qreal highlightRangeStart
void createdItem(int index, QDeclarativeItem *item)
void setHighlight(QDeclarativeComponent *highlight)
#define QML_FLICK_SNAPONETHRESHOLD
QDeclarativeItem * currentItem()
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.
bool isWrapEnabled() const
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it...
void refill(qreal from, qreal to, bool doBuffer=false)
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
virtual qreal minYExtent() const
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QObject class is the base class of all Qt objects.
QDeclarativeComponent * highlightComponent
void setPos(const QPointF &pos)
Sets the position of the item to pos, which is in parent coordinates.
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
virtual QObject * create(QDeclarativeContext *context=0)
Create an object instance from this component.
void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &)
bool isRightToLeftTopToBottom() const
virtual qreal minYExtent() const
QDeclarativeGridView * view
FxGridItem(QDeclarativeItem *i, QDeclarativeGridView *v)
void positionViewAtIndex(int index, int mode)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void itemsRemoved(int index, int count)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
virtual void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry)
FxGridItem * snapItemAt(qreal pos)
Q_CORE_EXPORT void qDebug(const char *,...)
qreal lastPosition() const
void setPosition(qreal col, qreal row)
void setParentItem(QDeclarativeItem *parent)
int key() const
Returns the code of the key that was pressed or released.
virtual bool event(QEvent *event)
void append(const T &t)
Inserts value at the end of the list.
QDeclarativeItem * highlightItem()
MovementReason moveReason
void setHighlightRangeMode(HighlightRangeMode mode)
Q_INVOKABLE void positionViewAtIndex(int index, int mode)
#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 setHighlightFollowsCurrentItem(bool)
int mapFromModel(int modelIndex) const
The QDeclarativeComponent class encapsulates a QML component definition.
The QDeclarativeItem class provides the most basic of all visual items in QML.
qreal endPosition() const
QDeclarativeComponent * highlight() const
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)
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
qreal height() const
Returns the height of the rectangle.
virtual qreal value() const
Return the current value.
virtual void viewportMoved()
const T & at(int i) const
Returns the item at index position i in the list.
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)
void moveCurrentIndexDown()
virtual void setContentY(qreal pos)
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
QDeclarativeGuard< QDeclarativeVisualModel > model
static QDeclarativeGridViewAttached * qmlAttachedProperties(QObject *)
qreal originPosition() const
qreal width() const
Returns the width of the rectangle.
FxGridItem * visibleItem(int modelIndex) const
void updateUnrequestedPositions()
void highlightRangeModeChanged()
void setWrapEnabled(bool)
void clear()
Removes all items from the list.
static qreal component(const QPointF &point, unsigned int i)
void setHeader(QDeclarativeComponent *)
void setContentHeight(qreal)
void destroyingItem(QDeclarativeItem *item)
qreal rowPosAt(int modelIndex) const
QDeclarativeGridView(QDeclarativeItem *parent=0)
virtual qreal minXExtent() const
qreal colPosAt(int modelIndex) const
QDeclarativeGridView::SnapMode snapMode
Q_INVOKABLE int indexAt(qreal x, qreal y) const
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
bool highlightFollowsCurrentItem() const
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 setContentWidth(qreal)
void setFooter(QDeclarativeComponent *)
Q_CORE_EXPORT void qFatal(const char *,...)
#define Q_DECLARE_PUBLIC(Class)
QDeclarativeTimeLineValueProxy< QDeclarativeFlickablePrivate > move
qreal y() const
This convenience function is equivalent to calling pos().
void preferredHighlightBeginChanged()
virtual void viewportMoved()
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
void trackedPositionChanged()
void moveCurrentIndexLeft()
The Flow item arranges its children side by side, wrapping as necessary.
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
const Key key(const T &value) const
Returns the first key mapped to value.
qreal x() const
This convenience function is equivalent to calling pos().
void setView(QDeclarativeGridView *view)
virtual void componentComplete()
void currentIndexChanged()
bool fixCurrentVisibility
QDeclarativeComponent * delegate() const
void preferredHighlightEndChanged()
void updateUnrequestedIndexes()
void moveCurrentIndexUp()
void resetPreferredHighlightEnd()
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
QDeclarativeComponent * footerComponent
void setPreferredHighlightEnd(qreal)
T qvariant_cast(const QVariant &)
virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
The QDeclarativeContext class defines a context within a QML engine.
void setModel(const QVariant &)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
void moveCurrentIndexRight()
void layoutDirectionChanged()
The QDeclarativeProperty class abstracts accessing properties on objects created from QML...
virtual qreal maxXExtent() const
Q_INVOKABLE void positionViewAtBeginning()
int count(const Key &key) const
Returns the number of items associated with the key.
virtual void setContentX(qreal pos)
int highlightMoveDuration() const
qreal preferredHighlightBegin() const
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
void setHighlightMoveDuration(int)
void itemsInserted(int index, int count)
QSmoothedAnimation * highlightYAnimator
virtual qreal maxYExtent() const
virtual void setContentX(qreal pos)
bool contains(qreal x, qreal y) const
SnapMode snapMode() const
qreal preferredHighlightEnd() const
void resetPreferredHighlightBegin()
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)
static const KeyPair *const end
virtual qreal maxXExtent() const
bool highlightRangeEndValid
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
QList< FxGridItem * > visibleItems
virtual void keyPressEvent(QKeyEvent *)
QDeclarativeGridView::Flow flow
void setPosition(qreal pos)
Q_INVOKABLE void positionViewAtEnd()
bool highlightRangeStartValid
virtual void setContentY(qreal pos)
qreal snapPosAt(qreal pos) const
virtual qreal minXExtent() const
Q_DECL_CONSTEXPR int qRound(qreal d)
void checkVisible() const
QSmoothedAnimation * highlightXAnimator
void keyNavigationWrapsChanged()
QDeclarativeItem * createComponentItem(QDeclarativeComponent *component)
int lastVisibleIndex() const
QDeclarativeContext * creationContext() const
Returns the QDeclarativeContext the component was created in.
void setPreferredHighlightBegin(qreal)
The QList class is a template class that provides lists.
void keyPressPreHandler(QKeyEvent *)
QHash< QDeclarativeItem *, int > unrequestedItems