From 631ef6745854127e73783573fe2d6a09bd5ef87b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 4 Dec 2019 10:26:41 +0100 Subject: QQuickTableView: fix warning message Fix up small copy/paste bug. Change-Id: I0f6c648679c025af9dcebf9459116c6cd6452a14 Reviewed-by: Shawn Rutledge --- src/quick/items/qquicktableview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick/items') diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index b9649634c8..e12bd5dea4 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1252,9 +1252,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; -- cgit v1.2.3 From 41dd68344c3d7d0a6a5afc93ab4a05157bed3d3c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 2 Dec 2019 16:50:20 +0100 Subject: QQuickTableView: Clear items before deleting the model Fixes: QTBUG-71374 Change-Id: I534b7612268bb9407844961267865f490d7ff7b2 Reviewed-by: Richard Moe Gustavsen --- src/quick/items/qquicktableview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick/items') diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index e12bd5dea4..e7c6d51cbf 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -2245,6 +2245,7 @@ void QQuickTableViewPrivate::syncModel() if (instanceModel) { if (tableModel) { + releaseLoadedItems(QQmlTableInstanceModel::NotReusable); delete tableModel; tableModel = nullptr; } -- cgit v1.2.3 From e394979d24c83f0b937c9c436173c6a573e5644a Mon Sep 17 00:00:00 2001 From: Shin-ichi Okada Date: Thu, 14 Nov 2019 16:16:39 +0900 Subject: Fix incorrect behavior of PathView with ungrabMouse() When the grabbed Item is released and then grabbed again, if ungrabMouse () is called, the animation stops. In order to avoid this, when ungrabMouse () is called, if offset is different, it is modified to animate. Task-number: QTBUG-79592 Change-Id: I61cbd4dad90643722f12480f0dab3859ce116af8 Reviewed-by: Mitch Curtis --- src/quick/items/qquickpathview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/quick/items') 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(); -- cgit v1.2.3 From e2af7c3b37095e601a84cc52de69a99af8e5d3a2 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 2 Dec 2019 16:43:05 +0100 Subject: Fix ObjectModel item not being rendered when moved between models When moving an item from ObjectModel A to ObjectModel B, polishes are scheduled for the respective ListViews in order: the ListView for A first, and then the ListView for B. However, when it comes time to do the actual polishing via updatePolish(), the list of items is traversed backwards. This means that the following calls var item = objectModelA.get(0) objectModelA.remove(0, 1) objectModelB.insert(0, item) will result in updatePolish() being called for ListView B first, and then ListView A. As a result of this, setCulled(false) will be called by ListView B (since the item is now visible within it), followed by ListView A calling setCulled(true) (since the item is now no longer in it). As there is no way for these models to know about each other (and it's not feasible to store refcounts in QQuickItemPrivate::extraData, since ObjectModel is in QtQml.Models, which can't know about QtQuick), this patch makes ListView check if the item is parented to its contentItem before culling it. This prevents it from hiding items which are no longer shown in its view. Change-Id: If50614ebc269fae875195bbc63c0c04dab237775 Fixes: QTBUG-67986 Reviewed-by: Fabian Kosmale --- src/quick/items/qquickitemview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/quick/items') diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 857b1a1c34..c58572de0f 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -2399,7 +2399,11 @@ bool QQuickItemViewPrivate::releaseItem(FxViewItem *item) flags = model->release(item->item); 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); -- cgit v1.2.3