diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-05 01:00:07 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-12-05 10:09:17 +0100 |
commit | 88490da44e8afa0f4d03ca79bcc928a14412ef99 (patch) | |
tree | 41b40fe0f36c5ed49d0b8a2ce54421eb4dfbfd3b /src | |
parent | 6ad3445f1e159d9beea936b66d267dcaacdc5d6c (diff) | |
parent | e2af7c3b37095e601a84cc52de69a99af8e5d3a2 (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
Change-Id: Ib46bc1c717cf524eea2fb3d876810c8d55747c91
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 6 | ||||
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 5 | ||||
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 5 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index e88f60db6d..7f228e1c05 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -2441,7 +2441,11 @@ bool QQuickItemViewPrivate::releaseItem(FxViewItem *item, QQmlInstanceModel::Reu flags = model->release(item->item, reusableFlag); if (!flags) { // item was not destroyed, and we no longer reference it. - QQuickItemPrivate::get(item->item)->setCulled(true); + if (item->item->parentItem() == contentItem) { + // Only cull the item if its parent item is still our contentItem. + // One case where this can happen is moving an item out of one ObjectModel and into another. + QQuickItemPrivate::get(item->item)->setCulled(true); + } unrequestedItems.insert(item->item, model->indexOf(item->item, q)); } else if (flags & QQmlInstanceModel::Destroyed) { item->item->setParentItem(nullptr); diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index 6976665134..7ebe174a9e 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -1922,9 +1922,10 @@ bool QQuickPathView::childMouseEventFilter(QQuickItem *i, QEvent *e) void QQuickPathView::mouseUngrabEvent() { Q_D(QQuickPathView); - if (d->stealMouse) { + if (d->stealMouse || + (!d->flicking && d->snapMode != NoSnap && !qFuzzyCompare(qRound(d->offset), d->offset))) { // if our mouse grab has been removed (probably by a Flickable), - // fix our state + // or if we should snap but haven't done it, fix our state d->stealMouse = false; setKeepMouseGrab(false); d->timer.invalidate(); diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index ec2fe75d9b..f1002badd1 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1249,9 +1249,9 @@ qreal QQuickTableViewPrivate::getColumnLayoutWidth(int column) if (qIsNaN(columnWidth) || columnWidth <= 0) { if (!layoutWarningIssued) { layoutWarningIssued = true; - qmlWarning(q_func()) << "the delegate's implicitHeight needs to be greater than zero"; + qmlWarning(q_func()) << "the delegate's implicitWidth needs to be greater than zero"; } - columnWidth = kDefaultRowHeight; + columnWidth = kDefaultColumnWidth; } return columnWidth; @@ -2242,6 +2242,7 @@ void QQuickTableViewPrivate::syncModel() if (instanceModel) { if (tableModel) { + releaseLoadedItems(QQmlTableInstanceModel::NotReusable); delete tableModel; tableModel = nullptr; } |