From 65a48e7ab81782586f0063b8a5e88674cb07bf4e Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 30 Sep 2024 21:58:51 +0200 Subject: [PATCH] QAIV drop indicator: don't draw a single pixel when the rect is null Drive-by change: fix a trivial typo Also, clang-format changed some indentation Fixes: QTBUG-36831 Change-Id: Icb259cc8a1fc83aca3d4cd581fa0e88e7907602b Reviewed-by: Axel Spoerl (cherry picked from commit 39e7016e8a0cc749d9be83e88ef94b3df40d7cc1) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/itemviews/qabstractitemview.cpp | 2 +- src/widgets/itemviews/qabstractitemview_p.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index ba5582dc138..f5698b7dcbb 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -3415,7 +3415,7 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde } } if (isVisible() && !d->delayedPendingLayout) { - // otherwise the items will be update later anyway + // otherwise the items will be updated later anyway update(topLeft); } } else { diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index 433429f48b8..600f9c7575b 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -164,10 +164,11 @@ class Q_AUTOTEST_EXPORT QAbstractItemViewPrivate : public QAbstractScrollAreaPri inline void paintDropIndicator(QPainter *painter) { if (showDropIndicator && state == QAbstractItemView::DraggingState + && !dropIndicatorRect.isNull() #ifndef QT_NO_CURSOR && viewport->cursor().shape() != Qt::ForbiddenCursor #endif - ) { + ) { QStyleOption opt; opt.initFrom(q_func()); opt.rect = dropIndicatorRect;