10#include <QtGui/qstylehints.h>
11#include <QtGui/private/qguiapplication_p.h>
12#include <QtGui/private/qeventpoint_p.h>
13#include <QtGui/qpa/qplatformtheme.h>
14#include <QtQml/qqmlinfo.h>
15#include <QtQuick/private/qquickanimation_p.h>
16#include <QtQuick/private/qquicktransition_p.h>
17#include <QtQuick/private/qquicktransitionmanager_p_p.h>
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
92 void transition(QQuickTransition *transition, qreal position);
98 QQuickSwipe *m_swipe =
nullptr;
103 Q_DECLARE_PUBLIC(QQuickSwipe)
159 qmlExecuteDeferred(transition);
161 QQmlProperty defaultTarget(m_swipe, QLatin1String(
"position"));
162 QQmlListProperty<QQuickAbstractAnimation> animations = transition->animations();
163 const int count = animations.count(&animations);
164 for (
int i = 0; i < count; ++i) {
165 QQuickAbstractAnimation *anim = animations.at(&animations, i);
166 anim->setDefaultTarget(defaultTarget);
169 QList<QQuickStateAction> actions;
170 actions << QQuickStateAction(m_swipe, QLatin1String(
"position"), position);
171 QQuickTransitionManager::transition(actions, transition, m_swipe);
176 QQuickSwipePrivate::get(m_swipe)->finishTransition();
181 return swipe->d_func();
188 QQmlContext *context = component->creationContext();
192 context = qmlContext(control);
193 QQuickItem *item = qobject_cast<QQuickItem*>(component->beginCreate(context));
195 item->setParentItem(control);
196 component->completeCreate();
197 QJSEngine::setObjectOwnership(item, QJSEngine::JavaScriptOwnership);
204 if (qFuzzyIsNull(position))
212 if (right && position < 0.0) {
217 if (left && position > 0.0) {
227 if (qFuzzyIsNull(distance))
247 if ((distance < 0.0 && positionBeforePress == 0.0)
248 || (rightItem && positionBeforePress == -1.0 && distance < rightItem->width())
249 || (leftItem && positionBeforePress == 1.0 && qAbs(distance) > leftItem->width())) {
256 if ((distance > 0.0 && positionBeforePress == 0.0)
257 || (leftItem && positionBeforePress == 1.0 && qAbs(distance) < leftItem->width())
258 || (rightItem && positionBeforePress == -1.0 && qAbs(distance) > rightItem->width())) {
269 QQuickItem *relevantItem = showRelevantItemForPosition(position);
270 const qreal relevantWidth = relevantItem ? relevantItem->width() : 0.0;
271 const qreal contentItemX = position * relevantWidth + control->leftPadding();
276 if (QQuickItem *contentItem = control->contentItem())
277 contentItem->setProperty(
"x", contentItemX);
278 if (QQuickItem *background = control->background())
279 background->setProperty(
"x", position * relevantWidth);
281 if (QQuickItem *contentItem = control->contentItem())
282 contentItem->setX(contentItemX);
283 if (QQuickItem *background = control->background())
284 background->setX(position * relevantWidth);
292 q->setLeftItem(createDelegateItem(left));
294 qmlWarning(control) <<
"Failed to create left item:" << left->errors();
302 q->setBehindItem(createDelegateItem(behind));
304 qmlWarning(control) <<
"Failed to create behind item:" << behind->errors();
312 q->setRightItem(createDelegateItem(right));
314 qmlWarning(control) <<
"Failed to create right item:" << right->errors();
323 leftItem->setVisible(
true);
326 rightItem->setVisible(
false);
334 behindItem->setVisible(
true);
343 rightItem->setVisible(
true);
347 leftItem->setVisible(
false);
352 qmlWarning(control) <<
"cannot set both behind and left/right properties";
357 qmlWarning(control) <<
"left/right/behind properties may only be set when swipe.position is 0";
362 return left || right || behind;
367 return transitionManager && transitionManager->isRunning();
376 q->setPosition(newPosition);
381 if (!transitionManager)
382 transitionManager.reset(
new QQuickSwipeTransitionManager(q));
384 transitionManager->transition(transition, newPosition);
391 q->setComplete(qFuzzyCompare(qAbs(position), qreal(1.0)));
395 if (qFuzzyIsNull(position))
401QQuickSwipe::QQuickSwipe(QQuickSwipeDelegate *control)
402 : QObject(*(
new QQuickSwipePrivate(control)))
406QQmlComponent *QQuickSwipe::left()
const
408 Q_D(
const QQuickSwipe);
412void QQuickSwipe::setLeft(QQmlComponent *left)
419 d->warnAboutMixingDelegates();
423 if (!qFuzzyIsNull(d->position)) {
424 d->warnAboutSettingDelegatesWhileVisible();
432 d->leftItem =
nullptr;
435 d->control->setFiltersChildMouseEvents(d->hasDelegates());
440QQmlComponent *QQuickSwipe::behind()
const
442 Q_D(
const QQuickSwipe);
446void QQuickSwipe::setBehind(QQmlComponent *behind)
449 if (behind == d->behind)
452 if (d->left || d->right) {
453 d->warnAboutMixingDelegates();
457 if (!qFuzzyIsNull(d->position)) {
458 d->warnAboutSettingDelegatesWhileVisible();
465 delete d->behindItem;
466 d->behindItem =
nullptr;
469 d->control->setFiltersChildMouseEvents(d->hasDelegates());
471 emit behindChanged();
474QQmlComponent *QQuickSwipe::right()
const
476 Q_D(
const QQuickSwipe);
480void QQuickSwipe::setRight(QQmlComponent *right)
483 if (right == d->right)
487 d->warnAboutMixingDelegates();
491 if (!qFuzzyIsNull(d->position)) {
492 d->warnAboutSettingDelegatesWhileVisible();
500 d->rightItem =
nullptr;
503 d->control->setFiltersChildMouseEvents(d->hasDelegates());
508QQuickItem *QQuickSwipe::leftItem()
const
510 Q_D(
const QQuickSwipe);
514void QQuickSwipe::setLeftItem(QQuickItem *item)
517 if (item == d->leftItem)
524 d->leftItem->setParentItem(d->control);
526 if (qFuzzyIsNull(d->leftItem->z()))
527 d->leftItem->setZ(-2);
530 emit leftItemChanged();
533QQuickItem *QQuickSwipe::behindItem()
const
535 Q_D(
const QQuickSwipe);
536 return d->behindItem;
539void QQuickSwipe::setBehindItem(QQuickItem *item)
542 if (item == d->behindItem)
545 delete d->behindItem;
546 d->behindItem = item;
549 d->behindItem->setParentItem(d->control);
551 if (qFuzzyIsNull(d->behindItem->z()))
552 d->behindItem->setZ(-2);
555 emit behindItemChanged();
558QQuickItem *QQuickSwipe::rightItem()
const
560 Q_D(
const QQuickSwipe);
564void QQuickSwipe::setRightItem(QQuickItem *item)
567 if (item == d->rightItem)
574 d->rightItem->setParentItem(d->control);
576 if (qFuzzyIsNull(d->rightItem->z()))
577 d->rightItem->setZ(-2);
580 emit rightItemChanged();
583qreal QQuickSwipe::position()
const
585 Q_D(
const QQuickSwipe);
589void QQuickSwipe::setPosition(qreal position)
592 const qreal adjustedPosition = qBound<qreal>(-1.0, position, 1.0);
593 if (adjustedPosition == d->position)
596 d->position = adjustedPosition;
597 d->reposition(AnimatePosition);
598 emit positionChanged();
601bool QQuickSwipe::isComplete()
const
603 Q_D(
const QQuickSwipe);
607void QQuickSwipe::setComplete(
bool complete)
610 if (complete == d->complete)
613 d->complete = complete;
614 emit completeChanged();
619bool QQuickSwipe::isEnabled()
const
621 Q_D(
const QQuickSwipe);
625void QQuickSwipe::setEnabled(
bool enabled)
628 if (enabled == d->enabled)
631 d->enabled = enabled;
632 emit enabledChanged();
635QQuickTransition *QQuickSwipe::transition()
const
637 Q_D(
const QQuickSwipe);
638 return d->transition;
641void QQuickSwipe::setTransition(QQuickTransition *transition)
644 if (transition == d->transition)
647 d->transition = transition;
648 emit transitionChanged();
651void QQuickSwipe::open(QQuickSwipeDelegate::Side side)
654 if (qFuzzyCompare(qAbs(d->position), qreal(1.0)))
657 if ((side != QQuickSwipeDelegate::Left && side != QQuickSwipeDelegate::Right)
658 || (!d->left && !d->behind && side == QQuickSwipeDelegate::Left)
659 || (!d->right && !d->behind && side == QQuickSwipeDelegate::Right))
662 d->beginTransition(side);
663 d->wasComplete =
true;
664 d->velocityCalculator.reset();
665 d->positionBeforePress = d->position;
668void QQuickSwipe::close()
671 if (qFuzzyIsNull(d->position))
674 if (d->control->isPressed()) {
679 d->beginTransition(0.0);
680 d->waitForTransition =
true;
681 d->wasComplete =
false;
682 d->positionBeforePress = 0.0;
683 d->velocityCalculator.reset();
696 resizingBackground =
true;
698 QQuickItemPrivate *p = QQuickItemPrivate::get(background);
699 const bool extraAllocated = extra.isAllocated();
701 if (((!p->widthValid() || !extraAllocated || !extra->hasBackgroundWidth))
702 || (extraAllocated && (extra->hasLeftInset || extra->hasRightInset))) {
703 background->setWidth(width - getLeftInset() - getRightInset());
705 if (((!p->heightValid() || !extraAllocated || !extra->hasBackgroundHeight) && qFuzzyIsNull(background->y()))
706 || (extraAllocated && (extra->hasTopInset || extra->hasBottomInset))) {
707 background->setY(getTopInset());
708 background->setHeight(height - getTopInset() - getBottomInset());
711 resizingBackground =
false;
716 Q_Q(QQuickSwipeDelegate);
717 const auto posInItem = item->mapToItem(q, event->position().toPoint());
722 if (qFuzzyIsNull(swipePrivate->position)) {
723 q->mousePressEvent(event);
727 setPressPoint(posInItem);
733 if (swipePrivate->complete)
734 forwardMouseEvent(event, item, posInItem);
739 swipePrivate->positionBeforePress = swipePrivate->position;
740 swipePrivate->velocityCalculator.startMeasuring(event->position().toPoint(), event->timestamp());
741 setPressPoint(item->mapToItem(q, event->position().toPoint()));
745 const bool delivered = attachedObjectsSetPressed(item, event->scenePosition(),
true);
753 Q_Q(QQuickSwipeDelegate);
756 if (QLineF(pressPoint, event->position()).length() > QGuiApplication::styleHints()->startDragDistance())
771 if (!swipePrivate->left && !swipePrivate->right && !swipePrivate->behind)
774 if (item != q && swipePrivate->complete) {
777 const auto posInItem = item->mapToItem(q, event->position().toPoint());
778 forwardMouseEvent(event, item, posInItem);
782 if (item == q && !pressed)
785 const qreal distance = (event->globalPosition().x() != qInf() && event->globalPosition().y() != qInf()) ?
786 (item->mapFromGlobal(event->globalPosition()) -
787 item->mapFromGlobal(event->points().first().globalPressPosition())).x() : 0;
788 if (!q->keepMouseGrab()) {
792 const bool overThreshold = QQuickDeliveryAgentPrivate::dragOverThreshold(distance,
794 if (window && overThreshold) {
795 QQuickItem *grabber = q->window()->mouseGrabberItem();
796 if (!grabber || !grabber->keepMouseGrab()) {
798 q->setKeepMouseGrab(
true);
800 swipe.setComplete(
false);
802 attachedObjectsSetPressed(item, event->scenePosition(),
false,
true);
807 if (q->keepMouseGrab()) {
812 if (swipePrivate->behind
813 || ((swipePrivate->left || swipePrivate->right)
814 && (qFuzzyIsNull(swipePrivate->positionBeforePress)
815 || (swipePrivate->positionBeforePress == -1.0 && distance >= 0.0)
816 || (swipePrivate->positionBeforePress == 1.0 && distance <= 0.0)))) {
820 QQuickItem *relevantItem = swipePrivate->createRelevantItemForDistance(distance);
823 const qreal normalizedDistance = relevantItem ? distance / relevantItem->width() : 0.0;
831 if (qFuzzyIsNull(normalizedDistance)) {
844 position = qFuzzyIsNull(distance) ? swipePrivate->positionBeforePress : 0;
846 position = normalizedDistance;
848 position = distance > 0 ? normalizedDistance - 1.0 : normalizedDistance + 1.0;
852 swipePrivate->transitionManager->cancel();
853 swipe.setPosition(position);
857 if (event->position().toPoint().y() < 0 || event->position().toPoint().y() > height) {
860 q->setPressed(
false);
866 return q->keepMouseGrab();
873 Q_Q(QQuickSwipeDelegate);
875 swipePrivate->velocityCalculator.stopMeasuring(event->position().toPoint(), event->timestamp());
877 const bool hadGrabbedMouse = q->keepMouseGrab();
878 q->setKeepMouseGrab(
false);
882 if (!qIsNull(swipePrivate->position))
883 q->setPressed(
false);
891 if (hadGrabbedMouse) {
894 q->setPressed(
false);
901 if (item != q && (swipePrivate->complete || swipePrivate->wasComplete))
902 forwardMouseEvent(event, item, item->mapFromScene(event->scenePosition()));
905 const qreal swipeVelocity = swipePrivate->velocityCalculator.velocity().x();
906 if (swipePrivate->position > 0.5 ||
907 (swipePrivate->position > 0.0 && swipeVelocity > exposeVelocityThreshold)) {
908 swipePrivate->beginTransition(1.0);
910 }
else if (swipePrivate->position < -0.5 ||
911 (swipePrivate->position < 0.0 && swipeVelocity < -exposeVelocityThreshold)) {
912 swipePrivate->beginTransition(-1.0);
918 if (!qFuzzyIsNull(swipePrivate->position))
919 swipePrivate->beginTransition(0.0);
924 attachedObjectsSetPressed(item, event->scenePosition(),
false);
927 return hadGrabbedMouse;
931
932
935 Q_Q(QQuickSwipeDelegate);
936 QMutableSinglePointEvent localizedEvent(*event);
937 QMutableEventPoint::setPosition(localizedEvent.point(0), localPos);
938 QGuiApplication::sendEvent(destination, &localizedEvent);
939 q->setPressed(!localizedEvent.isAccepted());
943
944
945
946
947
948
952 QVarLengthArray<QQuickItem *, 16> itemAndChildren;
953 itemAndChildren.append(item);
954 for (
int i = 0; i < itemAndChildren.size(); ++i) {
955 auto item = itemAndChildren.at(i);
956 auto posInItem = item->mapFromScene(scenePos);
957 if (item->contains(posInItem)) {
958 if (
Attached *attached = attachedObject(item)) {
959 const bool wasPressed = attached->isPressed();
960 attached->setPressed(pressed);
961 if (wasPressed && !pressed && !cancel)
962 emit attached->clicked();
966 for (
auto child : item->childItems())
967 itemAndChildren.append(child);
977 QQuickAnchors *anchors = QQuickItemPrivate::get(item)->_anchors;
978 if (anchors && (anchors->fill() || anchors->centerIn() || anchors->left().item || anchors->right().item)
979 && !item->property(
"_q_QQuickSwipeDelegate_warned").toBool()) {
980 qmlWarning(item) << QString::fromLatin1(
"SwipeDelegate: cannot use horizontal anchors with %1; unable to layout the item.").arg(itemName);
981 item->setProperty(
"_q_QQuickSwipeDelegate_warned",
true);
987 warnIfHorizontallyAnchored(background, QStringLiteral(
"background"));
988 warnIfHorizontallyAnchored(contentItem, QStringLiteral(
"contentItem"));
997 QQuickItemDelegatePrivate::resizeContent();
998 }
else if (contentItem) {
999 Q_Q(QQuickSwipeDelegate);
1000 contentItem->setY(q->topPadding());
1001 contentItem->setWidth(q->availableWidth());
1002 contentItem->setHeight(q->availableHeight());
1008 return QQuickTheme::palette(QQuickTheme::ListView);
1012
1013
1014
1015
1016
1019 if (!childItem || !event)
1022 QQuickItem *item =
nullptr;
1024 if (childItem->acceptedMouseButtons() &&
1025 childItem->contains(childItem->mapFromScene(event->scenePosition()))) {
1028 const auto &childItems = childItem->childItems();
1029 for (
const auto &child: childItems) {
1030 if ((item = getPressedItem(child, event)))
1038QQuickSwipeDelegate::QQuickSwipeDelegate(QQuickItem *parent)
1039 : QQuickItemDelegate(*(
new QQuickSwipeDelegatePrivate(
this)), parent)
1042 setAcceptTouchEvents(
false);
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1067
1068
1069
1070
1071
1072
1073
1074
1075
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211QQuickSwipe *QQuickSwipeDelegate::swipe()
const
1213 Q_D(
const QQuickSwipeDelegate);
1214 return const_cast<QQuickSwipe*>(&d->swipe);
1217QQuickSwipeDelegateAttached *QQuickSwipeDelegate::qmlAttachedProperties(QObject *object)
1219 return new QQuickSwipeDelegateAttached(object);
1224 return item && (child == item || item->isAncestorOf(child));
1227bool QQuickSwipeDelegate::childMouseEventFilter(QQuickItem *child, QEvent *event)
1229 Q_D(QQuickSwipeDelegate);
1235 const QQuickSwipePrivate *swipePrivate = QQuickSwipePrivate::get(&d->swipe);
1236 if (!isChildOrGrandchildOf(child, swipePrivate->leftItem) && !isChildOrGrandchildOf(child, swipePrivate->behindItem)
1237 && !isChildOrGrandchildOf(child, swipePrivate->rightItem)) {
1241 switch (event->type()) {
1242 case QEvent::MouseButtonPress: {
1243 return d->handleMousePressEvent(child,
static_cast<QMouseEvent *>(event));
1244 }
case QEvent::MouseMove: {
1245 return d->handleMouseMoveEvent(child,
static_cast<QMouseEvent *>(event));
1246 }
case QEvent::MouseButtonRelease: {
1249 QMouseEvent *mouseEvent =
static_cast<QMouseEvent *>(event);
1250 QQuickItemDelegate::mouseReleaseEvent(mouseEvent);
1251 return d->handleMouseReleaseEvent(child, mouseEvent);
1252 }
case QEvent::UngrabMouse: {
1256 Attached *attached = attachedObject(child);
1258 attached->setPressed(
false);
1267void QQuickSwipeDelegate::mousePressEvent(QMouseEvent *event)
1269 Q_D(QQuickSwipeDelegate);
1270 QQuickItemDelegate::mousePressEvent(event);
1272 QQuickSwipePrivate *swipePrivate = QQuickSwipePrivate::get(&d->swipe);
1273 if (!swipePrivate->enabled)
1276 swipePrivate->positionBeforePress = swipePrivate->position;
1277 swipePrivate->velocityCalculator.startMeasuring(event->position().toPoint(), event->timestamp());
1279 if (swipePrivate->complete) {
1280 d->pressedItem = d->getPressedItem(d->swipe.rightItem(), event);
1281 if (!d->pressedItem)
1282 d->pressedItem = d->getPressedItem(d->swipe.leftItem(), event);
1284 d->handleMousePressEvent(d->pressedItem, event);
1288void QQuickSwipeDelegate::mouseMoveEvent(QMouseEvent *event)
1290 Q_D(QQuickSwipeDelegate);
1291 if (filtersChildMouseEvents())
1292 d->handleMouseMoveEvent(
this, event);
1294 QQuickItemDelegate::mouseMoveEvent(event);
1296 d->handleMouseMoveEvent(d->pressedItem, event);
1299void QQuickSwipeDelegate::mouseReleaseEvent(QMouseEvent *event)
1301 Q_D(QQuickSwipeDelegate);
1302 if (!filtersChildMouseEvents() || !d->handleMouseReleaseEvent(
this, event))
1303 QQuickItemDelegate::mouseReleaseEvent(event);
1305 if (d->pressedItem) {
1306 if (d->pressedItem->acceptedMouseButtons())
1307 d->handleMouseReleaseEvent(d->pressedItem, event);
1308 d->pressedItem =
nullptr;
1312void QQuickSwipeDelegate::mouseUngrabEvent()
1314 Q_D(QQuickSwipeDelegate);
1317 auto item = d->swipe.rightItem();
1319 if (
auto control = qmlobject_cast<QQuickControl *>(item))
1320 QQuickControlPrivate::get(control)->handleUngrab();
1321 Attached *attached = attachedObject(item);
1323 attached->setPressed(
false);
1325 item = d->swipe.leftItem();
1327 if (
auto control = qmlobject_cast<QQuickControl *>(item))
1328 QQuickControlPrivate::get(control)->handleUngrab();
1329 Attached *attached = attachedObject(item);
1331 attached->setPressed(
false);
1335 d->pressedItem =
nullptr;
1338void QQuickSwipeDelegate::touchEvent(QTouchEvent *event)
1345void QQuickSwipeDelegate::componentComplete()
1347 Q_D(QQuickSwipeDelegate);
1348 QQuickItemDelegate::componentComplete();
1349 QQuickSwipePrivate::get(&d->swipe)->reposition(DontAnimatePosition);
1352void QQuickSwipeDelegate::geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry)
1354 Q_D(QQuickSwipeDelegate);
1355 QQuickControl::geometryChange(newGeometry, oldGeometry);
1357 if (isComponentComplete() && !qFuzzyCompare(newGeometry.width(), oldGeometry.width())) {
1358 QQuickSwipePrivate *swipePrivate = QQuickSwipePrivate::get(&d->swipe);
1359 swipePrivate->reposition(DontAnimatePosition);
1363QFont QQuickSwipeDelegate::defaultFont()
const
1365 return QQuickTheme::font(QQuickTheme::ListView);
1368#if QT_CONFIG(accessibility)
1369QAccessible::Role QQuickSwipeDelegate::accessibleRole()
const
1371 return QAccessible::ListItem;
1377 Q_DECLARE_PUBLIC(QQuickSwipeDelegateAttached)
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1404QQuickSwipeDelegateAttached::QQuickSwipeDelegateAttached(QObject *object)
1405 : QObject(*(
new QQuickSwipeDelegateAttachedPrivate), object)
1407 QQuickItem *item = qobject_cast<QQuickItem *>(object);
1413 item->setAcceptedMouseButtons(Qt::AllButtons);
1415 qWarning() <<
"SwipeDelegate attached property must be attached to an object deriving from Item";
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505bool QQuickSwipeDelegateAttached::isPressed()
const
1507 Q_D(
const QQuickSwipeDelegateAttached);
1511void QQuickSwipeDelegateAttached::setPressed(
bool pressed)
1513 Q_D(QQuickSwipeDelegateAttached);
1514 if (pressed == d->pressed)
1517 d->pressed = pressed;
1518 emit pressedChanged();
1523#include "moc_qquickswipe_p.cpp"
1524#include "moc_qquickswipedelegate_p.cpp"
bool handleMouseMoveEvent(QQuickItem *item, QMouseEvent *event)
void forwardMouseEvent(QMouseEvent *event, QQuickItem *destination, QPointF localPos)
void resizeBackground() override
QPalette defaultPalette() const override
bool attachedObjectsSetPressed(QQuickItem *item, QPointF scenePos, bool pressed, bool cancel=false)
QQuickItem * getPressedItem(QQuickItem *childItem, QMouseEvent *event) const
bool handleMouseReleaseEvent(QQuickItem *item, QMouseEvent *event)
bool handleMousePressEvent(QQuickItem *item, QMouseEvent *event)
void resizeContent() override
void warnAboutMixingDelegates()
void createAndShowRightItem()
void createAndShowLeftItem()
QQuickVelocityCalculator velocityCalculator
QQuickItem * showRelevantItemForPosition(qreal position)
qreal positionBeforePress
QScopedPointer< QQuickSwipeTransitionManager > transitionManager
bool isTransitioning() const
void reposition(PositionAnimation animationPolicy)
bool hasDelegates() const
void createAndShowBehindItem()
QQuickTransition * transition
QQuickItem * createDelegateItem(QQmlComponent *component)
QQuickItem * createRelevantItemForDistance(qreal distance)
void beginTransition(qreal position)
QQuickSwipeDelegate * control
void warnAboutSettingDelegatesWhileVisible()
QQuickSwipeTransitionManager(QQuickSwipe *swipe)
void transition(QQuickTransition *transition, qreal position)
Combined button and popup list for selecting options.
QQuickSwipeDelegateAttached Attached
Attached * attachedObject(QQuickItem *item)
static bool isChildOrGrandchildOf(QQuickItem *child, QQuickItem *item)
static const qreal exposeVelocityThreshold
static void warnIfHorizontallyAnchored(QQuickItem *item, const QString &itemName)