8#include <private/qqmlobjectmodel_p.h>
9#include <QtQml/qqmlexpression.h>
10#include <QtQml/qqmlengine.h>
11#include <QtQml/qqmlinfo.h>
12#include <QtGui/qevent.h>
13#include <QtCore/qcoreapplication.h>
14#include <QtCore/qmath.h>
16#include <private/qquicksmoothedanimation_p_p.h>
17#include <private/qqmlcomponent_p.h>
21#ifndef QML_FLICK_SNAPONETHRESHOLD
22#define QML_FLICK_SNAPONETHRESHOLD 30
36 bool isContentFlowReversed()
const override;
37 bool isRightToLeft()
const;
38 bool isBottomToTop()
const;
42 qreal originPosition()
const override;
43 qreal lastPosition()
const override;
46 QString sectionAt(
int modelIndex);
51 void clear(
bool onDestruction)
override;
53 bool addVisibleItems(
qreal fillFrom,
qreal fillTo,
qreal bufferFrom,
qreal bufferTo,
bool doBuffer)
override;
54 bool removeNonVisibleItems(
qreal bufferFrom,
qreal bufferTo)
override;
55 void visibleItemsChanged()
override;
64 void resetFirstItemPosition(
qreal pos = 0.0)
override;
65 void adjustFirstItem(
qreal forwards,
qreal backwards,
int)
override;
66 void updateSizeChangesBeforeVisiblePos(
FxViewItem *
item, ChangeResult *removeResult)
override;
68 void createHighlight(
bool onDestruction =
false)
override;
69 void updateHighlight()
override;
70 void resetHighlightPosition()
override;
71 bool movingFromHighlight()
override;
74 void layoutVisibleItems(
int fromModelIndex = 0)
override;
76 bool applyInsertionChange(
const QQmlChangeSet::Change &
insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView)
override;
77#if QT_CONFIG(quick_viewtransitions)
78 void translateAndTransitionItemsAfter(
int afterIndex,
const ChangeResult &insertionResult,
const ChangeResult &removalResult)
override;
81 void updateSectionCriteria()
override;
82 void updateSections()
override;
85 void releaseSectionItems();
87 void updateCurrentSection();
88 void updateStickySections();
91 qreal footerSize()
const override;
92 bool showHeaderForIndex(
int index)
const override;
93 bool showFooterForIndex(
int index)
const override;
94 void updateHeader()
override;
95 void updateFooter()
override;
96 bool hasStickyHeader()
const override;
97 bool hasStickyFooter()
const override;
101 void changedVisibleIndex(
int newIndex)
override;
102 void initializeCurrentItem()
override;
104 void updateAverage();
107 void fixupPosition()
override;
108 void fixup(AxisData &
data,
qreal minExtent,
qreal maxExtent)
override;
115 void fixupHeaderCompleted();
137 static const int sectionCacheSize = 5;
160 , averageSize(100.0),
spacing(0.0)
165 , highlightMoveVelocity(400), highlightResizeVelocity(400), highlightResizeDuration(-1)
167 , overshootDist(0.0), desiredViewportPosition(0.0), fixupHeaderPosition(0.0)
168 , headerNeedsSeparateFixup(
false), desiredHeaderVisible(
false)
169 , correctFlick(
false), inFlickCorrection(
false), wantedMousePress(
false)
171 highlightMoveDuration = -1;
228 if (m_labelPositioning != l) {
229 m_labelPositioning = l;
308 moveTo(pointForPosition(
pos, resetInactiveAxis), immediate);
383 if (rem.start() <=
index) {
385 if (
index < rem.start() + rem.count)
391 if (ins.start() <=
index)
460 if (
item->index != -1)
461 lastIndex =
item->index;
462 if (
item->index == modelIndex)
466 if (lastIndex == modelIndex-1)
476 q->QQuickFlickable::setContentY(-
pos-
size());
478 q->QQuickFlickable::setContentY(
pos);
481 q->QQuickFlickable::setContentX(-
pos-
size());
483 q->QQuickFlickable::setContentX(
pos);
502 int invisibleCount = INT_MIN;
503 int delayRemovedCount = 0;
506 if (
item->index != -1) {
508 invisibleCount =
model->
count() - (
item->index + 1 + delayRemovedCount);
510 }
else if (
item->attached->delayRemove()) {
514 if (invisibleCount == INT_MIN) {
519 if (invisibleCount > 0)
530 return item->position();
552 return item->endPosition();
568 return item->attached->section();
582 return snapItem->itemPosition();
586 if (
pos < firstPos) {
588 }
else if (
pos > endPos)
599 qreal prevItemSize = 0;
601 if (
item->index == -1)
606 qreal itemSize = listItem->size();
610 if (listItem->section() && velocity > 0) {
611 if (itemTop + listItem->sectionSize() / 2 >=
pos && itemTop - prevItemSize / 2 <
pos)
613 itemTop = listItem->itemPosition();
614 itemSize = listItem->itemSize();
618 qreal halfwayToNextItem = itemTop + (itemSize+
spacing) / 2;
619 qreal halfwayToPrevItem = itemTop - (prevItemSize+
spacing) / 2;
620 if (halfwayToNextItem >=
pos && halfwayToPrevItem <
pos)
623 prevItemSize = listItem->itemSize();
661 listItem->index = modelIndex;
669 if (modelIndex > 0) {
671 prevSection =
item->attached->section();
675 if (modelIndex < model->
count()-1) {
678 listItem->attached->setSections(prevSection, section,
nextSection);
689 item->trackGeometry(
true);
702 QPointer<QQuickItem>
it =
item->item;
736 bool haveValidItems = modelIndex >= 0;
737 modelIndex = modelIndex < 0 ?
visibleIndex : modelIndex + 1;
745 count = newModelIdx - modelIndex;
748 modelIndex = newModelIdx;
757 bool changed =
false;
760 while (modelIndex < model->
count() &&
pos <= fillTo) {
763 qCDebug(lcItemViewDelegateLifecycle) <<
"refill: append item" << modelIndex <<
"pos" <<
pos <<
"buffer" << doBuffer <<
"item" << (
QObject *)(
item->item);
764#if QT_CONFIG(quick_viewtransitions)
785#if QT_CONFIG(quick_viewtransitions)
800#if QT_CONFIG(quick_viewtransitions)
801 if (
item->transitionScheduledOrRunning()) {
802 qCDebug(lcItemViewDelegateLifecycle) <<
"\tnot releasing animating item" <<
item->index << (
QObject *)(
item->item);
803 item->releaseAfterTransition =
true;
804 releasePendingTransition.append(
item);
808 qCDebug(lcItemViewDelegateLifecycle) <<
"\treleasing stationary item" <<
item->index << (
QObject *)(
item->item);
816 bool changed =
false;
825 if (
item->attached->delayRemove())
828 if (
item->size() > 0) {
829 qCDebug(lcItemViewDelegateLifecycle) <<
"refill: remove first" <<
visibleIndex <<
"top end pos" <<
item->endPosition();
832 if (
item->index != -1)
847 if (
item->attached->delayRemove())
881#if QT_CONFIG(quick_viewtransitions)
900 if (
item->index >= fromModelIndex) {
955 qreal diff = forwards - backwards;
967 bool changed =
false;
990 std::unique_ptr<FxListItemSG> newHighlight
991 = std::make_unique<FxListItemSG>(
item,
q,
true);
992 newHighlight->trackGeometry(
true);
1019 emit q->highlightItemChanged();
1034 : listItem->itemPosition();
1086 const bool reuseExistingContext = delegate->
isBound();
1091 auto baseContext = creationContext ? creationContext :
qmlContext(
q);
1096 if (delegatePriv->hadTopLevelRequiredProperties()) {
1098 }
else if (!reuseExistingContext) {
1101 if (!reuseExistingContext)
1108 sectionItem->setZ(2);
1115 }
else if (!reuseExistingContext) {
1151 if (listItem->section()) {
1154 listItem->setSection(
nullptr);
1155 listItem->setPosition(
pos);
1171 if (!listItem->section()) {
1173 listItem->setSection(
getSectionItem(listItem->attached->m_section));
1174 listItem->setPosition(
pos);
1179 }
else if (listItem->section()) {
1182 listItem->setSection(
nullptr);
1183 listItem->setPosition(
pos);
1209 visTop = isFlowReversed ? -sectionPos-sectionSize >= startPos : sectionPos >= startPos;
1212 visBot = isFlowReversed ? -sectionPos <= endPos : sectionPos + sectionSize < endPos;
1213 section->setVisible(visBot && visTop);
1214 if (visTop && !sectionItem)
1215 sectionItem = section;
1216 if (isFlowReversed) {
1217 if (-sectionPos <= endPos)
1218 lastSectionItem = section;
1220 if (sectionPos + sectionSize < endPos)
1221 lastSectionItem = section;
1248 pos = isFlowReversed ?
qMax(
pos, sectionPos + sectionSize) :
qMin(
pos, sectionPos - sectionSize);
1278 if (lastSectionItem) {
1280 pos = isFlowReversed ?
qMin(
pos, sectionPos - sectionSize) :
qMax(
pos, sectionPos + sectionSize);
1297 if (!
q->isComponentComplete())
1312 if (
item->index != -1) {
1319 prevAtt->setNextSection(
sectionAt(prevIdx+1));
1320 prevSection = attached->
section();
1322 prevIdx =
item->index;
1325 if (idx > 0 && idx < model->
count()-1)
1326 prevAtt->setNextSection(
sectionAt(idx+1));
1328 prevAtt->setNextSection(
QString());
1341 emit q->currentSectionChanged();
1352 if (
item->endPosition() > startPos)
1354 if (
item->index != -1)
1355 modelIndex =
item->index;
1367 emit q->currentSectionChanged();
1381 if (listItem->itemPosition() >= endPos)
1383 if (listItem->index != -1)
1384 modelIndex = listItem->
index;
1385 lastSection = listItem->attached->section();
1394 if (section != lastSection) {
1462 bool created =
false;
1481 listItem->setPosition(
qBound(viewPos -
footerSize(), clampedPos, viewPos),
false,
false);
1485 listItem->setPosition(endPos,
false,
false);
1488 if (endPos <= visiblePos || listItem->
position() < endPos)
1489 listItem->setPosition(endPos,
false,
false);
1493 listItem->setPosition(
visiblePos,
false,
false);
1497 emit q->footerItemChanged();
1521 listItem->setPosition(
qBound(viewPos -
headerSize(), clampedPos, viewPos));
1528 bool created =
false;
1544 qreal headerPosition = listItem->position();
1552 listItem->setPosition(
qBound(viewPos -
headerSize(), clampedPos, viewPos),
false,
false);
1556 listItem->setPosition(startPos -
headerSize(),
false,
false);
1559 listItem->setPosition(startPos -
headerSize(),
false,
false);
1563 listItem->setPosition(-
headerSize(),
false,
false);
1567 emit q->headerItemChanged();
1583 qmlAttachedPropertiesObject<QQuickListView>(
item));
1589 const QRectF &oldGeometry)
1594 if (!
q->isComponentComplete())
1614#if QT_CONFIG(quick_viewtransitions)
1615 if (listItem->transitionScheduledOrRunning())
1622 listItem->setPosition(listItem->position() - heightDiff,
true);
1624 listItem->setPosition(listItem->position() + heightDiff,
true);
1626 const qreal oldItemEndPosition =
q->effectiveLayoutDirection() ==
Qt::RightToLeft ? -oldGeometry.
x() : oldGeometry.
x() + oldGeometry.
width();
1628 if (
q->effectiveLayoutDirection() ==
Qt::LeftToRight && oldItemEndPosition <
q->contentX())
1629 listItem->setPosition(listItem->position() - widthDiff,
true);
1630 else if (
q->effectiveLayoutDirection() ==
Qt::RightToLeft && oldItemEndPosition >
q->contentX())
1631 listItem->setPosition(listItem->position() + widthDiff,
true);
1677 else if (
data.velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -
averageSize/2)
1681 tempPosition -=
bias;
1684 qreal snapOffset = 0;
1685 qreal overlayHeaderOffset = 0;
1686 bool isHeaderWithinBounds =
false;
1689 isHeaderWithinBounds = visiblePartOfHeader > 0;
1731 if (
header && !topItem && isInBounds) {
1744 }
else if (topItem && (isInBounds || strictHighlightRange)) {
1800 }
else if (bottomItem && isInBounds) {
1819 data.fixingUp =
true;
1833 viewPos = -viewPos-
size();
1842 data.fixingUp =
true;
1851 data.inOvershoot =
false;
1858 data.fixingUp =
false;
1864 qreal maxDistance = 0;
1865 const qreal dataValue =
1877 maxDistance =
qAbs(
data.flickTarget -
data.move.value());
1894 maxDistance =
qAbs(
data.flickTarget -
data.move.value());
1904 if (maxDistance > 0 || overShoot) {
1923 if (maxDistance > 0)
1945 qreal adjv2 = accel * 2.0f *
qAbs(adjDist);
1955 }
else if (overShoot) {
1978 if (velocity < 0 && newtarget <=
maxExtent)
1980 else if (velocity > 0 && newtarget >=
minExtent)
1982 if (newtarget ==
data.flickTarget) {
1987 data.flickTarget = newtarget;
1989 if ((
v < 0 &&
dist < 0) || (
v > 0 &&
dist > 0)) {
2013 sectionItem->setProperty(
"section", section);
2528 if (
d->autoHighlight != autoHighlight) {
2529 if (!autoHighlight) {
2530 if (
d->highlightPosAnimator)
2531 d->highlightPosAnimator->stop();
2532 if (
d->highlightWidthAnimator)
2533 d->highlightWidthAnimator->stop();
2534 if (
d->highlightHeightAnimator)
2535 d->highlightHeightAnimator->stop();
2559 d->forceLayoutPolish();
2605 d->regenerate(
true);
2809 if (!
d->sectionCriteria)
2811 return d->sectionCriteria;
2821 return d->currentSection;
2863 return d->highlightMoveVelocity;
2869 if (
d->highlightMoveVelocity != speed) {
2870 d->highlightMoveVelocity = speed;
2871 if (
d->highlightPosAnimator)
2872 d->highlightPosAnimator->velocity =
d->highlightMoveVelocity;
2880 if (
d->highlightMoveDuration != duration) {
2881 if (
d->highlightPosAnimator)
2882 d->highlightPosAnimator->userDuration = duration;
2890 return d->highlightResizeVelocity;
2896 if (
d->highlightResizeVelocity != speed) {
2897 d->highlightResizeVelocity = speed;
2898 if (
d->highlightWidthAnimator)
2899 d->highlightWidthAnimator->velocity =
d->highlightResizeVelocity;
2900 if (
d->highlightHeightAnimator)
2901 d->highlightHeightAnimator->velocity =
d->highlightResizeVelocity;
2909 return d->highlightResizeDuration;
2915 if (
d->highlightResizeDuration != duration) {
2916 d->highlightResizeDuration = duration;
2917 if (
d->highlightWidthAnimator)
2918 d->highlightWidthAnimator->userDuration =
d->highlightResizeDuration;
2919 if (
d->highlightHeightAnimator)
2920 d->highlightHeightAnimator->userDuration =
d->highlightResizeDuration;
2955 if (
d->snapMode !=
mode) {
3037 return d->headerPositioning;
3043 if (
d->headerPositioning != positioning) {
3044 d->applyPendingChanges();
3045 d->headerPositioning = positioning;
3048 d->updateViewport();
3051 emit headerPositioningChanged();
3084 return d->footerPositioning;
3090 if (
d->footerPositioning != positioning) {
3091 d->applyPendingChanges();
3092 d->footerPositioning = positioning;
3095 d->updateViewport();
3098 emit footerPositioningChanged();
3409 if (!
d->itemCount) {
3410 if (
d->hasStickyHeader())
3412 if (
d->hasStickyFooter())
3418 if (
d->inViewportMoved)
3420 d->inViewportMoved =
true;
3423 if (
d->isBottomToTop())
3428 if (
d->isRightToLeft())
3434 d->refillOrLayout();
3437 qreal from =
d->isContentFlowReversed() ? -
d->position()-
d->displayMarginBeginning-
d->size() :
d->position()-
d->displayMarginBeginning;
3438 qreal to =
d->isContentFlowReversed() ? -
d->position()+
d->displayMarginEnd :
d->position()+
d->size()+
d->displayMarginEnd;
3444 QQuickItemPrivate::get(
d->currentItem->item)->setCulled(
d->currentItem->endPosition() < from ||
d->currentItem->position() > to);
3446 if (
d->hData.flicking ||
d->vData.flicking ||
d->hData.moving ||
d->vData.moving)
3452 qreal viewPos =
d->isContentFlowReversed() ? -
d->position()-
d->size() :
d->position();
3453 if (
pos > viewPos +
d->highlightRangeEnd -
d->highlight->size())
3454 pos = viewPos +
d->highlightRangeEnd -
d->highlight->size();
3455 if (pos < viewPos + d->highlightRangeStart)
3456 pos = viewPos +
d->highlightRangeStart;
3457 if (
pos !=
d->highlight->position()) {
3458 d->highlightPosAnimator->stop();
3461 d->updateHighlight();
3465 if (
FxViewItem *snapItem =
d->snapItemAt(
d->highlight->position())) {
3466 if (snapItem->index >= 0 && snapItem->index !=
d->currentIndex)
3467 d->updateCurrent(snapItem->index);
3472 if ((
d->hData.flicking ||
d->vData.flicking) &&
d->correctFlick && !
d->inFlickCorrection) {
3473 d->inFlickCorrection =
true;
3476 if (
yflick() && !
d->vData.inOvershoot) {
3477 if (
d->vData.velocity > 0) {
3479 if ((
minY -
d->vData.move.value() <
height()/2 ||
d->vData.flickTarget -
d->vData.move.value() <
height()/2)
3480 &&
minY !=
d->vData.flickTarget)
3482 }
else if (
d->vData.velocity < 0) {
3484 if ((
d->vData.move.value() -
maxY <
height()/2 ||
d->vData.move.value() -
d->vData.flickTarget <
height()/2)
3485 &&
maxY !=
d->vData.flickTarget)
3490 if (
xflick() && !
d->hData.inOvershoot) {
3491 if (
d->hData.velocity > 0) {
3493 if ((minX -
d->hData.move.value() <
width()/2 ||
d->hData.flickTarget -
d->hData.move.value() <
width()/2)
3494 && minX !=
d->hData.flickTarget)
3496 }
else if (
d->hData.velocity < 0) {
3498 if ((
d->hData.move.value() -
maxX <
width()/2 ||
d->hData.move.value() -
d->hData.flickTarget <
width()/2)
3499 &&
maxX !=
d->hData.flickTarget)
3503 d->inFlickCorrection =
false;
3505 if (
d->hasStickyHeader())
3507 if (
d->hasStickyFooter())
3509 if (
d->sectionCriteria) {
3510 d->updateCurrentSection();
3511 d->updateStickySections();
3513 d->inViewportMoved =
false;
3519 if (
d->model &&
d->model->count() && ((
d->interactive && !
d->explicitKeyNavigationEnabled)
3520 || (
d->explicitKeyNavigationEnabled &&
d->keyNavigationEnabled))) {
3529 }
else if (
d->wrap) {
3541 }
else if (
d->wrap) {
3558 d->model->drainReusableItemsPool(0);
3561 if (
d->isRightToLeft()) {
3565 }
else if (
d->isBottomToTop()) {
3582 qmlAttachedPropertiesObject<QQuickListView>(
item));
3616 int count =
d->model ?
d->model->count() : 0;
3636 int count =
d->model ?
d->model->count() : 0;
3647 if (
q->isComponentComplete() &&
model) {
3648 QList<QByteArray> roles;
3661#if QT_CONFIG(quick_viewtransitions)
3664 int modelIndex = change.
index;
3690 if (
item->index != -1 &&
item->index >= modelIndex)
3707 if (
item->index != -1 &&
item->index >= modelIndex) {
3709#if QT_CONFIG(quick_viewtransitions)
3718 bool visibleAffected =
false;
3719 if (insertResult->visiblePos.isValid() &&
pos < insertResult->visiblePos) {
3721 int insertionIdx =
index;
3731 for (;
it.hasNext() &&
pos >= from;
it.next()) {
3740 if (
it.removedAtIndex)
3743 visibleAffected =
true;
3745 if (insertionIdx == 0)
3746 insertResult->changedFirstItem =
true;
3748 addedItems->append(
item);
3749#if QT_CONFIG(quick_viewtransitions)
3756 insertResult->sizeChangesBeforeVisiblePos +=
item->size() +
spacing;
3762 int firstOkIdx = -1;
3769 for (
int i = 0;
i < firstOkIdx;
i++) {
3771 addedItems->removeOne(nvItem);
3777 for (;
it.hasNext() &&
pos <= lastVisiblePos;
it.next()) {
3778 visibleAffected =
true;
3782#if QT_CONFIG(quick_viewtransitions)
3783 bool newItem = !
item;
3785 it.removedAtIndex =
false;
3790 if (
it.removedAtIndex) {
3797 insertResult->changedFirstItem =
true;
3801#if QT_CONFIG(quick_viewtransitions)
3806 addedItems->append(
item);
3807#if QT_CONFIG(quick_viewtransitions)
3814 insertResult->sizeChangesAfterVisiblePos +=
item->size() +
spacing;
3823 if (prevItem->index !=
item->index - 1) {
3825#if QT_CONFIG(quick_viewtransitions)
3830 insertResult->sizeChangesAfterVisiblePos -= nvItem->
size() +
spacing;
3831 addedItems->removeOne(nvItem);
3832#if QT_CONFIG(quick_viewtransitions)
3833 if (nvItem->transitionScheduledOrRunning())
3834 nvItem->setPosition(prevPos + (nvItem->index - prevItem->index) *
averageSize);
3844 return visibleAffected;
3847#if QT_CONFIG(quick_viewtransitions)
3848void QQuickListViewPrivate::translateAndTransitionItemsAfter(
int afterModelIndex,
const ChangeResult &insertionResult,
const ChangeResult &removalResult)
3855 int markerItemIndex = -1;
3858 markerItemIndex =
i;
3862 if (markerItemIndex < 0)
3866 qreal sizeRemoved = -removalResult.sizeChangesAfterVisiblePos
3871 if (listItem->position() >= viewEndPos)
3873 if (!listItem->transitionScheduledOrRunning()) {
3875 listItem->setPosition(
pos - sizeRemoved);
3877 listItem->setPosition(
pos);
4004 QPointF pos =
event->points().first().position();
4005 if (!
pos.isNull()) {
4006 if (
auto header =
q->headerItem()) {
4011 if (
auto footer =
q->footerItem()) {
4018 switch (
event->type()) {
4035#include "moc_qquicklistview_p.cpp"
DarwinBluetooth::DeviceInquiryDelegate * m_delegate
bool contains(qreal x, qreal y) const override
FxListItemSG(QQuickItem *i, QQuickListView *v, bool own)
qreal itemPosition() const
QQuickItem * section() const
qreal position() const override
qreal endPosition() const override
qreal size() const override
qreal sectionSize() const override
void setSection(QQuickItem *s)
void setPosition(qreal pos, bool immediate=false, bool resetInactiveAxis=true)
QQuickItemViewAttached * attached
MutableModelIterator(QQmlInstanceModel *model, int iBegin, int iEnd)
Type
This enum type defines the valid event types in Qt.
qreal y() const
This convenience function is equivalent to calling pos().y().
qreal x() const
This convenience function is equivalent to calling pos().x().
void setVisible(bool visible)
If visible is true, the item is made visible.
The QKeyEvent class describes a key event.
qsizetype size() const noexcept
bool isEmpty() const noexcept
void removeAt(qsizetype i)
const T & constLast() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
const_iterator constBegin() const noexcept
void prepend(rvalue_ref t)
const T & constFirst() const noexcept
void removeLast() noexcept
void append(parameter_type t)
const_iterator constEnd() const noexcept
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
\inmodule QtCore\reentrant
A base class for pointer events.
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
const QVector< Change > & removes() const
const QVector< Change > & inserts() const
static QQmlComponentPrivate * get(QQmlComponent *c)
The QQmlComponent class encapsulates a QML component definition.
bool isBound() const
Returns true if the component was created in a QML files that specifies {pragma ComponentBehavior: Bo...
virtual QObject * beginCreate(QQmlContext *)
Create an object instance from this component, within the specified context.
virtual void completeCreate()
This method provides advanced control over component instance creation.
QQmlContext * creationContext() const
Returns the QQmlContext the component was created in.
void setInitialProperties(QObject *component, const QVariantMap &properties)
Set top-level properties of the component.
static QQmlRefPointer< QQmlContextData > get(QQmlContext *context)
The QQmlContext class defines a context within a QML engine.
static QQmlContext * contextForObject(const QObject *)
Returns the QQmlContext for the object, or nullptr if no context has been set.
IncubationMode
Specifies the mode the incubator operates in.
virtual void setWatchedRoles(const QList< QByteArray > &roles)=0
void modelUpdated(const QQmlChangeSet &changeSet, bool reset)
QString stringValue(int index, const QString &role)
The QQmlProperty class abstracts accessing properties on objects created from QML.
virtual bool flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QQuickTimeLineCallback::Callback fixupCallback, QEvent::Type eventType, qreal velocity)
MovementReason moveReason
qreal overShootDistance(qreal velocity) const
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)
QQuickFlickable::FlickableDirection flickableDirection
QQuickFlickable::BoundsBehavior boundsBehavior
void setContentWidth(qreal)
virtual void viewportMoved(Qt::Orientations orient)
void setFlickableDirection(FlickableDirection)
virtual qreal maxXExtent() const
virtual qreal maxYExtent() const
void setContentHeight(qreal)
bool heightChange() const
static QQuickItemPrivate * get(QQuickItem *item)
void setView(QQuickItemView *view)
void setSection(const QString §)
void setPrevSection(const QString §)
QMultiHash< QQmlChangeSet::MoveKey, FxViewItem * > removedItems
QPointer< QQuickItem > item
virtual qreal position() const =0
void setVisible(bool visible)
virtual qreal endPosition() const =0
void moveTo(const QPointF &pos, bool immediate)
virtual qreal size() const =0
void trackGeometry(bool track)
virtual bool contains(qreal x, qreal y) const =0
int findLastVisibleIndex(int defaultValue=-1) const
virtual void initializeCurrentItem()
qreal highlightRangeStart
FxViewItem * visibleItem(int modelIndex) const
int highlightMoveDuration
virtual void clear(bool onDestruction=false)
QQuickItem * createHighlightItem() const
QPointer< QQmlInstanceModel > model
QList< FxViewItem * > visibleItems
int displayMarginBeginning
virtual void initializeViewItem(FxViewItem *)
virtual void updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult)
virtual void updateSections()
QQmlComponent * footerComponent
qreal firstVisibleItemPosition
QQuickItemViewChangeSet currentChanges
void updateUnrequestedPositions()
void applyPendingChanges()
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override
QQuickItemView::VerticalLayoutDirection verticalLayoutDirection
int mapFromModel(int modelIndex) const
void updateVisibleIndex()
QQuickItem * createComponentItem(QQmlComponent *component, qreal zValue, bool createDefault=false) const
void releaseVisibleItems(QQmlInstanceModel::ReusableFlag reusableFlag)
FxViewItem * createItem(int modelIndex, QQmlIncubator::IncubationMode incubationMode=QQmlIncubator::AsynchronousIfNested)
QQmlComponent * headerComponent
qreal startPosition() const
virtual bool releaseItem(FxViewItem *item, QQmlInstanceModel::ReusableFlag reusableFlag)
QQmlInstanceModel::ReusableFlag reusableFlag
std::unique_ptr< FxViewItem > highlight
virtual void setHighlightFollowsCurrentItem(bool)
qreal maxYExtent() const override
qreal maxXExtent() const override
qreal minYExtent() const override
void setContentX(qreal pos) override
Qt::LayoutDirection effectiveLayoutDirection
void setContentY(qreal pos) override
virtual void initItem(int index, QObject *item)
virtual void setHighlightMoveDuration(int)
void setCurrentIndex(int idx)
VerticalLayoutDirection verticalLayoutDirection
qreal minXExtent() const override
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
virtual void keyPressEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key press events for an item.
qreal x
\qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item...
qreal y
Defines the item's y position relative to its parent.
qreal width
This property holds the width of this item.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
qreal height
This property holds the height of this item.
QPointer< QQuickItem > m_sectionItem
void releaseSectionItem(QQuickItem *item)
void createHighlight(bool onDestruction=false) override
void visibleItemsChanged() override
bool hasStickyHeader() const override
static void setSectionHelper(QQmlContext *context, QQuickItem *sectionItem, const QString §ion)
FxViewItem * snapItemAt(qreal pos)
QQuickListView::Orientation orient
void updateInlineSection(FxListItemSG *)
void updateSections() override
bool headerNeedsSeparateFixup
qreal originPosition() const override
QQuickListView::FooterPositioning footerPositioning
void fixupPosition() override
QString sectionAt(int modelIndex)
void updateSectionCriteria() override
qreal snapPosAt(qreal pos)
void initializeComponentItem(QQuickItem *item) const override
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) override
void updateHeader() override
void layoutVisibleItems(int fromModelIndex=0) override
static const int sectionCacheSize
qreal desiredViewportPosition
void fixupHeaderCompleted()
qreal endPositionAt(int index) const override
QString nextStickySection
void updateHighlight() override
void setPosition(qreal pos) override
qreal lastPosition() const override
bool addVisibleItems(qreal fillFrom, qreal fillTo, qreal bufferFrom, qreal bufferTo, bool doBuffer) override
void adjustFirstItem(qreal forwards, qreal backwards, int) override
QQuickItem * currentSectionItem
void repositionPackageItemAt(QQuickItem *item, int index) override
void fixup(AxisData &data, qreal minExtent, qreal maxExtent) override
bool applyInsertionChange(const QQmlChangeSet::Change &insert, ChangeResult *changeResult, QList< FxViewItem * > *addedItems, QList< MovedItem > *movingIntoView) override
void changedVisibleIndex(int newIndex) override
QQuickViewSection * sectionCriteria
bool releaseItem(FxViewItem *item, QQmlInstanceModel::ReusableFlag reusableFlag) override
bool showFooterForIndex(int index) const override
FxViewItem * newViewItem(int index, QQuickItem *item) override
void resetHighlightPosition() override
qreal footerSize() const override
bool desiredHeaderVisible
QString lastVisibleSection
bool wantsPointerEvent(const QPointerEvent *event) override
Qt::Orientation layoutOrientation() const override
void repositionItemAt(FxViewItem *item, int index, qreal sizeBuffer) override
bool isRightToLeft() const
bool showHeaderForIndex(int index) const override
void initializeCurrentItem() override
std::unique_ptr< QSmoothedAnimation > highlightHeightAnimator
QQuickListView::HeaderPositioning headerPositioning
qreal fixupHeaderPosition
void updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult) override
void initializeViewItem(FxViewItem *item) override
bool hasStickyFooter() const override
int highlightResizeDuration
qreal positionAt(int index) const override
bool flick(QQuickItemViewPrivate::AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QQuickTimeLineCallback::Callback fixupCallback, QEvent::Type eventType, qreal velocity) override
qreal highlightResizeVelocity
void updateCurrentSection()
void updateStickySections()
std::unique_ptr< QSmoothedAnimation > highlightWidthAnimator
QString currentStickySection
void updateFooter() override
FxViewItem * itemBefore(int modelIndex) const
QQuickItem * nextSectionItem
QQuickItem * sectionCache[sectionCacheSize]
void releaseSectionItems()
QQuickItemViewAttached * getAttachedObject(const QObject *object) const override
bool movingFromHighlight() override
void resetFirstItemPosition(qreal pos=0.0) override
bool isBottomToTop() const
bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) override
qreal highlightMoveVelocity
QQuickItem * getSectionItem(const QString §ion)
void removeItem(FxViewItem *item)
bool isContentFlowReversed() const override
QQuickListView::SnapMode snapMode
qreal headerSize() const override
std::unique_ptr< QSmoothedAnimation > highlightPosAnimator
void clear(bool onDestruction) override
void setOrientation(Orientation)
int highlightResizeDuration
QQuickListView(QQuickItem *parent=nullptr)
\qmltype ListView \instantiates QQuickListView \inqmlmodule QtQuick\inherits Flickable
void viewportMoved(Qt::Orientations orient) override
\qmlproperty Transition QtQuick::ListView::populate
void highlightMoveVelocityChanged()
void setHighlightMoveDuration(int) override
void highlightResizeDurationChanged()
void orientationChanged()
FooterPositioning footerPositioning
qreal highlightResizeVelocity
void initItem(int index, QObject *item) override
void keyPressEvent(QKeyEvent *) override
This event handler can be reimplemented in a subclass to receive key press events for an item.
void setFooterPositioning(FooterPositioning positioning)
void setHighlightResizeDuration(int)
void setSnapMode(SnapMode mode)
void setSpacing(qreal spacing)
qreal maxYExtent() const override
void highlightResizeVelocityChanged()
qreal maxXExtent() const override
void incrementCurrentIndex()
\qmlmethod QtQuick::ListView::incrementCurrentIndex()
void setHighlightResizeVelocity(qreal)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setHighlightFollowsCurrentItem(bool) override
\qmlattachedproperty bool QtQuick::ListView::isCurrentItem \readonly
HeaderPositioning headerPositioning
void decrementCurrentIndex()
\qmlmethod QtQuick::ListView::decrementCurrentIndex()
void setHeaderPositioning(HeaderPositioning positioning)
static QQuickListViewAttached * qmlAttachedProperties(QObject *)
\qmlmethod QtQuick::ListView::positionViewAtIndex(int index, PositionMode mode)
void setHighlightMoveVelocity(qreal)
QQuickViewSection * sectionCriteria()
\qmlproperty enumeration QtQuick::ListView::layoutDirection This property holds the layout direction ...
qreal highlightMoveVelocity
void reset(QQuickTimeLineValue &)
Cancel (but don't complete) all scheduled actions for timeLineValue.
int accel(QQuickTimeLineValue &, qreal velocity, qreal accel)
Decelerate timeLineValue from the starting velocity to zero at the given acceleration rate.
void callback(const QQuickTimeLineCallback &)
Execute the event.
int accelDistance(QQuickTimeLineValue &, qreal velocity, qreal distance)
Decelerate timeLineValue from the starting velocity to zero over the given distance.
void set(QQuickTimeLineValue &, qreal)
Set the value of timeLineValue.
void move(QQuickTimeLineValue &, qreal destination, int time=500)
Linearly change the timeLineValue from its current value to the given destination value over time mil...
void updated()
Emitted each time the timeline modifies QQuickTimeLineValues.
int duration() const override
void setDelegate(QQmlComponent *delegate)
QQuickViewSection(QQuickListView *parent=nullptr)
void labelPositioningChanged()
void setProperty(const QString &)
QString sectionString(const QString &value)
void setCriteria(SectionCriteria)
void setLabelPositioning(int pos)
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
void clear()
Clears the contents of the string and makes it null.
QString section(QChar sep, qsizetype start, qsizetype end=-1, SectionFlags flags=SectionDefault) const
This function returns a section of the string.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QByteArray toUtf8() const &
cache insert(employee->id(), employee)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
static const qint64 headerSize
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
qfloat16 qSqrt(qfloat16 f)
int qRound(qfloat16 d) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
n void setPosition(void) \n\
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLfloat GLfloat GLfloat GLfloat GLfloat maxY
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat maxX
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
QObject * qmlAttachedPropertiesObject(QObject *object, QQmlAttachedPropertiesFunc func, bool create)
void QQml_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QQuickItem * qmlobject_cast< QQuickItem * >(QObject *object)
static QQuickAttachedPropertyPropagator * attachedObject(const QMetaObject *type, QObject *object, bool create=false)
const qreal _q_MinimumFlickVelocity
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
#define QML_FLICK_SNAPONETHRESHOLD
static qreal positionAt(const QQuickRangeSlider *slider, QQuickItem *handle, const QPointF &point)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QSqlQueryModel * model
[16]
std::uniform_real_distribution dist(1, 2.5)
[2]
MoveKey moveKey(int index) const