Skip to content

Commit

Permalink
QAIV drop indicator: don't draw a single pixel when the rect is null
Browse files Browse the repository at this point in the history
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 39e7016)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
  • Loading branch information
dfaure-kdab authored and Qt Cherry-pick Bot committed Oct 2, 2024
1 parent fb69c5a commit 65a48e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/widgets/itemviews/qabstractitemview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/itemviews/qabstractitemview_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 65a48e7

Please sign in to comment.