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 <axel.spoerl@qt.io>
(cherry picked from commit 39e7016e8a0cc749d9be83e88ef94b3df40d7cc1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
David Faure 2024-09-30 21:58:51 +02:00 committed by Qt Cherry-pick Bot
parent fb69c5a354
commit 65a48e7ab8
2 changed files with 3 additions and 2 deletions

View File

@ -3415,7 +3415,7 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde
} }
} }
if (isVisible() && !d->delayedPendingLayout) { if (isVisible() && !d->delayedPendingLayout) {
// otherwise the items will be update later anyway // otherwise the items will be updated later anyway
update(topLeft); update(topLeft);
} }
} else { } else {

View File

@ -164,6 +164,7 @@ public:
inline void paintDropIndicator(QPainter *painter) inline void paintDropIndicator(QPainter *painter)
{ {
if (showDropIndicator && state == QAbstractItemView::DraggingState if (showDropIndicator && state == QAbstractItemView::DraggingState
&& !dropIndicatorRect.isNull()
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
&& viewport->cursor().shape() != Qt::ForbiddenCursor && viewport->cursor().shape() != Qt::ForbiddenCursor
#endif #endif